-
Notifications
You must be signed in to change notification settings - Fork 6
fix(tui): anchor the Agents rail cursor to its row, not its offset #222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f3f2fc2
fix(tui): anchor the Agents rail cursor to its row, not its offset
senamakel 4b85ba6
Merge remote-tracking branch 'refs/remotes/upstream/main' into pr/222
senamakel 0b62c96
fix(tui): keep Agents rail cursor anchored
senamakel e830d9d
fix(tui): anchor overflow rail controls
senamakel fa8894e
fix(tui): stabilize rail cursor navigation
senamakel 8e79f38
Merge remote-tracking branch 'refs/remotes/upstream/main' into pr/222
senamakel daff7b1
fix(tui): isolate rail cursor behavior
senamakel f9ce202
fix(tui): stabilize rendered rail interactions
senamakel 69ca9ce
Merge remote-tracking branch 'upstream/main' into pr/222
senamakel 1a9ee3f
fix(tui): stabilize rail cursor hit targets
senamakel 51e5e9a
Merge remote-tracking branch 'refs/remotes/upstream/main' into pr/222
senamakel 4afae70
fix(tui): reject stale rail pointer targets
senamakel 5bc66ce
fix(tui): preserve rail snapshot identity
senamakel 0851596
fix(tui): expose app model to sibling modules
senamakel 3049935
fix(tui): preserve rail target snapshots
senamakel 53baa73
fix(tui): restore rail test visibility
senamakel cde3c59
fix(tui): keep rail cursors on lane snapshots
senamakel 083d00c
Merge upstream/main into pr/222
senamakel 5a295b3
fix(tui): route workflow rail clicks
senamakel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| //! Cursor identity tests for the Agents rail. | ||
| //! | ||
| //! The live rail is rebuilt on every frame, so these cover the stable-anchor | ||
| //! resolver independently of the `App` rendering loop. | ||
|
|
||
| use crate::ui::agents::{AgentLane, AgentRole, AgentRow}; | ||
|
|
||
| use super::{rail_anchor, resolve_rail_cursor, AgentRailRow, RailAnchor, RailRow}; | ||
|
|
||
| fn agent(id: &str) -> RailRow { | ||
| RailRow::Agent(AgentRailRow { | ||
| agent_id: id.to_string(), | ||
| host_id: String::new(), | ||
| agent: None, | ||
| lane_index: None, | ||
| }) | ||
| } | ||
|
|
||
| fn lane(key: &str) -> AgentLane { | ||
| AgentLane { | ||
| key: key.to_string(), | ||
| label: String::new(), | ||
| role: AgentRole::Agent, | ||
| turns: Vec::new(), | ||
| last_at: 0, | ||
| tasks: Vec::new(), | ||
| context_tokens: None, | ||
| usage: Default::default(), | ||
| harness_label: None, | ||
| agent_id: None, | ||
| session_id: None, | ||
| parent_agent_id: None, | ||
| descriptor: None, | ||
| active_tasks: 0, | ||
| work: None, | ||
| } | ||
| } | ||
|
|
||
| #[test] | ||
| fn an_anchored_agent_follows_rows_inserted_ahead_of_it() { | ||
| let anchor = RailAnchor::Agent("builder".to_string()); | ||
| let rows = vec![RailRow::NewAgent, agent("scout"), agent("builder")]; | ||
|
|
||
| assert_eq!(resolve_rail_cursor(&rows, &[], Some(&anchor), 0), 2); | ||
| } | ||
|
|
||
| #[test] | ||
| fn a_missing_anchor_uses_the_clamped_previous_offset() { | ||
| let rows = vec![RailRow::NewAgent, agent("builder")]; | ||
| let anchor = RailAnchor::Agent("removed".to_string()); | ||
|
|
||
| assert_eq!(resolve_rail_cursor(&rows, &[], Some(&anchor), 99), 1); | ||
| } | ||
|
|
||
| #[test] | ||
| fn an_overflow_anchor_uses_its_lanes_stable_key() { | ||
| let lanes = vec![lane("builder")]; | ||
| let overflow = RailRow::Lane(AgentRow::More { | ||
| lane_index: 0, | ||
| hidden: 3, | ||
| }); | ||
|
|
||
| let anchor = rail_anchor(&overflow, &lanes); | ||
| assert_eq!(anchor, Some(RailAnchor::Overflow("builder".to_string()))); | ||
|
|
||
| let rows = vec![RailRow::NewAgent, agent("new"), overflow]; | ||
| assert_eq!(resolve_rail_cursor(&rows, &lanes, anchor.as_ref(), 0), 2); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.