Skip to content

Commit e207eff

Browse files
committed
Docs: Document the dynamic-text-size decisions
Module-level CLAUDE.md updates for places that gained new architectural behavior with the text-size feature: - `menu/`: Zoom submenu under View (presets + ⌘0/⌘+/⌘-, App scope, Linux skips in/out accelerators). - `stubs/`: new `text_size.rs` stub returning 1.0 for non-macOS. - `views/`: scale-driven column-width re-measure pattern — measurers cache per scale, rebuild on the debounced "settled" event from `text-size.svelte`. FullList/BriefList track via local `scaleSettleTick`. - `tabs/`: tab fills bar height + non-scaled `padding-top: 3px`. Locks the colored top of the active tab below the title-bar at every scale.
1 parent ca78382 commit e207eff

4 files changed

Lines changed: 23 additions & 1 deletion

File tree

apps/desktop/src-tauri/src/menu/CLAUDE.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ template auto-tinting). However, **full-color non-template images do render corr
109109

110110
## Menu structure
111111

112-
Both platforms share: File, Edit, View (with Sort by submenu), Go, Tab, Help.
112+
Both platforms share: File, Edit, View (with Sort by and Zoom submenus), Go, Tab, Help.
113+
114+
The **Zoom** submenu (`build_zoom_submenu`) holds the text-size presets (75/100/125/150 %) plus Zoom in (`Cmd+Plus`) /
115+
Zoom out (`Cmd+Minus`) / 100 % (`Cmd+0`). Items are `App`-scoped so the keyboard accelerators fire in any focused window.
116+
Linux skips the in/out accelerators because GTK intercepts `Cmd+Plus` / `Cmd+Minus` at the toolkit level — the JS
117+
shortcut dispatch path covers Linux.
113118
macOS adds: cmdr (app menu), Window. See the menu item ID constants in `mod.rs` for the full item list.
114119

115120
Viewer windows get a minimal menu: File (Close), Edit (clipboard), View (Word wrap), and on macOS

apps/desktop/src-tauri/src/stubs/CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ On other platforms (not macOS, not Linux), all stubs are used. Never compiled on
1414
| `mtp.rs` | All MTP commands return `MtpConnectionError::NotSupported`; defines its own local `FileEntry` subset and additional stub types: `ConnectedDeviceInfo`, `MtpOperationResult`, `MtpObjectInfo`, `MtpScanResult`. Only compiled on non-macOS, non-Linux platforms. |
1515
| `network.rs` | All ~20 network commands return empty results or errors; types mirror the macOS shapes for JSON compatibility. Only compiled on non-macOS, non-Linux platforms. |
1616
| `permissions.rs` | `check_full_disk_access` always returns `true`; `open_privacy_settings` returns an error. Only compiled on non-macOS, non-Linux platforms. |
17+
| `text_size.rs` | `get_system_text_size_multiplier` returns `1.0` (no system scaling). Compiled on non-macOS — the Sonoma+ Accessibility text-size signal is macOS-only. The user's in-app `appearance.textSize` slider still works on every platform. |
1718
| `volumes.rs` | Returns root `/`, Home, and existing Desktop/Documents/Downloads; `get_volume_space` uses `libc::statvfs`; `start_volume_watcher` is a no-op. Only compiled on non-macOS, non-Linux platforms. |
1819

1920
## Key decisions

apps/desktop/src/lib/file-explorer/tabs/CLAUDE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ Per-pane tab system for the dual-pane file explorer. Each pane side (left/right)
1313

1414
## Key decisions
1515

16+
**Decision**: Tabs fill the entire bar height (`.tab { height: var(--spacing-tab-bar-height) }`) and the bar carries a
17+
non-scaled `padding-top: 3px` to push the colored top of the active tab below the (fixed-height) window title-bar.
18+
**Why**: tab and bar heights both scale with `--font-scale`, so any constant gap between them would scale too — making
19+
the colored top edge drift visibly across text sizes. Locking the tab to bar height eliminates the proportional gap; the
20+
3 px padding gives the static breathing room between title-bar and tab top, hidden inside the bar's own `bg-secondary`
21+
so it reads as a continuous strip. The active tab is `bar-height + 1px` with `margin-bottom: -1px` to cover the bar's
22+
bottom border (unchanged from the historical pattern).
23+
1624
**Decision**: Cold load on tab switch via `{#key activeTabId}` — destroys and recreates FilePane, no warm cache **Why**:
1725
Keeping inactive tabs alive would mean multiple FilePanes with active file watchers, listing caches, and scroll state in
1826
memory. For 10 tabs per pane (20 total), that is untenable. Cold load with cursor-by-filename restoration is fast enough

apps/desktop/src/lib/file-explorer/views/CLAUDE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ halves line up. The contract: `formatDateTimePartsWithFormat` (in `lib/settings/
104104
width; `FullList` renders `.date-left` (inline-block, fixed width, right-aligned) followed by `.date-right`
105105
(`margin-left: var(--spacing-xs)`). Tooltips/MCP/status bar still see joined strings via `formatDateTimeWithFormat`.
106106

107+
**Decision**: Column-width measurers (canvas in `full-list-utils.ts`, pretext in `measure-column-widths.ts` and
108+
`measure-brief-column-widths.ts`) cache their measurer/context per text scale and rebuild on the **debounced** "settled"
109+
scale event from `lib/text-size.svelte::onDebouncedScaleChange`, not on every reactive read. **Why**: the CSS layer
110+
reflows immediately via `--font-scale`, so users see text grow live. Recomputing per-column widths on every slider step
111+
would thrash pretext rebuilds. Coalescing to the same 1 s + idle window the font-metrics IPC uses keeps the UI smooth
112+
during drag and snaps to correct widths once the user releases. `FullList` and `BriefList` track the settle event via a
113+
local `scaleSettleTick` `$state` they bump from the subscription, then read inside the column-width `$effect`.
114+
107115
## Gotchas
108116

109117
**Gotcha**: `$state()` cannot live in `.ts` files **Why**: `virtual-scroll.ts` is pure functions. Reactive state must be

0 commit comments

Comments
 (0)