Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
- `cargo test` - Run tests with rstest framework
- `cargo check` - Fast compile check
- `cargo clippy` - Run linter
- `cargo fmt` - Format the code
- `cargo doc --no-deps` - Generate documentation

Always run cargo check, test, fmt and clipy before committing.

### Bacon Integration (preferred for continuous development)
Uses `bacon.toml` configuration:
- `bacon` or `bacon check` - Continuous cargo check
Expand Down Expand Up @@ -91,4 +94,4 @@ Communication via tokio channels with priority queues (high/low priority from Ap

### Testing
- Uses `rstest` framework for unit tests
- Integration tests should consume real external resources (following user's global CLAUDE.md)
- Integration tests should consume real external resources (following user's global CLAUDE.md)
120 changes: 119 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ repository = "https://github.com/sgrimee/webex-tui"
version = "0.8.0"

[dependencies]
arboard = { version = "3.6", default-features = false }
base64 = "0.22"
chrono = "0.4"
clap = { version = "4", features = ["cargo"] }
Expand Down
15 changes: 15 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Justfile for webex-tui development

# List all available targets
default:
@just --list

# Run comprehensive quality checks (check, clippy, test, fmt)
check-all:
just check
just lint
just test
just fmt

# Compile check
check:
cargo check

# Build the project
build:
cargo build
Expand Down
7 changes: 5 additions & 2 deletions src/app/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pub(crate) enum Action {
ToggleRoomSelection,
SelectAllVisibleRooms,
ClearRoomSelections,
CopyMessage,
DeleteSelectedRooms,
UnselectMessage,
}
Expand Down Expand Up @@ -94,6 +95,7 @@ impl Action {
Action::ToggleRoomSelection => &[Key::Char(' ')],
Action::SelectAllVisibleRooms => &[Key::Char('A')],
Action::ClearRoomSelections => &[Key::Char('C')],
Action::CopyMessage => &[Key::Char('y')],
Action::DeleteSelectedRooms => &[Key::Char('X')],
Action::UnselectMessage => &[Key::Esc],
}
Expand Down Expand Up @@ -142,10 +144,11 @@ impl Display for Action {
Action::ToggleRoomSelection => "Toggle room selection",
Action::SelectAllVisibleRooms => "Select all visible rooms",
Action::ClearRoomSelections => "Clear room selections",
Action::CopyMessage => "Copy message",
Action::DeleteSelectedRooms => "Delete selected rooms",
Action::UnselectMessage => "Unselect message",
};
write!(f, "{}", str)
write!(f, "{str}")
}
}

Expand Down Expand Up @@ -197,7 +200,7 @@ impl From<Vec<Action>> for Actions {
.map(Action::to_string)
.collect::<Vec<_>>()
.join(", ");
format!("Conflict key {} with actions {}", key, actions)
format!("Conflict key {key} with actions {actions}")
})
.collect::<Vec<_>>();
if !errors.is_empty() {
Expand Down
9 changes: 6 additions & 3 deletions src/app/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,17 @@ impl Cache {
.iter()
.filter_map(|room| {
let room_and_team_title = self.room_and_team_title(&room.id).ok()?;
let search_text = format!("{} {}",
let search_text = format!(
"{} {}",
room_and_team_title.room_title,
room_and_team_title.team_name.unwrap_or_default()
);
matcher.fuzzy_match(&search_text, query).map(|score| (room, score))
matcher
.fuzzy_match(&search_text, query)
.map(|score| (room, score))
})
.collect();

// Sort by score (highest first)
scored_rooms.sort_by(|a, b| b.1.cmp(&a.1));
scored_rooms.into_iter()
Expand Down
7 changes: 3 additions & 4 deletions src/app/cache/rooms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl Rooms {

/// Mark a room as unread.
pub(crate) fn mark_unread(&mut self, id: &RoomId) {
debug!("Marking room {} unread", id);
debug!("Marking room {id} unread");
for room in &mut self.sorted_rooms {
if room.id == *id {
room.unread = true;
Expand All @@ -81,7 +81,7 @@ impl Rooms {

/// Mark a room as read.
pub(crate) fn mark_read(&mut self, id: &RoomId) {
debug!("Marking room {} read", id);
debug!("Marking room {id} read");
for room in &mut self.sorted_rooms {
if room.id == *id {
room.unread = false;
Expand All @@ -108,7 +108,7 @@ impl Rooms {

/// Remove a room completely
pub(crate) fn remove_room(&mut self, id: &RoomId) {
debug!("Removing room {}", id);
debug!("Removing room {id}");
self.sorted_rooms.retain(|room| room.id != *id);
self.requested_rooms.remove(id);
}
Expand All @@ -117,7 +117,6 @@ impl Rooms {
pub(crate) fn sorted_rooms(&self) -> &Vec<Room> {
&self.sorted_rooms
}

}

#[cfg(test)]
Expand Down
Loading