-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 日本語ローカライズとCI/セキュリティ改善 #3
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
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.
Pull Request Overview
This PR integrates comprehensive CI/security improvements and Japanese localization to the main branch. The changes modernize the codebase with safer error handling, stable dependency management, and provide a Japanese-localized user experience.
Key changes:
- Japanese localization of UI elements, help text, and status messages
- CI stability improvements with strict dependency versioning and enhanced security auditing
- Enhanced error handling by removing unsafe
unwrapcalls
Reviewed Changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| deny.toml | Adds cargo-deny configuration for CI security auditing |
| crates/scriptoris/src/ui.rs | Major UI overhaul with Japanese localization and improved theming |
| crates/scriptoris/src/session_manager.rs | Japanese error messages and enhanced testing with environment isolation |
| crates/scriptoris/src/main.rs | Improved logger initialization for development debugging |
| Various Cargo.toml files | Strict dependency version pinning for CI stability |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| WindowSplitKind::None | WindowSplitKind::Horizontal | WindowSplitKind::Vertical | ||
| if panes.len() <= 1 => | ||
| { | ||
| if let Some(pane) = panes.first() { | ||
| draw_single_pane(f, app, area, pane, true); | ||
| } | ||
| } | ||
| WindowSplitKind::Horizontal => { | ||
| let chunk_constraints = if panes.len() > 1 { | ||
| let share = (100 / panes.len().max(1)) as u16; | ||
| vec![Constraint::Percentage(share); panes.len()] | ||
| } else { | ||
| vec![Constraint::Percentage(100)] | ||
| }; | ||
|
|
||
| let chunks = Layout::default() | ||
| .direction(Direction::Vertical) | ||
| .constraints(chunk_constraints) | ||
| .split(area); | ||
|
|
||
| for (idx, pane) in panes.iter().enumerate() { | ||
| let is_current = pane.id == app.window_manager.current_window_id; | ||
| let target_area = chunks.get(idx).copied().unwrap_or_else(|| chunks[0]); | ||
| draw_single_pane(f, app, target_area, pane, is_current); | ||
| } | ||
| } | ||
| WindowSplitKind::Vertical => { | ||
| let chunk_constraints = if panes.len() > 1 { | ||
| let share = (100 / panes.len().max(1)) as u16; | ||
| vec![Constraint::Percentage(share); panes.len()] | ||
| } else { | ||
| vec![Constraint::Percentage(100)] | ||
| }; | ||
|
|
||
| let chunks = Layout::default() | ||
| .direction(Direction::Horizontal) | ||
| .constraints(chunk_constraints) | ||
| .split(area); | ||
|
|
||
| for (idx, pane) in panes.iter().enumerate() { | ||
| let is_current = pane.id == app.window_manager.current_window_id; | ||
| let target_area = chunks.get(idx).copied().unwrap_or_else(|| chunks[0]); | ||
| draw_single_pane(f, app, target_area, pane, is_current); | ||
| } | ||
| } | ||
| WindowSplitKind::None => { | ||
| if let Some(pane) = panes.first() { | ||
| let is_current = pane.id == app.window_manager.current_window_id; | ||
| draw_single_pane(f, app, area, pane, is_current); | ||
| } | ||
| } |
Copilot
AI
Sep 21, 2025
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.
This pattern combines multiple enum variants with an additional condition, making it harder to understand. Consider separating the None case from the split cases for better clarity.
|
|
||
| for (idx, pane) in panes.iter().enumerate() { | ||
| let is_current = pane.id == app.window_manager.current_window_id; | ||
| let target_area = chunks.get(idx).copied().unwrap_or_else(|| chunks[0]); |
Copilot
AI
Sep 21, 2025
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.
This could panic if chunks is empty. The fallback chunks[0] will panic when there are no chunks. Consider using a safer approach like returning early if chunks is empty or providing a default Rect.
|
|
||
| for (idx, pane) in panes.iter().enumerate() { | ||
| let is_current = pane.id == app.window_manager.current_window_id; | ||
| let target_area = chunks.get(idx).copied().unwrap_or_else(|| chunks[0]); |
Copilot
AI
Sep 21, 2025
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.
Same issue as above - potential panic if chunks is empty. The fallback chunks[0] will panic when there are no chunks.
|
|
||
| // Calculate cursor position on screen | ||
| if cursor_line < area.height as usize && display_col < area.width as usize as usize { | ||
| if cursor_line < area.height as usize && display_col < area.width as usize { |
Copilot
AI
Sep 21, 2025
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.
This condition appears incorrect. The cursor position should be checked against the content area dimensions, not the total area dimensions. Also, there's a redundant as usize cast.
| if cursor_line < area.height as usize && display_col < area.width as usize { | |
| // Check cursor position against content area dimensions, not total area | |
| let content_height = area.height as usize; | |
| let content_width = area.width as usize; | |
| if cursor_line < content_height && display_col < content_width { |
CIの安定化とセキュリティ監査改善、ならびに日本語化に関する一連の変更をmainへ統合します。