Skip to content

feat: implement Terminal views#109

Open
2witstudios wants to merge 3 commits intomainfrom
ppg/issue-84-terminal-views
Open

feat: implement Terminal views#109
2witstudios wants to merge 3 commits intomainfrom
ppg/issue-84-terminal-views

Conversation

@2witstudios
Copy link
Owner

Summary

  • TerminalView.swift — subscribes to WebSocket terminal:output events for a specific agent, fetches initial logs via REST (GET /api/agents/:id/logs), auto-scrolls on new output, monospace green-on-black rendering, kill button in toolbar with confirmation dialog
  • TerminalInputBar.swift — monospaced text input field + send button, sends input via WebSocket terminal:input command, submits on return key
  • Chains onto existing wsManager.onMessage handler to avoid overwriting AppState's manifest/status handling

Dependencies

Test plan

  • Navigate from WorktreeDetailView agent row to TerminalView
  • Verify initial logs load via REST on appear
  • Verify live WebSocket output appends in real-time
  • Verify auto-scroll to bottom on new output
  • Send input via text field and confirm it reaches the agent pane
  • Kill agent via toolbar button and confirm status updates
  • Verify unsubscribe fires on back navigation

Closes #84

- TerminalView subscribes to WebSocket terminal events for a specific agent
- Initial log fetch via REST (GET /api/agents/:id/logs, last 200 lines)
- Auto-scroll to bottom on new output via ScrollViewReader
- Monospace font with black background / green text
- Kill button in toolbar with confirmation dialog
- TerminalInputBar with monospaced text field + send button
- Sends input via WebSocket terminal:input command
- Chains onto existing onMessage handler to avoid overwriting AppState's handler

Closes #84
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link

coderabbitai bot commented Feb 27, 2026

Warning

Rate limit exceeded

@2witstudios has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 37 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 34deb69 and 72b1224.

📒 Files selected for processing (2)
  • ios/PPGMobile/PPGMobile/Views/Terminal/TerminalInputBar.swift
  • ios/PPGMobile/PPGMobile/Views/Terminal/TerminalView.swift
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ppg/issue-84-terminal-views

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- Extract TerminalViewModel (@observable @mainactor class) to eliminate
  @State closure that won't compile (#1)
- Use [weak self] captures and @mainactor dispatch for thread safety (#6)
- Fix auto-scroll: add invisible bottom anchor below text content so
  ScrollViewReader scrolls to actual bottom, not text top (#4)
- Add .defaultScrollAnchor(.bottom) for initial scroll position
- Cap output buffer at 50K chars with newline-boundary trimming (#5)
- Bump font from .caption to .footnote for terminal readability (#8)
- Add contextual status messages: not connected / loading / waiting (#9)
- Enable .textSelection on terminal output
- Reorder TerminalInputBar modifiers to place text-input-specific
  modifiers before .textFieldStyle (#3)
- Use .task for async subscribe, .onDisappear for sync cleanup
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.

Implement Terminal views

1 participant