Skip to content

Standard workspace window, persistent threads, and interaction fixes - #11

Merged
sionic-khope merged 8 commits into
mainfrom
feature/standard-workspace-threads
Jul 20, 2026
Merged

Standard workspace window, persistent threads, and interaction fixes#11
sionic-khope merged 8 commits into
mainfrom
feature/standard-workspace-threads

Conversation

@sionic-khope

Copy link
Copy Markdown
Contributor

Summary

  • Fix the mirrored idle hit-test that made clicking Miku fall through to the desktop, plus streaming inefficiencies in the terminal path (flush frame gate, O(visible) snapshot memoization, attributed-text run coalescing, Metal texture reuse)
  • Rebuild the presented workspace as a standard macOS window: native traffic lights over the bubble header, native fullscreen/drag/resize, red button and Cmd-W return to idle; only the background stays transparent
  • Codex-Desktop-style composer (bright elevated card, embedded circular send, working provider/approval menus, vector provider marks) with a context bar showing the thread folder (changeable), Local badge, and git branch
  • Codex-style persistent threads: sessions sidebar with per-thread working directory, lazy shell start, restore across app restarts, rename and delete
  • Agent run lifecycle gating via the PTY foreground process group (startup grace against command-not-found lockouts); multi-line prompts
  • Flat design pass: reduced radii, solid surfaces, unified 1px dividers

Test plan

  • swift build / swift test with -Xswiftc -warnings-as-errors: 183/183 green
  • Runtime-verified on device: hit-test regression tests fail on pre-fix logic, window activation revival, thread persistence round-trip

🤖 Generated with Claude Code

https://claude.ai/code/session_015peMZyaHEmxDzyzNyhYeR5

sionic-khope and others added 8 commits July 20, 2026 11:45
…fficiencies

- Convert hitTest point into flipped view space so idle Miku is clickable
- Gate composer on an explicit agent run lifecycle; detect completion via the
  PTY foreground process group with a startup grace so a never-launching agent
  cannot lock the composer; show RUNNING/SENT on prompt cards
- Accept multi-line prompts; keep rejecting control/escape bytes
- Release composer focus when terminal focus is requested; restore on hide
- Frame-gate PTY output flushes to ~60Hz with a lossless final drain
- Memoize scrollback presentation so per-flush snapshot cost is O(visible)
- Flag output discontinuity when the pending queue drops a chunk
- Coalesce same-style runs and cache fonts/attributes in attributed text
- Reuse Metal CGContext/texture; reallocate only on layout change
- Reset scroll only on page change; propagate cursor backing scale; derive
  cursor cell height from real font metrics
- Gate rim breathing animation on Reduce Motion; remove redundant tap-to-focus

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Content, header, composer, embedded terminal, and right resize handles now
  respect the speech-bubble tail inset so the Send button sits fully inside
  the bubble and stays clickable
- Replace harsh cyan hairlines with tone-shift seams and gradient surfaces;
  elevated composer card with top highlight; teal gradient send button with
  hover/pressed/disabled states; quieter pills; soft top-edge glow rim

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A borderless NSPanel with becomesKeyOnlyIfNeeded never becomes key from
clicks and never activates its app, so once another app was frontmost every
click, focus change, and cursor update in the open workspace was dead.
Presented state now clears becomesKeyOnlyIfNeeded and re-activates the app
on the first click into the workspace; idle keeps the non-activating
overlay behavior. Verified against the live app with synthetic HID clicks:
inactive-state click revives key/active status in the same click.

Also let the provider/approval pills size to content instead of clipping
inside a fixed 182pt column.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Workspace is now a titled, resizable, fullscreen-capable NSWindow with
  native traffic lights over the bubble header; red button and Cmd-W return
  to idle, never quit; transparent outside the bubble and Miku rail
- Guard the Miku close target against stale replayed events that closed the
  workspace immediately after opening; hit area limited to the artwork
- Codex Desktop-style composer: bright elevated card, multi-line prompt,
  provider/approval chips and circular send inside the card; working menus
  replace the deprecated borderless style; vector provider marks (Anthropic
  starburst, OpenAI-style knot)
- Sessions sidebar (threads): per-session terminal + agent transcript via
  WorkspaceSessionStore; create and switch sessions like codex-desktop
- Centered welcome block; removed glow shadows that banded into rings over
  the transparent window

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Threads survive app restarts: metadata index + per-thread terminal
  snapshot under ~/Library/Application Support/MikuCode/sessions/, restored
  at launch with selection; shells start lazily (selected thread only)
- Each thread has its own working directory; the PTY spawns there and the
  path shows abbreviated in the sidebar and thread header
- Centered new-thread pane when no thread is selected: folder chooser
  (NSOpenPanel) plus primary create button; sidebar + reuses the last
  folder or asks first
- Store persists on create/select/transcript change/stop/termination

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Codex Desktop-style context row above the composer: working-folder chip
  (click to change via folder panel; live shell cd when idle), Local badge,
  and git branch read from .git/HEAD (worktrees supported)
- Thread working directory is changeable after creation and persists
- New thread button under the centered welcome copy
- TERMINAL labelled divider when the embedded terminal opens
- Flat design pass: radii 18/14/10 -> 10/8/6, gradient surfaces -> flat
  solids, capsules -> 6pt rounded rectangles, unified 1px white dividers,
  removed breathing rim, inner highlights, and decorative glows

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Context menu on sidebar rows: inline rename (Enter commits, Esc cancels,
  blank reverts to the prompt-derived title) and delete with confirmation
- Deleting stops the shell, removes the thread's persisted terminal
  snapshot, reselects a neighboring thread, and persists; custom titles
  round-trip through index.json (optional field, old indexes still load)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sionic-khope
sionic-khope merged commit 6381d81 into main Jul 20, 2026
1 check 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