Skip to content

feat(bar): notch bar appearance option (LAC-3037) - #483

Open
lacymorrow wants to merge 2 commits into
mainfrom
LAC-3037/notch-bar-appearance
Open

feat(bar): notch bar appearance option (LAC-3037)#483
lacymorrow wants to merge 2 commits into
mainfrom
LAC-3037/notch-bar-appearance

Conversation

@lacymorrow

Copy link
Copy Markdown
Owner

Summary

Implements the notch bar appearance from the LAC-3030 investigation (plan: docs/plans/notch-bar-appearance-option.md). Paperclip issue: LAC-3037.

The floating bar can now dock top-flush over the MacBook notch, above the menu bar — a Dynamic-Island-style home for Juno's status/input UI.

Backend (Rust)

  • notch_layout module (platform/macos.rs) — pure, platform-independent layout math: notch geometry from safeAreaInsets / auxiliaryTopLeftArea/auxiliaryTopRightArea, fixed canvas sizing, top-flush centered frame. 6 unit tests.
  • notch moduleenter_notch_mode / exit_notch_mode on the main thread via run_on_main_thread round-trips; window level NSMainMenuWindowLevel+3 (27); overlay collection behavior re-asserted on every mode entry (macOS silently drops CanJoinAllSpaces on re-order). Non-macOS stubs keep the option selectable elsewhere.
  • get_notch_geometry command — frontend reads the silhouette dimensions from the backend (single source of truth).
  • Persisted appearance is re-applied at startup; switching away restores the default floating frame and NSFloatingWindowLevel.

Frontend (TS)

  • NotchBar component — black silhouette welded to the bezel. All state transitions (idle → hover peek → input → working/listening/error) are CSS-only inside a fixed window canvas; the window is never resized per state, so the shape never detaches from the bezel mid-animation.
  • No drag/resize hooks in notch mode — placement is backend-computed.
  • Notch-less Macs / external displays get a centered pill fallback inside the menu bar.
  • Settings: “Notch (Menu Bar)” option in General → bar appearance.

Out of scope (per plan, file separately)

Non-activating-panel typing, click-through cursor poll, SkyLight space pinning.

Verification

  • cargo check clean; cargo clippy 0 warnings
  • cargo test notch_layout: 6/6 pass
  • npx tsc --noEmit clean
  • npm test notch-bar.test.tsx: 5/5 pass (silhouette sizing, pill fallback, CSS expansion, input submit, idle click)
  • constants.generated.ts regenerated via scripts/generate-ts-constants.js — reproduces the committed diff exactly

⚠️ Still needs a built-app run on notch + notch-less hardware (window level/permission behavior differs from dev builds) — noted in LAC-3037.

Prototype finding

A plain borderless NSWindow at level 27 positioned programmatically is not clamped by constrainFrameRect:toScreen:, so no tauri-nspanel dependency or dynamic ObjC subclass was needed for Phase 1.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@lacymorrow
lacymorrow force-pushed the LAC-3037/notch-bar-appearance branch from ab1d83f to 9b15713 Compare July 23, 2026 22:12
@lacymorrow

Copy link
Copy Markdown
Owner Author

Review + hardening pass (6f66368). The red `claude-review` check is infrastructure, not a review verdict — the workflow's `CLAUDE_CODE_OAUTH_TOKEN` secret doesn't exist yet (tracked as LAC-3035), so the action fails env validation on every PR. As a substitute, a local code-reviewer agent pass ran over the full diff; fixes applied:

  • `enter`/`exit_notch_mode` now return `Result` and failures propagate to the `ui_set_bar_config` caller instead of being logged and swallowed
  • The notch bar re-anchors on floating-bar `Moved`/`ScaleFactorChanged` run events (display plug/unplug, scaling changes previously left it stale until the appearance was re-toggled); loop-safe via a `frame_matches` guard that skips `setFrame` when already in place
  • Appearance transitions are serialized with a static mutex so overlapping `ui_set_bar_config` calls can't leave the window contradicting the stored config

Verified: `cargo clippy` clean, 7/7 `notch_layout` unit tests pass (incl. new `frame_matches` test), frontend typecheck/build green in CI.

lacymorrow and others added 2 commits July 23, 2026 19:04
Adds 'notch' as a 7th bar_appearance that docks the floating bar
top-flush over the MacBook notch, above the menu bar:

- notch_layout module (pure math, 6 unit tests): geometry from
  NSScreen safeAreaInsets + auxiliaryTop*Area, fixed canvas sizing,
  top-flush centered frame
- notch module (macOS): enter/exit via run_on_main round-trip,
  window level NSMainMenuWindowLevel+3, collection behavior
  re-asserted on every mode entry; non-macOS no-op stubs
- get_notch_geometry command so the frontend draws a silhouette
  aligned with the hardware cutout
- NotchBar component: CSS-only state transitions inside the fixed
  canvas (window never resized per state), no drag/resize hooks;
  centered pill fallback on notch-less displays
- applied at startup when the saved appearance is 'notch', restored
  to the default floating frame on switch-away

Co-Authored-By: Paperclip <noreply@paperclip.ing>
- enter/exit_notch_mode return Result so window-apply failures reach
  the ui_set_bar_config caller instead of being logged and swallowed
- re-anchor the notch bar on floating-bar Moved/ScaleFactorChanged
  run events (display plug/unplug, scaling changes); loop-safe via a
  frame_matches guard that skips setFrame when already in place
- serialize appearance transitions with a static mutex so overlapping
  ui_set_bar_config calls cannot leave the window contradicting the
  stored config

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@lacymorrow
lacymorrow force-pushed the LAC-3037/notch-bar-appearance branch from 6f66368 to d94c30a Compare July 23, 2026 23:04
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