Skip to content

Commit 0738102

Browse files
feat: Refactor TUI into modular structure and fix display issues
- Split TUI code into organized module structure (commands/tui/) - app.rs: Core application state and event handling - commands.rs: Command execution and HSM interaction - menu.rs: Menu categories and navigation - ui.rs: UI rendering and display formatting - mod.rs: Module exports and entry point - Fix literal \n characters showing in TUI command output - Update list-slots to display all slots with proper formatting - Add comprehensive TUI testing infrastructure (15 unit tests) - Create integration test framework for real HSM testing - Make TUI navigation methods public for testing access - Validate scrolling functionality with 18+ real HSM slots All tests passing, TUI fully functional with real PKCS#11 data. Modular architecture enables easier maintenance and testing.
1 parent 7994836 commit 0738102

10 files changed

Lines changed: 1521 additions & 847 deletions

File tree

crates/rust-hsm-cli/src/commands/interactive.rs

Lines changed: 0 additions & 844 deletions
This file was deleted.

crates/rust-hsm-cli/src/commands/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ pub mod analyze;
1212
pub mod common;
1313
pub mod crypto;
1414
pub mod info;
15-
pub mod interactive;
1615
pub mod key_wrap;
1716
pub mod keys;
1817
pub mod mac;
1918
pub mod symmetric;
2019
pub mod token;
20+
pub mod tui;
2121
pub mod util;
2222

2323
use common::CommandContext;
@@ -358,7 +358,7 @@ pub fn dispatch_command(command: Commands, config: Config) -> Result<()> {
358358
// Interactive command
359359
Commands::Interactive { label } => {
360360
let token_label = ctx.token_label(label).ok();
361-
interactive::run_interactive(ctx.config, token_label)
361+
tui::run_interactive(ctx.config, token_label)
362362
}
363363
}
364364
}

0 commit comments

Comments
 (0)