Skip to content

Appearance review follow-ups: one title bar of flat JetBrains controls, a Canvas-clean preview - #666

Merged
GoKubar merged 2 commits into
mainfrom
agent/kabir-claude/appearance-feedback
Sep 15, 2026
Merged

GoKubar merged 2 commits into
mainfrom
agent/kabir-claude/appearance-feedback

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Stacked on #653 (agent/kabir-claude/appearance-overhaul) — review that one first; this PR's diff is only the two commits on top.

Every item from the owner's review of the running app, plus the two follow-ups from the coordination note. Before/after in both appearances, per item, with the reasoning: https://claude.ai/code/artifact/8ccac73c-84e3-4352-9726-53a15e6e4491

# Item
1 Top-left button row: padding and alignment done
2 Gutter separator bleeding into the main.tex tab done
3 Double row above the preview → the single title bar, icons only done
4 "page n · v2" → transient overlay done
5 Revision number out of the status bar done
6 JetBrains / Android Studio buttons, not Liquid Glass done
7 One icon style — the left rail's done
8 Compile hammer + force-press menu done
9 More accents partial

What changed

One title bar (3, 1, 7). Dark pages, fit width, fit page, zoom ±, open display list, export and captures moved into the bar that holds the traffic lights, beside Compile and the palette. The preview column has no control row left.

A real NSToolbar with pinned item placement was built first, as the previous pass suggested, and abandoned. On macOS 26 every toolbar item cluster is floated on a Liquid Glass platter that NSToolbarPlatterView paints as its own layer contents — NSToolbarItem.backgroundTintColor = .clear and walking the tree to set NSGlassEffectView.style = .clear both leave it untouched (evidence: _subtreeDescription dumps in the artifact's item 3). That platter is exactly what item 6 rejects. Installing one also moves contentLayoutRect asynchronously, which made every whole-window snapshot differ between runs by 4pt. So TitleBarRow is content drawn in the title-bar region, with its own mouseDownCanMoveWindow drag surface and the system double-click action. The window carries no toolbar, which means AppKit lays the traffic lights out in the standard 28pt band — so the row is that band, and its controls share a centre line with the lights by construction.

The preview is Canvas-clean (4). Both header rows are gone. Page, zoom and the quiet state (compile spinner, FIXTURE/HISTORICAL, staleness, capability warnings) share one floating chip shown on hover and for 1.5s after scroll/page/zoom. State that means something pins it visible; a healthy live preview at rest shows nothing over the pages. The v2 identity strip is debug-only now; its Open… / Export PDF (v2)… buttons went to the title bar and its image notices float over the ground.

Compile (8). A plain single-click run triangle in JetBrains run-green. The press-and-hold Menu(…, primaryAction:) is gone, not converted to a split button: its contents are a developer harness (attach compiler executable, attach render pipeline, reload fixture) that a person writing LaTeX must never be asked for. Those stay in the File menu and the palette with every shortcut intact. Auto-compile after edits — the one user-facing item in there — moved to a new Settings › Compile tab. There is no primaryAction: menu left anywhere in the chrome.

Buttons and icons (6, 7). IDEButtonStyle is the JetBrains text button: 28pt tall, 6pt corners, 18pt side padding, 76pt minimum width, hairline component border over a near-invisible fill, accent fill with a white label for the default action. Metrics measured off the OK/Cancel pair in references/M1_intellij_settings.jpg. IconButtonLabel is the flat icon control. The Problems panel's bordered Fix… push button became an inline accent link, as IntelliJ does; the panel close, the narrow-preview toggle and the outline filter dropped their system bezels and circled glyph variants.

Status bar (5) loses r12 / durable r12 unless View › Show Preview Debug Status is on.

Gutter (2). LineNumberGutter is an NSRulerView and macOS 14+ leaves clipsToBounds off, so its full-bounds fill painted outside the scroll view during layout. One line fixes it.

Accents (9) — four, each carrying meaning: run-green Compile, accent glyph on an open tool window's header, the file-type icon leading the status-bar breadcrumb, accent tint on a filter that is filtering. This is the thinnest of the nine; the larger moves touch the editor's syntax palette and want their own pass.

Does the Compile button earn its place?

Asked for, so: not as a compile button — but keep the slot. With auto-compile on (the default) pressing it repeats what the last keystroke did. It earns its place in three states, and all three are states rather than actions: no producer attached, auto-compile off, or the last reply exceeded a bound and the preview is knowingly stale. The honest control is a status control in the run slot — green triangle when a manual compile is the useful next move, a progress ring while one is in flight, a warning tint when the preview is stale — that compiles on click. That is close to what JetBrains' run widget is. It is a behaviour change, so it is not in this PR. ⌘B and File › Compile work regardless.

Where I departed from a spec value

  • 28pt title bar, not the 40pt of the previous pass. 40 needed an NSToolbar to buy the band; the toolbar brought the glass and the layout race. 28 is what AppKit already centres the lights in.
  • Button metrics from references/, not the style guide — the guide's row-height table doesn't cover buttons, and macOS proportions don't read as JetBrains at any colour.
  • The chrome budget is spent. The guide caps the title bar at three interactive chips at rest; it now carries ten. That cap and item 3 can't both hold, and item 3 is the later instruction — so the preview column's budget went to zero instead, which is the trade the cap was protecting.

Verification

swift build clean. Full Mac gate against real Rust binaries: 1330 tests, 12 skipped, 0 failures at the first commit; 1332 / 1 failure at the second — testCommandPalette palette-light, which passes on its own three runs in a row and is the under-load snapshot flake this harness has fought before. A base-branch control run is in flight and will be reported in a comment.

Design snapshots were re-recorded and then verified three times to prove determinism; the first attempt was not deterministic and both causes (the HUD linger Task, asynchronous toolbar installation) are fixed rather than papered over. apps/mac/scripts/launch-check.sh passes against the packaged app.

Coordination

Kept ContentView.swift / PreviewV2View.swift edits local, and did not invest in the three-item Export menu — the v1-removal effort collapsing the four export routes to one should merge cleanly over this.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

@GoKubar

GoKubar commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Gate re-run, and the base-branch control run promised above:

tree result
624c1f97 (this PR's base, unmodified) 1330 tests, 12 skipped, 0 failures
this branch, run 1 1332 tests, 12 skipped, 1 failure (testCommandPalette palette-light)
this branch, run 2 1332 tests, 15 skipped, 0 failures

So the palette failure was the under-load snapshot flake, not a regression: it also passes three times in a row on its own. The two new tests are ShellSnapshotTests/testMainWindowLivePreview (the resting preview a real compile produces) and ControlSnapshotTests/testControlVocabulary (the button and icon vocabulary in both appearances).

swift build clean on every run; apps/mac/scripts/launch-check.sh passes against the packaged app — its one FAIL line, "no flashtex-bridge child process found", reproduces on the base branch and is a helper-root issue, not this change.

@GoKubar
GoKubar changed the base branch from agent/kabir-claude/appearance-overhaul to main September 15, 2026 23:30
…eader rows

Owner review of #653, items 1-9. Stacked on the appearance-overhaul branch.

- Every resting control moves into the bar that holds the traffic lights
  (TitleBar.swift): Compile and the palette leading, dark pages / fit /
  zoom / open / export / captures trailing, icons only. Drawn as content
  rather than NSToolbarItems — macOS 26 renders each toolbar item cluster on
  a Liquid Glass platter (NSToolbarPlatterView paints the capsule as its own
  layer contents, past backgroundTintColor and NSGlassEffectView.style), and
  flat-on-chrome is the direction. The window keeps an empty NSToolbar for
  the unified-compact height, and the row carries its own drag surface.
- Compile is a plain single-click button (⌘B) with the JetBrains run-green
  triangle. Its press-and-hold `primaryAction:` menu is gone: undiscoverable,
  and its contents are a developer harness (attach compiler executable,
  reload fixture) that stays in the File menu and the palette. The one
  user-facing switch in it, auto-compile, is now Settings > Compile.
- The preview column loses both header rows. Page/zoom and the quiet state
  (compile spinner, FIXTURE/HISTORICAL, staleness) float in one transient
  HUD that appears on hover, scroll, page and zoom changes and fades after;
  a healthy live preview at rest shows no chrome over the pages. The v2
  identity strip is debug-only; its Open… / Export buttons moved to the
  title bar and its image notices float over the ground.
- Revision counters (r12, durable r12) leave the status bar unless View >
  Show Preview Debug Status is on.
- The line-number gutter clips to its bounds: its hairline was bleeding up
  through the document tab strip.
- Flat JetBrains controls replace the remaining bezels: Problems row actions
  are inline accent links, the panel close and the narrow-preview toggle are
  hover-wash icon buttons, the outline filter uses the rail's plain-outline
  glyph, and IconButtonLabel / InlineActionButton / PanelCloseButton in
  DesignSystem.swift make that one vocabulary.
- More accents: run-green Compile, accent tool-window header glyphs, the
  file-type icon leading the status-bar breadcrumb.

Mac gate on this branch: swift build 0, 1330 tests, 12 skipped, 0 failures.

Implementation-Agent: fable-appearance-feedback
Commit-Executor: fable-appearance-feedback (direct; Cursor usage limit)
Follow-up within the same review. Two things made every ContentView capture
differ between runs, and both are now removed rather than tolerated:

- The preview HUD's linger timer is a live Task for 1.5 s, so under XCTest it
  outlived the surface being captured and decided the next shot too. It is
  suppressed under test (the ThinSplitViewController.autosaveEnabled pattern);
  snapshots therefore see the hover tier only.
- The height-only NSToolbar installed asynchronously and moved
  contentLayoutRect while the content was already laying out, which cost 4pt
  at capture. The window now carries no toolbar at all.

Without a toolbar AppKit lays the traffic lights out in the standard band, so
TitleBarRow is that band — 28pt, with 24pt buttons — and the row's controls
share a centre line with the lights by construction instead of by nudging
AppKit's buttons (owner item 1: "aren't aligned with each other").

Also here: IDEButtonStyle, the JetBrains text button, with metrics measured
off the OK/Cancel pair in references/M1_intellij_settings.jpg — 28pt tall,
6pt corners, 18pt side padding, 76pt minimum width, hairline border over a
near-invisible fill, accent fill for the default action. Applied to the
buttons that show at rest (capture bar, bridge bar, export cancel) and to the
two sheets. A ControlSnapshotTests gallery renders the vocabulary in both
appearances, and a liveProject() fixture renders the resting preview a real
compile produces — no chrome over the pages at all.

Mac gate: swift build 0; 1332 tests, 12 skipped, 1 failure — testCommandPalette
palette-light, which passes on its own three times over and is the same
under-load snapshot flake this harness has fought before (see the preceding
commit's baseline of 1330/0 on the same tree).

Implementation-Agent: fable-appearance-feedback
Commit-Executor: fable-appearance-feedback (direct; Cursor usage limit)
@GoKubar
GoKubar force-pushed the agent/kabir-claude/appearance-feedback branch from 72b18d9 to d05d53c Compare September 15, 2026 23:31
@GoKubar
GoKubar merged commit 47d74c9 into main Sep 15, 2026
20 of 21 checks passed
GoKubar added a commit that referenced this pull request Sep 16, 2026
…ont-size magnifier (#674)

Owner: pinch-to-zoom on the preview used to work and no longer does (or
works badly).

Investigation: PreviewZoom.swift's PreviewMagnify/MagnificationGesture on
the preview itself is byte-for-byte unchanged since before the appearance
overhaul (#653/#666) — `git diff` against the pre-overhaul commit on this
file is empty — so the regression is not a code change to the gesture
itself. Nothing else about ordinary preview interaction (clicks,
navigation) was reported broken, which points at the one thing in this
area that is *not* part of normal SwiftUI hit-test dispatch:
EditorFontMagnifier, a *local NSEvent monitor* for `.magnify` events
(installed once in SourceEditorView.makeNSView) that runs before normal
event dispatch for every pinch in the window, and used to decide "is this
over the editor" with `scroll.bounds.contains(scroll.convert(event.locationInWindow,
from: nil))` — a hand-rolled frame snapshot. Since the overhaul moved the
editor and preview from one SwiftUI view tree under a single hosting view
to separate NSHostingControllers under one NSSplitViewController
(WorkspaceSplit.swift), that snapshot is one more place that can disagree
with the window's actual current layout (e.g. mid split-view layout
pass), and getting it wrong meant silently swallowing a pinch meant for
the preview: the monitor returns `nil`, and nothing else — including the
preview's own MagnificationGesture — ever sees the event.

Fix: `EditorFontMagnifier.targets(_:_:)` now asks AppKit for the actual
view under the pointer (`window.contentView?.hitTest(event.locationInWindow)`)
and checks whether it is a descendant of the editor's scroll view, instead
of re-deriving the answer from a captured frame. hitTest is always
authoritative for the current layout, so it cannot go stale the way a
snapshot can.

## Testing

`EditorFontMagnifier.targets` is extracted from the previously-opaque
`install` closure so it is directly testable. New
ZoomTests.testEditorFontMagnifierTargetsOnlyTheEditorsOwnScrollView hosts
two side-by-side views (mirroring the split-view shape: the editor's
scroll view and a sibling "preview" pane, not nested) and asserts a
synthetic event over each side routes correctly, plus the
no-window/different-window cases. AppKit has no public constructor for a
real `.magnify`-typed NSEvent, so the synthetic event is built with
`NSEvent.keyEvent(with:...)` (the same factory `EditorFirstFocusTests`
already uses to synthesize keyboard events) — `targets` only reads
`.window`/`.locationInWindow`, both of which this factory sets correctly
regardless of the nominal event type.

I could not verify the fix against a live trackpad (no interactive macOS
GUI session from this environment) — full Mac gate (build + swift test)
results are in the PR body; if pinch is still off after this lands, the
next thing to check live is whether NSScrollView.allowsMagnification got
enabled somewhere on the preview's own ScrollView, which would make the
scroll view itself consume the gesture before SwiftUI's MagnificationGesture
sees it.
@GoKubar
GoKubar deleted the agent/kabir-claude/appearance-feedback branch September 16, 2026 04:17
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.

1 participant