-
Notifications
You must be signed in to change notification settings - Fork 911
fix: Top bar labels in editor #1212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe Header.tsx component introduces a shared Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/desktop/src/routes/editor/Header.tsx (1)
82-89
: Clean refactor that eliminates duplication.The consistent use of
clearTimelineSelection
across all button handlers successfully consolidates the repeated selection-clearing logic. The varying patterns for handling the return value (checking vs. ignoring) appropriately reflect each button's intended behavior:
- Delete, Open bundle, Export: Clear selection, then perform primary action
- Undo, Redo: Clear selection, then conditionally perform primary action
This improves maintainability while preserving the original behavior.
Consider adding a brief JSDoc comment to
clearTimelineSelection
explaining its return value semantics for future maintainers:+/** + * Clears the timeline selection if present. + * @returns true if a selection was cleared, false if there was no selection. + */ const clearTimelineSelection = () => { if (!editorState.timeline.selection) return false; setEditorState("timeline", "selection", null); return true; };Also applies to: 94-99, 141-146, 153-158, 172-179
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/desktop/src/routes/editor/Header.tsx
(5 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}
: Use a 2-space indent for TypeScript code.
Use Biome for formatting and linting TypeScript/JavaScript files by runningpnpm format
.Use strict TypeScript and avoid any; leverage shared types
Files:
apps/desktop/src/routes/editor/Header.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}
: Use kebab-case for filenames for TypeScript/JavaScript modules (e.g.,user-menu.tsx
).
Use PascalCase for React/Solid components.
Files:
apps/desktop/src/routes/editor/Header.tsx
apps/desktop/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
apps/desktop/src/**/*.{ts,tsx}
: Desktop icons are auto-imported (unplugin-icons); do not import icons manually
Desktop IPC: Call generated tauri_specta commands/events; listen to generated events and use typed interfaces
Use @tanstack/solid-query for server state in the desktop app
Files:
apps/desktop/src/routes/editor/Header.tsx
🧬 Code graph analysis (1)
apps/desktop/src/routes/editor/Header.tsx (2)
apps/desktop/src/utils/tauri.ts (1)
commands
(7-284)apps/desktop/src/routes/editor/ui.tsx (1)
EditorButton
(353-418)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Build Desktop (aarch64-apple-darwin, macos-latest)
- GitHub Check: Build Desktop (x86_64-pc-windows-msvc, windows-latest)
- GitHub Check: Analyze (rust)
🔇 Additional comments (3)
apps/desktop/src/routes/editor/Header.tsx (3)
65-69
: Well-designed helper function.The
clearTimelineSelection
helper effectively centralizes the repeated selection-clearing logic. The boolean return value allows handlers to conditionally proceed based on whether a selection was present, which is leveraged appropriately in different button contexts.
109-124
: Verify the intended behavior for Captions and Performance buttons.These buttons exhibit a specific pattern where they're only enabled when a timeline selection exists, and clicking them only clears the selection without performing additional actions. This appears intentional as placeholder behavior while these features are under development (marked with
comingSoon
when no selection exists).Can you confirm this is the desired user experience?
90-90
: Tooltip simplification improves clarity.The change from dynamic to static tooltip text makes the UI more consistent and easier to understand. While users won't see different tooltips when a selection is active, the simplified labels clearly communicate each button's primary purpose, which aligns with the PR's goal to fix top bar labels.
Also applies to: 100-100, 113-113, 121-121, 150-150, 162-162
Introduces a clearTimelineSelection helper to streamline clearing timeline selection across multiple EditorButton actions. Simplifies button click handlers and tooltip logic by removing repeated selection checks
Fixes #1212
Summary by CodeRabbit