Repository navigation
feat: modern editor UI with Tokyo Night theme and enhanced animations - #27
Conversation
- Add Theme struct with all UI colors (Tokyo Night inspired) - Move syntax highlight colors from individual files to theme - Make theme accessible throughout the application - Update syntax module to use theme colors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Add distinct background colors for left (darker) and right sides - Remove vertical separator (background distinction is sufficient) - Add padding to all panes (horizontal: 2, vertical: 1) - Update dialog styling with proper padding - Fix terminal content height to account for padding 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Add OpenFileDialogStart and DialogTypeChar animation steps - Implement file open dialog with typing animation - Add eased cursor movement with ease_in_out_cubic function - Store and apply metadata with ResetState step - Adjust terminal prompt symbol to "~ " - Remove CURSOR_MOVE_END_PAUSE constant 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
go.mod should not be excluded from diff display as it's an important dependency management file that should be tracked. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…ghting - Add distance-based opacity for lines around cursor (fade from 1.0 to 0.6) - Implement cursor line highlighting with theme background color - Add horizontal padding (2 spaces) on left and right - Fill cursor line to full width with background color - Apply opacity blending for non-cursor lines - Update separator styling and line number rendering - Use theme colors throughout instead of hardcoded colors - Add wrap support to Paragraph widget 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
WalkthroughImplements a Theme system and applies it across panes; restructures UI layout to left/right columns; adds dialog typing animation and easing-based cursor movement; extends AnimationEngine with dialog and pending/current commit metadata and applies pending metadata on ResetState; changes terminal prompt to "~ ". Changes
Sequence Diagram(s)sequenceDiagram
participant Engine as AnimationEngine
participant UI as UI
participant Editor as EditorPane
participant Terminal as TerminalPane
participant FileTree as FileTreePane
rect rgb(230,245,255)
Note over Engine: Open File Dialog Flow
UI->>Engine: trigger OpenFileDialogStart(file_path)
Engine->>Engine: set dialog_title, enqueue DialogTypeChar* (per char)
Engine->>UI: expose dialog_title & dialog_typing_text
UI->>UI: render dialog overlay (theme)
end
rect rgb(245,255,235)
Note over Engine: Cursor Movement (eased)
Engine->>Engine: compute eased positions (ease-in-out cubic)
loop per animation frame
Engine->>UI: update cursor position
UI->>Editor: render(theme)
end
end
rect rgb(255,240,240)
Note over Engine: Time-travel Reset
UI->>Engine: load_commit(...)
Engine->>Engine: store pending_metadata, enqueue ResetState
Engine->>Engine: ResetState -> apply pending_metadata, reset buffers, activate terminal
Engine->>FileTree: render(theme, current_metadata)
Engine->>Editor: render(theme)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/ui.rs (1)
254-299: Consider simplifying dialog sizing logic.The manual width/height calculation and padding logic is functional but could be simplified. The current approach correctly handles edge cases with
saturating_sub.Optional refactor to improve maintainability:
// Define constants for dialog sizing const MIN_DIALOG_WIDTH: u16 = 60; const DIALOG_MARGIN: usize = 10; const DIALOG_CHROME: usize = 4; // borders(2) + padding(2) let dialog_width = (text.len() + DIALOG_MARGIN) .max(MIN_DIALOG_WIDTH as usize) .min(size.width.saturating_sub(4) as usize) as u16;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
src/animation.rs(11 hunks)src/git.rs(0 hunks)src/lib.rs(1 hunks)src/main.rs(1 hunks)src/panes/editor.rs(11 hunks)src/panes/file_tree.rs(3 hunks)src/panes/status_bar.rs(1 hunks)src/panes/terminal.rs(2 hunks)src/syntax/mod.rs(2 hunks)src/theme.rs(1 hunks)src/ui.rs(6 hunks)
💤 Files with no reviewable changes (1)
- src/git.rs
🧰 Additional context used
🧬 Code graph analysis (6)
src/ui.rs (1)
src/animation.rs (2)
new(49-63)new(215-245)
src/panes/file_tree.rs (2)
src/syntax/mod.rs (3)
default(211-213)new(87-96)color(29-45)src/ui.rs (1)
new(46-62)
src/panes/status_bar.rs (4)
src/panes/editor.rs (1)
render(30-63)src/panes/file_tree.rs (1)
render(18-47)src/panes/terminal.rs (1)
render(14-78)src/ui.rs (2)
render(172-300)new(46-62)
src/animation.rs (1)
src/ui.rs (1)
new(46-62)
src/panes/editor.rs (5)
src/panes/file_tree.rs (1)
render(18-47)src/panes/status_bar.rs (1)
render(14-72)src/panes/terminal.rs (1)
render(14-78)src/ui.rs (2)
render(172-300)new(46-62)src/syntax/mod.rs (3)
default(211-213)new(87-96)color(29-45)
src/panes/terminal.rs (5)
src/panes/editor.rs (1)
render(30-63)src/panes/file_tree.rs (1)
render(18-47)src/panes/status_bar.rs (1)
render(14-72)src/ui.rs (2)
render(172-300)new(46-62)src/animation.rs (2)
new(49-63)new(215-245)
🔇 Additional comments (28)
src/theme.rs (2)
61-65: LGTM!Clean delegation to
tokyo_night()ensures consistent default theme initialization.
67-127: LGTM!The Tokyo Night color palette is well-structured and comprehensive. All color values are clearly commented and organized by category, providing good coverage for the UI elements and syntax highlighting.
src/main.rs (1)
5-5: LGTM!The theme module declaration is correctly placed and enables theme system integration across the codebase.
src/lib.rs (1)
1-2: LGTM!The public theme module declaration correctly exposes the Theme system for use across the crate and by external consumers.
src/syntax/mod.rs (2)
3-3: LGTM!The Theme import is necessary for the theme-based color method signature.
29-45: LGTM! Theme-based syntax coloring is properly implemented.The method signature change from
fn color(&self) -> Colortofn color(&self, theme: &Theme) -> Coloris a breaking API change, but it's necessary and well-aligned with the PR's objective to introduce a centralized theme system. All token types now correctly delegate to their corresponding theme color fields.src/panes/status_bar.rs (4)
2-9: LGTM!Import changes correctly support the theme-based rendering and updated widget usage (Padding, Wrap, Span).
14-28: LGTM! Clean padding-based layout aligns with modern editor aesthetics.The render signature now accepts a
&Themeparameter, enabling consistent theming. The block style usestheme.background_leftand uniform padding, moving away from border-heavy designs as intended by PR objectives.
30-65: LGTM! Enhanced commit metadata display improves information visibility.The multi-line rendering of commit metadata (hash, author, date, and message) with theme-based styling is a significant UX improvement. Filtering empty message lines (lines 50-57) keeps the display clean. The "No commit loaded" fallback is also properly themed.
67-72: LGTM!The paragraph rendering with
Wrap { trim: false }is consistent with other panes and ensures proper text wrapping behavior.src/ui.rs (2)
23-23: LGTM! Clean theme integration.The Theme system is properly integrated into the UI struct with sensible defaults.
Also applies to: 42-42, 60-60
175-208: LGTM! Clean layout restructuring.The two-column layout with proper separators aligns well with the modern editor UI objectives.
src/panes/terminal.rs (2)
2-2: LGTM! Theme integration matches pattern across panes.The render signature is now consistent with other panes (editor, file_tree, status_bar).
Also applies to: 14-14
39-67: LGTM! Terminal rendering properly themed.The command line detection ("~ ") is consistent with the prompt generation in animation.rs, and theme colors are correctly applied to commands, cursor, and output.
src/panes/file_tree.rs (3)
2-2: LGTM! Consistent theme integration.Theme styling and padding are applied consistently across all panes.
Also applies to: 24-24, 27-33
59-65: LGTM! Clear status-to-color mapping.The file status colors are properly themed and semantically meaningful.
133-173: LGTM! Excellent current-file highlighting.The background fill calculation properly extends the highlight to the right edge, creating a clean visual indicator for the current file.
src/animation.rs (6)
148-160: LGTM! Clear animation step semantics.The new variants cleanly model the file-open dialog and state reset behaviors.
204-212: LGTM! Well-designed state separation.The pending/current metadata pattern cleanly handles the time-travel animation sequence without race conditions.
251-254: LGTM! Clean accessor.The accessor provides safe read-only access to current metadata.
277-321: LGTM! Proper metadata lifecycle.The pending metadata is correctly stored before time-travel animation and applied via ResetState, ensuring proper sequencing.
502-567: LGTM! Smooth easing-based cursor movement.The cubic easing function with duplicate-position filtering creates smooth cursor animation with proper acceleration/deceleration. The distance-based speed multipliers are well-calibrated.
842-852: LGTM! Clean state reset.ResetState correctly applies pending metadata and resets UI state while preserving terminal history.
src/panes/editor.rs (5)
16-16: LGTM! Context properly extended for theme-aware rendering.The added fields enable distance-based opacity and cursor line styling.
Also applies to: 25-26
77-85: LGTM! Excellent distance-based opacity.The opacity gradient (1.0 → 0.6 over 20 lines) creates a nice focus effect around the cursor line without being too aggressive.
362-373: LGTM! Correct alpha blending implementation.The linear interpolation formula properly blends foreground and background colors based on opacity.
145-166: LGTM! Proper cursor line highlighting.The background fill calculation correctly accounts for all line components and extends the highlight to the right edge.
301-331: LGTM! Well-structured color application.The three-tier styling (cursor character, cursor line, normal) is properly implemented with correct opacity blending.
Editor area is 70% (right column) × 80% (editor pane) = 56% of total height, not 80% × 80% = 64%. This fixes scroll calculations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/ui.rs(6 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/ui.rs (1)
src/animation.rs (2)
new(49-63)new(215-245)
🔇 Additional comments (5)
src/ui.rs (5)
9-12: LGTM! New imports support dialog rendering and theme integration.The added imports (Rect, Style, Line, Span, and Theme) are all used appropriately in the new dialog rendering logic and theme-based styling.
Also applies to: 23-23
42-42: LGTM! Theme centralization aligns with PR objectives.The Theme field is properly initialized and will be passed to all render calls, enabling consistent color management across the UI.
Also applies to: 60-60
108-112: Past issue resolved: viewport height now correctly matches layout.The viewport height calculation has been fixed to use 0.70 × 0.80 = 56%, which correctly matches the actual editor area (70% right column × 80% editor within that column). This addresses the critical issue raised in the previous review.
175-208: LGTM! Layout restructure achieves modern editor-like appearance.The horizontal split with nested vertical layouts creates a professional, modern editor-style UI as per the PR objectives. The layout percentages are consistent and properly calculated.
210-253: LGTM! Consistent theme integration across all panes.The separator rendering and updated render calls properly integrate the theme system. All panes receive theme and metadata where appropriate, ensuring visual consistency.
close: #18
Summary
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Style