Skip to content

Extract magic numbers, replace eprintln, rename VaultManager::lock to seal#96

Open
an0nn30 wants to merge 1 commit intomainfrom
chore/quick-wins-cleanup
Open

Extract magic numbers, replace eprintln, rename VaultManager::lock to seal#96
an0nn30 wants to merge 1 commit intomainfrom
chore/quick-wins-cleanup

Conversation

@an0nn30
Copy link
Copy Markdown
Owner

@an0nn30 an0nn30 commented Mar 28, 2026

What does this PR do?

Three small cleanup items bundled:

1. Magic numbers → constants:

  • SSH_DEFAULT_PORT (22), DEFAULT_PTY_COLS (80), DEFAULT_PTY_ROWS (24) in conch_remote
  • MENU_ACTION_TOGGLE_BOTTOM_PANEL, MENU_ACTION_CHECK_UPDATES, MENU_ACTION_ABOUT in conch_tauri menu.rs

2. eprintln → log:

  • 3 eprintln! calls in jvm/runtime.rs replaced with log::debug!/log::warn!

3. VaultManager::lock() → seal():

  • Renamed to avoid the confusing vault.lock().lock() pattern
  • Now reads vault.lock().seal() — unambiguous

Type of change

  • Refactor / cleanup

Testing

  • Builds without errors
  • All workspace tests pass
  • No regressions

…::lock to seal

- Add SSH_DEFAULT_PORT, DEFAULT_PTY_COLS, DEFAULT_PTY_ROWS constants to
  conch_remote and replace magic numbers in handler.rs and ssh.rs
- Add missing MENU_TOGGLE_BOTTOM_PANEL_ID, MENU_ACTION_TOGGLE_BOTTOM_PANEL,
  MENU_ACTION_CHECK_UPDATES, and MENU_ACTION_ABOUT constants to menu.rs;
  replace inline string literals in menu.rs and lib.rs
- Replace eprintln! with log::debug!/log::warn! in jvm/runtime.rs
  (keep eprintln in main.rs and test code)
- Rename VaultManager::lock() to seal() to avoid confusion with
  Mutex::lock(); update call sites in vault_commands.rs and tests
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e502c536e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

///
/// Named `seal` (rather than `lock`) to avoid confusion with Mutex::lock
/// on the `Arc<Mutex<VaultManager>>` wrapper used by the app.
pub fn seal(&self) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve lock API until all call sites are migrated

Renaming VaultManager::lock to seal here introduces a compile break because not all callers were updated: crates/conch_tauri/src/remote/ssh_commands.rs:655 still invokes mgr.lock(). Any test build that compiles this module (e.g. cargo test -p conch_tauri or workspace tests) will fail with no method named \lock``, so this refactor is currently incomplete unless you also migrate remaining usages or keep a temporary compatibility wrapper.

Useful? React with 👍 / 👎.

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