feat: tab description editing in overlay menu
Summary
- Adds
descriptionfield toAITabtype - Implements
handleUpdateTabDescriptionhandler inuseTabHandlers - Adds description display/edit UI in tab hover overlay
- Saves draft on overlay close, returns focus to description button after save/cancel
- Gated behind
encoreFeatures.tabDescriptionflag - Full test coverage for handler and UI
Test plan
- [ ]
npm run lintpasses (zero errors) - [ ]
npm run lint:eslintpasses (zero warnings) - [ ]
npm run testpasses (21,026 tests pass; 3 pre-existing CodexSessionStorage timeout flakes) - [ ] Description section visible in overlay when feature enabled
- [ ] Edit mode: Enter saves, Escape cancels, blur saves
- [ ] Draft saved when overlay closes during edit
- [ ] No description UI when feature disabled
🤖 Generated with Claude Code
Summary by CodeRabbit
-
New Features
- Tab descriptions are now editable. Users can add or edit descriptions for tabs, saving changes with Enter and canceling with Escape. Descriptions are automatically trimmed of whitespace.
-
Tests
- Added comprehensive test coverage for tab description editing features, including state management, input validation, and keyboard event handling.
@coderabbitai review
Review triggered. Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.✅ Actions performed
This PR introduces a feature for editing and persisting per-tab descriptions. It adds type definitions for the description field on tabs, a feature flag to control availability, a new handler to update descriptions, UI components for inline editing with keyboard controls, prop threading through the component hierarchy, and comprehensive test coverage. 🎯 3 (Moderate) | ⏱️ ~20 minutes ✏️ Tip: You can configure your own custom pre-merge checks in the settings.📝 Walkthrough
Walkthrough
Changes
Cohort / File(s)
Summary
Type Definitions & Feature Flags
src/renderer/types/index.ts, src/renderer/stores/settingsStore.tsAdds optional
description field to AITab type and introduces tabDescription boolean flag to EncoreFeatureFlags with default value false.
Hook Logic
src/renderer/hooks/tabs/useTabHandlers.ts, src/renderer/hooks/props/useMainPanelProps.tsAdds
handleUpdateTabDescription handler that trims and updates description on active session's tab; threads handler through props dependencies and memoization.
Component Layer
src/renderer/components/MainPanel.tsx, src/renderer/components/TabBar.tsxAdds
onUpdateTabDescription callback prop to MainPanel and TabBar; implements description editing UI with textarea, draft state management, Enter/Escape keyboard controls, and focus restoration logic in TabBar.
App Wiring
src/renderer/App.tsxWires
handleUpdateTabDescription from modal actions hook and threads it to MaestroConsoleInner; conditionally provides handler based on encoreFeatures.tabDescription flag.
Tests
src/__tests__/renderer/components/TabBar.test.tsx, src/__tests__/renderer/hooks/useTabHandlers.test.tsAdds comprehensive test suites for description UI rendering, edit mode interactions, keyboard handling, trimming behavior, and session/tab isolation scoping.
Sequence Diagram
sequenceDiagram
actor User
participant TabBar as TabBar<br/>(Component)
participant useTabHandlers as useTabHandlers<br/>(Hook)
participant AITab as AITab<br/>(State)
User->>TabBar: Click description area
activate TabBar
TabBar->>TabBar: Enter edit mode<br/>(isEditingDescription=true)
TabBar->>TabBar: Show textarea with<br/>current description
deactivate TabBar
User->>TabBar: Type description + Enter
activate TabBar
TabBar->>TabBar: Trim description
TabBar->>useTabHandlers: onUpdateTabDescription(tabId,<br/>trimmedDescription)
deactivate TabBar
activate useTabHandlers
useTabHandlers->>AITab: Update description on<br/>active session's tab
deactivate useTabHandlers
activate TabBar
TabBar->>TabBar: Sync draft with<br/>new tab.description
TabBar->>TabBar: Exit edit mode
deactivate TabBar
TabBar-->>User: Display updated description
Estimated code review effort
Possibly related PRs
useTabHandlers hook; potential overlap or interaction point with the new handleUpdateTabDescription logic added in this PR.🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
⚠️ Warning
Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%.
Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name
Status
Explanation
Description Check
✅ Passed
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
✅ Passed
The title 'feat: tab description editing in overlay menu' clearly and specifically describes the main feature addition—enabling users to edit tab descriptions directly in the tab overlay/hover menu.
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment @coderabbitai help to get the list of available commands and usage tips.
Greptile Summary
This PR adds user-editable descriptions to AI tabs, accessible through the tab hover overlay menu. The implementation is clean and well-tested:
Implementation highlights:
- Description field added to
AITabtype and handler implemented inuseTabHandlers - UI in tab overlay supports edit/display modes with keyboard shortcuts (Enter saves, Escape cancels, Shift+Enter adds newline)
- Draft auto-saves on blur or overlay close during editing
- Focus returns to description button after save/cancel for good keyboard UX
- Feature gated behind
encoreFeatures.tabDescriptionflag (default: false)
Code quality:
- Proper state management using refs to avoid stale closures in cleanup effects
- Handler trims whitespace and uses
undefinedfor empty values (good data hygiene) - Only operates on active session, preventing cross-session modifications
- Full test coverage for both handler logic (trimming, session isolation) and UI behavior (keyboard events, focus management, feature gating)
Confidence Score: 5/5
- This PR is safe to merge with minimal risk - clean implementation, comprehensive tests, and proper feature gating
- Score reflects well-structured code following React best practices, comprehensive test coverage (21,026 tests passing), proper keyboard accessibility, feature flag gating to control rollout, and no breaking changes to existing functionality
- No files require special attention - all changes are straightforward and well-tested
Important Files Changed
| Filename | Overview |
|---|---|
| src/renderer/types/index.ts | Added description field to AITab and tabDescription flag to EncoreFeatureFlags - straightforward type additions |
| src/renderer/hooks/tabs/useTabHandlers.ts | Added handleUpdateTabDescription handler with proper trimming, undefined for empty strings, and session isolation |
| src/renderer/components/TabBar.tsx | Implemented description UI with edit/display modes, keyboard handling (Enter/Escape), blur save, and draft persistence on overlay close |
| src/tests/renderer/hooks/useTabHandlers.test.ts | Added comprehensive tests covering trimming, empty strings, session isolation, and multi-tab scenarios |
| src/tests/renderer/components/TabBar.test.tsx | Added UI tests for description display, edit mode, keyboard handlers, and feature flag gating |
Last reviewed commit: 21bcf98
This change introduces a tab description editing feature throughout the application. It adds an 🎯 3 (Moderate) | ⏱️ ~20 minutes ✏️ Tip: You can configure your own custom pre-merge checks in the settings.📝 Walkthrough
Walkthrough
onUpdateTabDescription callback that propagates from the root through the component hierarchy to TabBar, implements description editing UI with keyboard shortcuts, adds a corresponding handler in the tab management hook, introduces a feature flag to control availability, and includes comprehensive test coverage.Changes
Cohort / File(s)
Summary
Test Coverage
src/__tests__/renderer/components/TabBar.test.tsx, src/__tests__/renderer/hooks/useTabHandlers.test.tsNew test suites for description editing in TabBar (including overlay rendering, edit mode entry/exit, trimming, and submission) and comprehensive unit tests for the handleUpdateTabDescription handler covering trimmed values, empty strings, session scoping, and multi-tab behavior.
Feature Implementation
src/renderer/hooks/tabs/useTabHandlers.ts, src/renderer/stores/settingsStore.ts, src/renderer/types/index.tsImplementation of handleUpdateTabDescription handler that trims and updates tab descriptions, new tabDescription feature flag (default: false), and type additions (description field on AITab, tabDescription boolean in EncoreFeatureFlags).
Component Hierarchy Wiring
src/renderer/App.tsx, src/renderer/hooks/props/useMainPanelProps.ts, src/renderer/components/MainPanel.tsx, src/renderer/components/TabBar.tsxPropagation of handleUpdateTabDescription from App through useMainPanelProps and MainPanel to TabBar; TabBar implements description UI with edit mode (isEditingDescription, descriptionDraft), keyboard handlers (Enter to save, Escape to cancel), and conditional rendering behind the feature flag.
Estimated code review effort
Possibly related PRs
#418: Modifies useTabHandlers.ts to refactor tab construction with buildUnifiedTabs/ensureInUnifiedTabOrder, overlapping with the hook changes in this PR.#452: Refactors App.tsx, useMainPanelProps, and MainPanel prop surfaces, creating potential conflicts with the prop threading changes introduced here.🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
⚠️ Warning
Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%.
Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name
Status
Explanation
Description Check
✅ Passed
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
✅ Passed
The title clearly and concisely describes the main change: adding tab description editing functionality to the overlay menu, which aligns with the substantial changes across TabBar, handlers, and UI components.
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment @coderabbitai help to get the list of available commands and usage tips.
@felipeggv please run the following on your machine for this PR so it can move toward acceptance.
Here is the prompt you should run:
You are responsible for getting this PR in RunMaestro/Maestro to an accept-ready state.
PR: https://github.com/RunMaestro/Maestro/pull/472
Branch/Head: inspect the PR branch locally before making changes.
Goal:
Drive this PR to zero unresolved CodeRabbit and Greptile review threads.
Process:
1. Fetch the PR locally and work from a clean git worktree on the PR branch.
2. List all unresolved CodeRabbit and Greptile review threads for this PR.
3. For each unresolved bot thread:
- verify whether the issue is still real on the current PR head
- if it is already fixed or the thread is outdated, resolve the GitHub review thread immediately
- if it is real, implement the smallest correct fix on the PR branch
4. After each fix batch:
- run the relevant validation commands locally
- push the branch
- re-poll the PR’s unresolved CodeRabbit/Greptile threads
- resolve any newly stale/fixed bot threads
5. Repeat until this PR has zero unresolved CodeRabbit and Greptile threads.
Rules:
- Resolve bot threads only when the current branch state actually fixes them.
- Do not resolve human review threads unless explicitly asked.
- Be surgical. Do not broaden scope beyond the review findings.
- If local validation differs from CI because of environment issues, state the exact failing test/check and the exact missing dependency/file/path.
- If a bot comment is a design tradeoff rather than a bug, explain why and leave it unresolved only if it truly still applies.
Definition of done:
- zero unresolved CodeRabbit threads
- zero unresolved Greptile threads
- branch pushed
- latest validation/check status re-polled
- concise summary written with:
- PR URL
- commits pushed
- threads resolved
- any remaining blockers
Keep looping until the PR is clean.
Thanks for this contribution, @felipeggv! Nice feature — clean implementation, good test coverage, and proper feature-flag gating.
One change I'd like addressed before approval:
🟠 Guard Enter/Escape during IME composition (src/renderer/components/TabBar.tsx around L490-500)
The handleDescriptionKeyDown handler currently processes save/cancel even while a user is mid-composition with an IME (Japanese, Chinese, Korean, etc.), which prematurely commits or cancels their input. CodeRabbit flagged this as unresolved and it's a real UX bug for international users.
Suggested fix:
const handleDescriptionKeyDown = useCallback(
(e: React.KeyboardEvent<HTMLTextAreaElement>) => {
+ const native = e.nativeEvent as KeyboardEvent;
+ if (native.isComposing || native.keyCode === 229) return;
+
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
handleDescriptionSave(descriptionDraft);
} else if (e.key === 'Escape') {
e.preventDefault();
handleDescriptionCancel();
}
},
[descriptionDraft, handleDescriptionSave, handleDescriptionCancel]
);
Optional nitpicks (feel free to apply or skip):
- The inline callback ref
ref={(el) => el?.focus()}on the textarea (~L763) is recreated each render. A stableuseRef+useEffectkeyed onisEditingDescriptionavoids repeated refocus. - In
handleUpdateTabDescription(useTabHandlers.ts~L973), short-circuit whentrimmedmatches the existing description to skip avoidable re-renders.
Once the IME guard lands, happy to approve. Thanks again!
Thanks for the contribution, @felipeggv! Really nice feature — well-scoped, gated behind the encoreFeatures.tabDescription flag, and the test coverage is solid. Greptile gave this a 5/5 confidence score.
Before approving, there's one item from CodeRabbit's review I'd like to see addressed:
IME composition handling (TabBar.tsx, handleDescriptionKeyDown ~L490-500) — Enter/Escape will prematurely commit or cancel input while a user is composing text via an IME (e.g. Chinese/Japanese/Korean input). Quick guard at the top of the handler:
const native = e.nativeEvent as KeyboardEvent;
if (native.isComposing || native.keyCode === 229) return;
The other CodeRabbit items are nitpicks and optional — feel free to take them or leave them:
- Inline callback ref
ref={(el) => el?.focus()}at L763-765 — recreated each render; a stable ref +useEffectkeyed onisEditingDescriptionis cleaner. handleUpdateTabDescriptioninuseTabHandlers.tscould short-circuit whendescriptionis unchanged to avoid recreating the session object.- Tests could add coverage for Shift+Enter (newline insertion) and draft-saved-on-overlay-close.
Once the IME guard is in, I'll happily approve. Thanks again!