Skip to content

Window chrome, peer discovery fix, focus mode#90

Merged
johnjazzi merged 10 commits into
mainfrom
dev
Jun 14, 2026
Merged

Window chrome, peer discovery fix, focus mode#90
johnjazzi merged 10 commits into
mainfrom
dev

Conversation

@johnjazzi

Copy link
Copy Markdown
Contributor

Follow-up to #89. Brings the desktop chrome, peer-sharing, and layout work to main.

Window chrome

  • Frameless themed window controls on Linux/Windows; native menu + decorations are now macOS-only (kills the stray GTK "Canonic/Edit" bar + redundant titlebar).
  • macOS: centered traffic-light inset (via tauri-plugin-decorum) and standard rounded corners (continuous-curve, 13pt) restored for the transparent window.
  • Shorter, more compact titlebar (36px), with --titlebar-height as the single source of truth.

Peer discovery (the migration regression)

  • Root cause fixed: the macOS bundle declared no Bonjour service, so macOS 14+ silently blocked mDNS. Added src-tauri/Info.plist with NSBonjourServices + NSLocalNetworkUsageDescription — verified the keys land in the built .app.
  • Manual connect-by-share-link fallback for when mDNS is blocked (flatpak / AP isolation / different subnet).
  • Hide the user's own share from the peer list; surface a "Discoverable on your local network" indicator (also a permission self-diagnostic).
  • Opt-in mDNS self-discovery test.

Layout

  • Focus mode with floating popover panels.
  • Compact (small-window) layout: docked sidebars + header toggles instead of centered modals.

Housekeeping

  • /simplify cleanups (shared peer-upsert + manifest-fetch helpers, single-pass address parse).

All 311 tests pass; release build is green.

⚠️ Merging cuts a release (version bump + full multi-platform build). Add the no-release label to land without releasing.

🤖 Generated with Claude Code

john and others added 10 commits June 11, 2026 21:55
The native menu was attached on every platform, so Linux/Windows showed a
stray GTK/Win32 "Canonic"/"Edit" menu bar plus native window decorations on
top of the custom Vue titlebar — a redundant strip and an empty gap, with
OS-drawn (un-themed) min/max/close buttons.

- Only build the native menu on macOS (global menu bar); Linux/Windows rely
  on the existing AppMenu hamburger. Matches the existing MENU spec.
- Drop native decorations on Linux/Windows at startup; macOS keeps its
  traffic-light overlay via titleBarStyle.
- Add themed minimize/maximize/close controls to the titlebar (shown when
  not macOS), wired to the Tauri window API with the needed capabilities.
- Spec: new Window Chrome (CHR) scenarios.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Discovery is mDNS-only, so a peer never appears when multicast is blocked —
flatpak sandboxes, AP/client isolation, or a different subnet. Add a way to
connect by pasting the share link.

- peers_connect_manual command: parses a share URL / host:port:token /
  canonic:// deep link, validates it against the peer's /manifest, then
  registers it like a discovered peer (files + comments work unchanged).
- Bridge + store connectPeerManual (demo mode fabricates a peer so the flow
  stays interactive offline).
- Discover tab: share-link input with inline error feedback.
- Spec: new Peer Discovery (PEER) scenarios; store tests for connect/upsert/
  empty/demo.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The native traffic-light buttons sat too high / mispositioned against the
44px custom titlebar (Overlay titleBarStyle). Inset them via tauri-plugin-
decorum.

- macOS-gated dependency (target.'cfg(target_os = "macos")') so Linux/Windows
  builds are untouched.
- Register decorum's plugin and set a one-shot traffic-light inset of
  (12, 16) — 12px left, y≈(44-button)/2 — matching decorum's resize constants
  so placement holds on resize/fullscreen.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The transparent window (needed for the custom titlebar + private backdrop
blur) loses AppKit's automatic corner clipping, so corners rendered square.
Round the content view's layer (13pt) with the continuous "squircle" corner
curve and refresh the window shadow in apply_window_effects, matching the
native window edge so it reads like a standard macOS window.

macOS-only; uses the file's existing objc_msgSend FFI pattern (adds f64 +
object-arg call shapes for CGFloat cornerRadius and the cornerCurve string).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the titlebar from 44px to 36px with tighter horizontal padding and
28px (was 32px) control buttons. Recenter the macOS traffic-light inset to
y=12 for the new height and nudge the editor update-banner offset to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
In compact (small-window) layout the sidebars previously opened as centered
floating modals reachable only via the mobile menu. Instead:

- Dock them: the sidebars flow in the normal flex layout (push the editor),
  just capped narrower (min(240px,42vw) / min(300px,46vw)) so they fit a
  small window. Dropped the floating-modal styles and the modal backdrop.
- Add left + right panel toggle buttons to the compact header so the user can
  show/hide the docked sidebars with one tap; buttons reflect open state.

Spec: compact-layout sidebar-toggle scenario.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- store: extract one upsertDiscoveredPeer(peer), shared by the peers:found
  listener and connectPeerManual (was duplicated, and manual connect scanned
  the list twice).
- commands.rs: extract fetch_peer_manifest(host, port, token); peers_connect_
  manual and peers_fetch_manifest now share the GET + status + parse path.
- commands.rs: parse_peer_address parses the port once (single split) instead
  of three branch-specific parses.
- titlebar height: single source of truth via --titlebar-height CSS var
  (titlebar, mobile-header, menu dropdown, update banner) and a matching
  TITLEBAR_HEIGHT const that derives the macOS traffic-light inset; fixed the
  stale "44px" comments.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Root cause of "can't find peers" after the Electron→Tauri migration: the
macOS bundle declared no Local Network / Bonjour usage. On macOS 14+ the OS
silently blocks advertising/browsing a service unless the app lists it in
NSBonjourServices (and NSLocalNetworkUsageDescription drives the permission
prompt). Electron shipped these; the Tauri bundle had neither.

- Add src-tauri/Info.plist with NSBonjourServices (_canonic._tcp) +
  NSLocalNetworkUsageDescription. Tauri merges it into the bundled app —
  verified the keys land in canonic.app/Contents/Info.plist in a release build.
- Hide the user's own share from the peer list at the source: track announced
  fullnames and skip resolving them in the browser; drop the fake 127.0.0.1
  loopback self-emit.
- Add an opt-in mDNS self-discovery test (announce + browse on this machine
  resolves its own service) to prove the stack without a second computer:
  cargo test --lib discovery::tests::self_discovery -- --ignored
- Spec: own share not listed as a peer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- focusMode auto-toggles on window resize (breakpoint 768px)
- ON: sidebars hidden, panels open as centered floating modals
- OFF: sidebars docked normally (left open by default, right context-driven)
- User manual override persists via localStorage
- Eye toggle in titlebar + compact header
- Sidebar toggle buttons context-aware (floating vs dock)
- Backdrop dismisses floating panels
Surface whether the shared workspace is actually reachable over mDNS, and make
the Discover refresh feel alive.

- When the app resolves its own advertised service (proof advertise+browse work
  on this machine), emit share:discoverable; the store tracks it as
  networkDiscoverable, reset per new share.
- SharePanel shows a banner while sharing: "Discoverable on your local network"
  once verified, otherwise an "advertising… not verified — allow Local Network"
  hint (doubles as a permission/network self-diagnostic).
- PeersPanel refresh keeps the spinner up ~600ms so the near-instant cache read
  no longer flickers and looks like it did nothing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@johnjazzi johnjazzi merged commit 7f081c9 into main Jun 14, 2026
5 checks passed
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