Skip to content

UI/UX improvements: reorderable sidebar, richer search, partial paste, settings & theme system#1

Merged
mindaugaskasp merged 10 commits into
mainfrom
claude/diff-bro-ui-improvements-szte65
Jul 23, 2026
Merged

UI/UX improvements: reorderable sidebar, richer search, partial paste, settings & theme system#1
mindaugaskasp merged 10 commits into
mainfrom
claude/diff-bro-ui-improvements-szte65

Conversation

@mindaugaskasp

Copy link
Copy Markdown
Owner

A batch of UI/UX improvements. Every commit passes npm run check (lint + style-token guard + 275 tests) and a full npm run build.

Menu / toolbar

  • Mermaid Expand fixed — it was opening behind the still-open snippet editor (siblings at the same stacking level). The editor now closes first and the viewer renders in a full-window layer above every dialog.
  • Edit → AutoFill suppressed on macOS (the AppKit-injected item, handled like the existing Dictation/Emoji suppression). Needs a quick verify on a real Mac — harmless if the key is ignored.
  • Help → Keyboard Shortcuts — a grouped dialog listing every binding for the host OS, backed by a shared utils/shortcuts.js (also feeds the floating hint bar).
  • Tools grouped per format: Base64 / JSON / XML / SQL / Text Encryption (both the native menu and the in-app bar).
  • Removed the redundant "Diff Bro" toolbar title.

Diff & paste

  • Search gains match-case and whole-word toggles, plus safety-limited regex (utils/searchRegex.js refuses over-long / catastrophic-backtracking patterns before Monaco ever runs them).
  • Partial paste — paste text on one side and drop/choose a real file on the other, then Compare. Paste panes capture their own drops; the window-level diff drop stands down in paste mode.
  • Compare/Cancel re-centered under the panes.

Sidebar, settings & sharing

  • Reorderable sections (Saved / External / Snippets) via up/down controls in a shared SectionHeader; each section extracted into its own component.
  • Drag-reorderable saved-diff categories, reconciled against the categories that exist.
  • New plaintext settings.json store (stores/settingsStore.js): section order, shelf order, shortcut-bar visibility, and user-raisable comparison-file / snippet size limits with safe defaults and hard ceilings. Main reads it fresh to enforce the large-file threshold; the Settings dialog gains an Interface section.
  • Categories are local-only — never offered or sent in the share flow.

Design system

  • Color palette split into styles/themes.css; tokens.css keeps only the theme-independent scale, so a future color theme can't disturb structure/alignment.
  • App-wide .section-actions spacing + rhythm tokens, so a section's buttons (+ New category, Import, + New snippet) can't drift out of alignment again.

Notes

  • UI changes are being validated in the Docker env (.vue files are verified there, not in unit tests) — screenshots to follow in the thread.
  • Shelf drag-reorder is implemented for saved-diff categories (the meaningful reorderable unit); Snippets/External have only fixed Favorites/All shelves.

🤖 Generated with Claude Code


Generated by Claude Code

claude added 7 commits July 22, 2026 06:08
…search

- Fix Mermaid "Expand": close the snippet editor first and raise the viewer
  above all dialogs, so the diagram window actually appears
- Restructure Tools into per-format submenus (Base64 / JSON / XML / SQL /
  Text Encryption) in both the native menu and the in-app menu bar
- Add Help → Keyboard Shortcuts listing every shortcut for the host OS,
  backed by a shared utils/shortcuts.js (also feeds the floating hint bar)
- Suppress the macOS-injected Edit → AutoFill item
- Remove the redundant "Diff Bro" toolbar title
- Diff search: add match-case and whole-word toggles, and guard regex search
  against ReDoS/over-long patterns (utils/searchRegex.js)
- Align the "Saved diffs" header with the Left/Right file-slot labels and add
  bottom spacing beneath the Snippets section

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6QHAnibiPenmyN7q3Rh4m
- New settingsStore persisted to settings.json (unencrypted): section order,
  shelf order, shortcut-bar visibility, and user-raisable comparison-file and
  snippet size limits with safe defaults and hard ceilings
- Settings dialog gains an Interface section for the shortcut bar and the two
  size limits; the shortcut bar now reads its visibility from settings
- Enforce the comparison-file limit in the main process (read fresh from
  settings.json) and the snippet-size limit at save time
- Save dialog no longer offers a category when saving as part of a share:
  categories are a local organizing tool and never travel to a recipient

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6QHAnibiPenmyN7q3Rh4m
- Split the sidebar into self-contained SavedDiffs / External / Snippets
  sections behind a shared SectionHeader with up/down move controls; the
  section order persists in settings.json
- Saved-diff categories are now drag-reorderable, persisted per-section in
  settings.shelfOrder and reconciled against the categories that exist
- SavedDiffs.vue becomes a thin ordering container; header band styles move
  into SectionHeader so every section reads and behaves identically

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6QHAnibiPenmyN7q3Rh4m
- Each paste side is independently a textarea or a loaded file (drop onto the
  pane, or "load file…"), so typed text on one side can be compared against a
  real file on the other; Compare and snapshot/restore honor both
- Paste panes capture their own drops; the window-level diff drop stands down
  in paste mode
- Rework the paste layout with per-side headers and keep the Compare/Cancel
  actions centered under the two panes

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6QHAnibiPenmyN7q3Rh4m
- Move the color palette into styles/themes.css; tokens.css now holds only the
  theme-independent scale (radius/type/spacing/control heights), so a future
  color theme can be added without touching structure or alignment
- Add app-wide .section-actions / .section-inset classes and section-rhythm
  tokens; every sidebar section's action row (+ New category, Import,
  + New snippet) now draws its inset from one place instead of restating pixel
  padding, fixing the buttons that sat too close to the section header

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6QHAnibiPenmyN7q3Rh4m
The viewer's zoom/pan .transform wrapper shrink-wrapped to 0×0, so the
diagram rendered into the DOM but collapsed to nothing (the other half of the
"Expand shows nothing" report — the first half was the editor covering it).
Give .transform a definite box (fill the stage, center its content) so the
diagram fits and scales; verified rendering in Chromium.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6QHAnibiPenmyN7q3Rh4m

Copy link
Copy Markdown
Owner Author

UI/UX validation

The noVNC/Electron route isn't reachable from CI here (the Docker registry and the Electron binary download are both blocked), so I validated the renderer — where all these changes live — by loading the production build in headless Chromium (Playwright) with a stubbed window.api, driving the real UI, and inspecting each screen. npm run check (lint + style-token guard + 275 tests) and npm run build both pass.

Verified working, no console errors (only a harmless /favicon.ico 404 from the static test server):

  • No "Diff Bro" title; toolbar options right-aligned; Help menu present.
  • Sidebar: section move ▲/▼ (first section's ▲ / last section's ▼ correctly disabled), category drag grip, + New category / Import / + New snippet no longer glued to their headers. Confirmed reordering actually changes and persists the order (Saved, External, SnippetsExternal, Saved, Snippets).
  • Search: Aa (match case), [W] (whole word), .* (regex) toggles per side, match count, jump-to-match.
  • Partial paste: per-side ORIGINAL/CHANGED headers with load file…; Compare/Cancel centered under the panes.
  • Tools flyouts (Base64 → Encode / Decode · Ctrl+Shift+B, etc.).
  • Help → Keyboard Shortcuts dialog grouped by File/Edit/View/Tools with host-OS bindings.
  • Settings → Interface (shortcut-bar toggle, max comparison file, max snippet size).
  • Light + dark themes both render cleanly (themes.css split).

One extra bug found and fixed during validation

The Mermaid Expand viewer opened but the diagram was invisible. Root cause: the zoom/pan .transform wrapper shrink-wrapped to 0×0, collapsing the diagram (this was the second half of the original "Expand shows nothing" report — the first half was the editor covering the viewer). Gave .transform a definite box; the diagram now fits and scales. Pushed in 3015da3 and re-verified rendering in Chromium.


Generated by Claude Code

claude and others added 3 commits July 22, 2026 08:30
The ReDoS heuristic treated ']' like a group close, so safe patterns such as
[-+]+, [ab*]+ and [/*]+ were refused as nested quantifiers. A '*'/'+' before a
character-class close is a literal; only a quantified group ')...' can backtrack
catastrophically. Narrow the signature to ')' and cover it with a test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V6QHAnibiPenmyN7q3Rh4m
Tests
- E2E (Playwright _electron): paste-compare diff stats, save + relaunch
  reopen (vault encrypt/decrypt round-trip), Share first-time key setup,
  Mermaid viewer + editor preview SVGs, real OS-clipboard write, on-the-fly
  category creation, and the editor's live auto-detect indicator.
- Unit: useTagInput (commit/dedupe/cap/backspace event logic) and
  useSnippetFilters (name/tag search, AND-composition, DEFAULT, favorites) —
  the previously untested composables CLAUDE.md flags as the home for this
  interaction logic.

Auto-detect
- detectSnippetLanguage now covers every offered syntax (adds YAML/K8s,
  Python, shell, PHP, JS, TS, XML, HTML, CSS, Dockerfile, Go, Rust, Java),
  ordered most-distinctive-first with anti-false-positive guards (fenced
  block is Markdown not its inner code; TS before JS; HTML-only tags before
  generic XML; code braces disqualify CSS/YAML). Best-effort — a miss lands
  on plaintext rather than mis-coloring. Positive + negative test matrix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mindaugaskasp
mindaugaskasp merged commit c7cfa5b into main Jul 23, 2026
1 check passed
@mindaugaskasp
mindaugaskasp deleted the claude/diff-bro-ui-improvements-szte65 branch July 23, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants