Skip to content

Commit 3bbbeca

Browse files
authored
Audit: Synchronize keyboard shortcuts and unify Tool implementation with ToolFuture alias (#33)
* Audit: Synchronize keyboard shortcuts and unify Tool implementation with ToolFuture alias * Update CHANGELOG.md with Documentation Site and Architectural Cleanup details
1 parent fe8236c commit 3bbbeca

10 files changed

Lines changed: 19 additions & 52 deletions

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ All notable changes to this project will be documented in this file.
2323
- **Optimized Response Handling**: Added 10,000-character truncation to HTTP bodies for memory and rendering efficiency.
2424
- **Dependency Pruning**: Leaner `Tokio` feature set to reduce binary size and compilation time.
2525

26+
### Documentation & DX
27+
- **Documentation Site**: Automated `mdBook` deployment to GitHub Pages via CI.
28+
- **Shortcut Audit**: Synchronized and documented all global and tool-specific keyboard navigation.
29+
- **Architectural Cleanup**: Simplified tool implementation using the unified `ToolFuture` type alias.
30+
2631
## [v2026.02.28] - 2026-02-28
2732

2833
### Features

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ You can modify this file to change database paths or API URLs.
6969
## Navigation
7070

7171
- **Keyboard:**
72-
- `Tab`: Switch between tool tabs.
73-
- `Ctrl+F`: Open global search palette.
74-
- `Ctrl+C`: Intercepted by some tools for clipboard operations (e.g., copying results). Use `Esc` or `q` to exit tools where applicable.
75-
- **Arrow Keys, Enter, etc.:** Used for interacting with the currently selected tool.
72+
- `Tab`: Switch between tool tabs.
73+
- `Ctrl+F`: Open global search palette.
74+
- `Ctrl+Q`: Quit the application.
75+
- `Ctrl+C`: Copy the current status message (bottom left) to the clipboard.
76+
- **Arrow Keys, Enter, etc.:** Used for interacting with the currently selected tool.
7677
- **Mouse / Touchpad:**
7778
- **Click / Tap:** Select a tab to switch to that tool.
7879

src/tools/encoder_decoder.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ use ratatui::{
33
prelude::*,
44
widgets::{Block, Borders, Paragraph},
55
};
6-
use std::error::Error;
7-
use std::future::Future;
8-
use std::pin::Pin;
96

107
use base64::{engine::general_purpose::STANDARD as b64, Engine as _};
118
use hex;
@@ -147,10 +144,7 @@ impl super::Tool for EncoderDecoderTool {
147144
f.render_widget(result_para, chunks[2]);
148145
}
149146

150-
fn handle_input(
151-
&mut self,
152-
key: KeyEvent,
153-
) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error>>> + Send + '_>> {
147+
fn handle_input(&mut self, key: KeyEvent) -> crate::tools::ToolFuture<'_> {
154148
Box::pin(async move {
155149
match key.code {
156150
KeyCode::Char('m') if key.modifiers.contains(KeyModifiers::CONTROL) => {

src/tools/http_inspector.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ use ratatui::{
55
};
66
use reqwest::{Client, Method};
77
use std::error::Error;
8-
use std::future::Future;
9-
use std::pin::Pin;
108

119
#[derive(Debug, Clone, Copy, PartialEq)]
1210
enum HttpMethod {
@@ -174,10 +172,7 @@ impl super::Tool for HttpRequestInspectorTool {
174172
f.render_widget(result_para, chunks[1]);
175173
}
176174

177-
fn handle_input(
178-
&mut self,
179-
key: KeyEvent,
180-
) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error>>> + Send + '_>> {
175+
fn handle_input(&mut self, key: KeyEvent) -> crate::tools::ToolFuture<'_> {
181176
Box::pin(async move {
182177
match key.code {
183178
KeyCode::Char('m') if key.modifiers.contains(KeyModifiers::CONTROL) => {

src/tools/jwt_decoder.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ impl JwtDecoderTool {
4646
}
4747
}
4848

49-
use std::future::Future;
50-
use std::pin::Pin;
51-
5249
impl super::Tool for JwtDecoderTool {
5350
fn name(&self) -> &'static str {
5451
"JWT Decoder"
@@ -121,10 +118,7 @@ impl super::Tool for JwtDecoderTool {
121118
f.render_widget(results, chunks[1]);
122119
}
123120

124-
fn handle_input(
125-
&mut self,
126-
key: KeyEvent,
127-
) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error>>> + Send + '_>> {
121+
fn handle_input(&mut self, key: KeyEvent) -> crate::tools::ToolFuture<'_> {
128122
Box::pin(async move {
129123
match key.code {
130124
KeyCode::Char(c) => {

src/tools/org_research.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
use crate::models::github::Organization;
22
use crate::secrets::Secrets;
33
use reqwest::Client;
4+
use std::error::Error;
45

56
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
67
use ratatui::{
78
prelude::*,
89
widgets::{Block, Borders, Paragraph},
910
};
1011
use serde_json;
11-
use std::error::Error;
1212

1313
pub struct OrgResearchTool {
1414
input: InputState,
@@ -80,9 +80,6 @@ impl OrgResearchTool {
8080
}
8181
}
8282

83-
use std::future::Future;
84-
use std::pin::Pin;
85-
8683
impl super::Tool for OrgResearchTool {
8784
fn name(&self) -> &'static str {
8885
"Org Research"
@@ -174,10 +171,7 @@ impl super::Tool for OrgResearchTool {
174171
f.render_widget(results, chunks[results_idx]);
175172
}
176173

177-
fn handle_input(
178-
&mut self,
179-
key: KeyEvent,
180-
) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error>>> + Send + '_>> {
174+
fn handle_input(&mut self, key: KeyEvent) -> crate::tools::ToolFuture<'_> {
181175
Box::pin(async move {
182176
match key.code {
183177
KeyCode::Up => {

src/tools/repo_explorer.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ impl RepoExplorerTool {
9090
}
9191
}
9292

93-
use std::future::Future;
94-
use std::pin::Pin;
95-
9693
impl super::Tool for RepoExplorerTool {
9794
fn name(&self) -> &'static str {
9895
"Repo Explorer"
@@ -159,10 +156,7 @@ impl super::Tool for RepoExplorerTool {
159156
f.render_widget(results, chunks[results_idx]);
160157
}
161158

162-
fn handle_input(
163-
&mut self,
164-
key: KeyEvent,
165-
) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error>>> + Send + '_>> {
159+
fn handle_input(&mut self, key: KeyEvent) -> crate::tools::ToolFuture<'_> {
166160
Box::pin(async move {
167161
match key.code {
168162
KeyCode::Enter => self.fetch_repos().await,

src/tools/token_inspector.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ use ratatui::{
66
};
77
use reqwest::Client;
88
use std::error::Error;
9-
use std::future::Future;
10-
use std::pin::Pin;
119

1210
use std::sync::{Arc, Mutex};
1311

@@ -241,10 +239,7 @@ impl super::Tool for TokenInspectorTool {
241239
f.render_widget(results, chunks[1]);
242240
}
243241

244-
fn handle_input(
245-
&mut self,
246-
key: KeyEvent,
247-
) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error>>> + Send + '_>> {
242+
fn handle_input(&mut self, key: KeyEvent) -> crate::tools::ToolFuture<'_> {
248243
// We need to clone state for the async move block
249244
let mut tool_clone = self.clone_state();
250245
Box::pin(async move {

src/tools/unicode_inspector.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ use ratatui::{
1313
use unicode_segmentation::UnicodeSegmentation;
1414

1515
use crate::tools::LoadState;
16-
use std::future::Future;
17-
use std::pin::Pin;
1816

1917
pub struct UnicodeInspectorTool {
2018
input: InputState,
@@ -270,10 +268,7 @@ impl super::Tool for UnicodeInspectorTool {
270268
f.render_widget(results, chunks[4]);
271269
}
272270

273-
fn handle_input(
274-
&mut self,
275-
key: KeyEvent,
276-
) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error>>> + Send + '_>> {
271+
fn handle_input(&mut self, key: KeyEvent) -> crate::tools::ToolFuture<'_> {
277272
Box::pin(async move {
278273
match key.code {
279274
KeyCode::Up => {

0 commit comments

Comments
 (0)