Skip to content

feat(panel): add side-edge dock mode with resizable vertical drawer - #428

Open
yiyi019 wants to merge 1 commit into
wxtsky:mainfrom
yiyi019:feat/side-edge-dock-mode
Open

yiyi019 wants to merge 1 commit into
wxtsky:mainfrom
yiyi019:feat/side-edge-dock-mode

Conversation

@yiyi019

@yiyi019 yiyi019 commented Dec 3, 2026

Copy link
Copy Markdown

Motivation

On non-notched Macs (such as the M1 MacBook Air) and external displays, the top menu bar has no physical notch cutout, so top-centered island pills/bars can occupy limited menu bar space or overlap third-party menu bar items and menus.

This adds an optional Side-Edge Dock Mode (Left Edge / Right Edge) alongside the existing Top (Notch) mode. The default remains Top (Notch) so existing users experience zero behavioral change unless they opt in.

Summary of Changes

  1. Pure geometry & layout helper (Sources/CodeIsland/SideDockLayout.swift):
    • Flush left/right screen-edge panel placement bounded vertically between the menu bar and Dock (verticalEdgeMargin = 12pt).
    • 38pt compact collapsed side pill, expanded drawer sizing (240–560pt width, default 300pt; 180–860pt height, default 420pt), drag-to-reposition math, and inward/bottom resize clamping.
  2. Window & pointer behavior (Sources/CodeIsland/PanelWindowController.swift):
    • Hosts the transparent side NSPanel flush on the active edge spanning usable vertical height so the drawer can grow/shrink smoothly without window-edge clipping or drifting off the screen edge.
    • Supports dragging the collapsed side pill vertically (sideVerticalPosition) and constrains auto-collapse checks in side mode to pointerOverIsland.
  3. Side pill & narrow vertical-first drawer UI (Sources/CodeIsland/NotchPanelView.swift):
    • Added SidePanelShape, SideCollapsedPill, SideIdlePill, SidePanelResizeHandles (inner edge, bottom edge, and bottom corner with live width × height HUD), and \.isSideDocked / \.sideDrawerHeight environments.
    • Added vertical-first card header/line wrapping in SessionCard (two-row header, multi-line reply preview, wrapped approval actions) and passed effectiveMaxVisible cleanly to SessionListMetrics in SessionListView.
    • Default dockEdge fallback remains .top.
  4. Settings & 7-language localization (Sources/CodeIsland/Settings.swift, Sources/CodeIsland/SettingsView.swift, Sources/CodeIsland/L10n.swift):
    • Added DockEdge (top default, right, left), dockEdge, sideVerticalPosition, sidePanelWidth, sidePanelHeight.
    • Added Dock Position picker and width / height / vertical position sliders + Reset button in General settings (hiding notch-only horizontal drag toggles when docked to a side edge).
    • Added translations across all 7 languages (en, zh, zh-Hant, de, ja, ko, tr).
  5. Tests (Tests/CodeIslandTests/SideDockLayoutTests.swift):
    • Added unit tests for left/right flush alignment, menu-bar/Dock vertical bounds, hover-cover invariant on expansion, vertical drag clamping, and width/height resize clamping.

Verification

  • Environment note: this machine only has Apple Command Line Tools installed (no Xcode / XCTest), so the full swift test suite could not be executed locally. Please run swift test in Xcode on CI / maintainer machine.
  • Verified locally with swift build -c release --build-system native --sdk /Library/Developer/CommandLineTools/SDKs/MacOSX26.5.sdk.
  • Executed standalone swiftc checks covering SideDockLayout geometry/clamping invariants and L10n key parity across all 7 languages (en, zh, zh-Hant, de, ja, ko, tr).
  • Live tested on macOS (non-notched M1 MacBook Air, 1280×800 logical resolution) across collapsed right/left pills, vertical drag, expanded drawer rendering, and interactive width/height resizing.

Copilot AI balanced review requested due to automatic review settings December 3, 2026 16:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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