feat: scroll-lock, session restore, and visual pane differentiation#29
Merged
Merged
Conversation
Track user scroll state in FlockTerminalView and set terminal.userScrolling to prevent auto-scroll-to-bottom and selection clearing while the user is reading history or has text selected. - Override scrollWheel to detect when user scrolls away from bottom - Set userScrolling flag before data feed to preserve scroll position - Protect active selections from being cleared by incoming output - Release scroll lock when user sends input (typing returns to bottom) Depends on k3rnelpan11c/SwiftTerm@flock-scroll-lock (PR migueldeicaza/SwiftTerm#530) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ty improvements Session restore: - Capture exact Claude session ID per pane via ~/.claude/sessions/<PID>.json - Get working directory from proc_pidinfo (works even when Claude is active) - Resume with exact session ID: claude --resume <uuid> - Auto-accept workspace trust prompt on restore - Skip permission prompts with --dangerously-skip-permissions Visual differentiation: - Blue border (1.5px) for Claude panes, default border for shell panes - Red border (2px) when Claude is actively outputting - Returns to blue ~1.2s after output stops - Keyboard echo suppressed from activity detection (0.3s window) Scroll/layout fixes: - Prevent scroll position reset when switching tabs (guard frame assignment) - Improved scroll-lock and selection preservation from prior commit Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… and UX fixes Cost tracking: - Per-session cost display in pane title bar (cost + tokens) - Reads session JSONL incrementally for token/cost data - CostStatsView overlay panel (Cmd+Shift+U) with session + daily stats + rate limits - Auto-updates when Claude goes idle Visual improvements: - Blue border for Claude panes, red when actively outputting - Keyboard echo suppression (no false red border when typing) - Dynamic cost label sizing UX fixes: - Prevent scroll reset when switching tabs (frame guard) - Activity idle timeout reduced to 1.2s for faster feedback Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
|
Super sick! Thanks for contributing |
Author
|
No worries at all, glad it landed well! I use Flock heavily as part of my day-to-day dev flow — I'm CTO at my company with ~100K DAU, so Claude Code is pretty central to how I work. Your tools fit right into that. If you ever want to sync in private — I've made a few more changes since this PR but I'm not sure they're polished enough to open a PR right away. Would be worth reviewing together how useful they actually are at scale and maybe running some proper tests before merging anything. Let me know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three major improvements to the Flock terminal experience:
1. Scroll-lock & selection preservation
2. Session restore (complete rewrite)
~/.claude/sessions/<PID>.jsonat shutdownproc_pidinfo(works even when Claude is the active process)claude --resume <session-uuid>--dangerously-skip-permissionson all launches3. Visual pane differentiation
Technical details
Files changed:
FlockTerminalView.swift— scroll-lock tracking, keyboard echo timestampTerminalPane.swift— session ID capture via libproc, CWD detection, trust auto-accept, frame guardPaneManager.swift— session capture at shutdown, CWD fallback chain (OSC 7 → proc_pidinfo → contextDirectory)FlockPane.swift— blue/red border logic,isAgentActivedidSet, focus animation guardsClaudeOutputParser.swift— trust prompt detection with text bufferingSessionRestore.swift— cleanup of unused methodDepends on: migueldeicaza/SwiftTerm#530 (exposes
Terminal.userScrollingflag)Test plan
🤖 Generated with Claude Code