Skip to content

Conversation

@SilentMalachite
Copy link
Owner

CIの安定化とセキュリティ監査改善、ならびに日本語化に関する一連の変更をmainへ統合します。

Copilot AI review requested due to automatic review settings September 21, 2025 15:52
Copy link

Copilot AI left a 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 unwrap calls

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.

Comment on lines 51 to 132
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);
}
}
Copy link

Copilot AI Sep 21, 2025

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.

Copilot uses AI. Check for mistakes.

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]);
Copy link

Copilot AI Sep 21, 2025

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.

Copilot uses AI. Check for mistakes.

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]);
Copy link

Copilot AI Sep 21, 2025

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.

Copilot uses AI. Check for mistakes.

// 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 {
Copy link

Copilot AI Sep 21, 2025

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.

Suggested change
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 {

Copilot uses AI. Check for mistakes.
@SilentMalachite SilentMalachite merged commit ae717d3 into main Nov 2, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants