fix(desktop): ターミナルサジェストのはみ出し防止とAgent操作中の非表示化#31
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 2 minutes and 46 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe pull request fixes two terminal suggestion feature bugs: preventing the dropdown from overflowing past the viewport by implementing dynamic above/below positioning logic, and disabling suggestions during workspaceRun Agent operations. README documentation is updated accordingly. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
e6a89d6 to
a3c4f58
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/TerminalSuggestion/TerminalSuggestion.tsx`:
- Around line 68-84: The dropdown height is currently computed from fixed
PREVIEW_HEIGHT/FOOTER_HEIGHT and ITEM_HEIGHT which can overflow; instead measure
the actual preview DOM height (use the preview element's
offsetHeight/scrollHeight) and compute a measuredPreviewHeight, then recompute
dropdownHeight = measuredPreviewHeight + FOOTER_HEIGHT +
Math.min(suggestions.length, MAX_VISIBLE_ITEMSAdjusted) * ITEM_HEIGHT where
MAX_VISIBLE_ITEMSAdjusted is clamped to available space (based on
terminalHeight, TERMINAL_PADDING, cursorY and dims.height) so the list height is
reduced to fit; finally use this clamped dropdownHeight when computing
spaceBelow and dropdownTop so the menu never extends out of bounds.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 446f074d-f6c9-4d75-9d42-9db7769275f6
📒 Files selected for processing (3)
README.mdapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/TerminalSuggestion/TerminalSuggestion.tsx
- useTerminalSuggestion: isAlternateScreenRefをrefとして直接受け取りポーリング内でチェック - useTerminalLifecycle: alternate screen中はcommandBufferへのキー入力・ペースト蓄積を防止 - TerminalSuggestion: xterm.buffer.active.type === "alternate" で描画を最終ブロック - shell-history: zshのmetafiedエンコーディングをデコードして日本語文字化けを解消
Summary
xterm.buffer.active.type === "alternate"で最終ブロックTest plan
Closes #29, Closes #30