Skip to content

refactor: rename single-letter variables to descriptive names - #9

Open
ricsdeol wants to merge 1 commit into
feat/process-detail-modalfrom
rename_vars
Open

ricsdeol wants to merge 1 commit into
feat/process-detail-modalfrom
rename_vars

Conversation

@ricsdeol

@ricsdeol ricsdeol commented Apr 25, 2026

Copy link
Copy Markdown
Owner

Summary by cubic

Renamed single-letter variables across input, UI, platform discovery, and main for clearer, more descriptive names. No behavior changes; also adds internal design and plan docs for the upcoming process detail modal.

  • Refactors
    • Replaced terse locals (e.g., s, d, p, e) with clear names (e.g., app_state, device, process, entry) in src/input.rs, src/main.rs, src/platform/swap_discovery.rs, and UI modules.
    • Improved readability in render helpers and utilities (e.g., paragraph, table_header, popup_area), and aligned tests with new names.
    • Added docs under docs/superpowers/ for the process detail modal design and implementation plan.

Written for commit 343c43d. Summary will update on new commits.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 9 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/superpowers/plans/2026-04-25-process-detail-modal.md">

<violation number="1" location="docs/superpowers/plans/2026-04-25-process-detail-modal.md:656">
P2: This assertion contradicts the documented close behavior during kill confirmation; it should keep the modal open and only clear the confirm flag.</violation>

<violation number="2" location="docs/superpowers/plans/2026-04-25-process-detail-modal.md:1135">
P2: The `ratatui` import block duplicates `text::{Line, Span, Text}`, which causes a compile error.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

state.selected_process_detail = Some(42);
state.process_detail_confirm_kill = true;
state.handle_action(Action::CloseProcessDetail);
assert!(state.selected_process_detail.is_none());

@cubic-dev-ai cubic-dev-ai Bot Apr 25, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This assertion contradicts the documented close behavior during kill confirmation; it should keep the modal open and only clear the confirm flag.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/superpowers/plans/2026-04-25-process-detail-modal.md, line 656:

<comment>This assertion contradicts the documented close behavior during kill confirmation; it should keep the modal open and only clear the confirm flag.</comment>

<file context>
@@ -0,0 +1,1582 @@
+    state.selected_process_detail = Some(42);
+    state.process_detail_confirm_kill = true;
+    state.handle_action(Action::CloseProcessDetail);
+    assert!(state.selected_process_detail.is_none());
+    assert!(!state.process_detail_confirm_kill);
+}
</file context>
Suggested change
assert!(state.selected_process_detail.is_none());
assert_eq!(state.selected_process_detail, Some(42));
Fix with Cubic

Frame,
layout::{Alignment, Constraint, Direction, Layout, Rect},
style::{Color, Modifier, Style},
text::{Line, Span, Text},

@cubic-dev-ai cubic-dev-ai Bot Apr 25, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The ratatui import block duplicates text::{Line, Span, Text}, which causes a compile error.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/superpowers/plans/2026-04-25-process-detail-modal.md, line 1135:

<comment>The `ratatui` import block duplicates `text::{Line, Span, Text}`, which causes a compile error.</comment>

<file context>
@@ -0,0 +1,1582 @@
+    Frame,
+    layout::{Alignment, Constraint, Direction, Layout, Rect},
+    style::{Color, Modifier, Style},
+    text::{Line, Span, Text},
+    style::Stylize,
+    symbols,
</file context>
Fix with Cubic

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.

1 participant