fix(display): scroll-bump correctness + prominent agent focus indicator#225
Merged
Conversation
User-reported bugs surfaced during PR review:
* Agent name was getting lost in a long status line. System messages
with empty `status_dict_parts` would push the focus indicator
mid-line where Rich truncates wrapped Text. Move "Agent: X" to the
front of the status bar with bright_cyan color so flipping focus
via /focus or Shift+arrow produces a visible signal.
* Scroll position would drift instead of pinning when the user
scrolled up. Two underlying bugs in `MaximDisplay.log()`:
1. **Double-bump**: when an appended entry had `agent=None` (every
bio-system event, every system message, every slash-command
emit), the iteration `for key in (None, agent)` became
`(None, None)` and the ALL view's offset was incremented twice
per append. ALL-view scroll-up got pushed off-screen at 2x rate.
2. **Missing bump for non-focused views**: when focused on agent X
and a None-agent entry arrives, X's view filter is
`e.agent is None or e.agent == X`, so the entry IS visible — but
only the None offset got bumped. X's scroll position drifted
on every system message.
Fix: compute the set of views whose filter admits the new entry
(always None; agent if not None; otherwise every roster entry),
and bump each of those offsets exactly once.
Regression-free for the focused-on-X-and-Y-agent-arrives case (Y
entries are filtered out of X's view, so X's offset stays put).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
User-reported bugs surfaced during PR review:
Agent name was getting lost in a long status line. System messages with empty
status_dict_partswould push the focus indicator mid-line where Rich truncates wrapped Text. Move "Agent: X" to the front of the status bar with bright_cyan color so flipping focus via /focus or Shift+arrow produces a visible signal.Scroll position would drift instead of pinning when the user scrolled up. Two underlying bugs in
MaximDisplay.log():Double-bump: when an appended entry had
agent=None(every bio-system event, every system message, every slash-command emit), the iterationfor key in (None, agent)became(None, None)and the ALL view's offset was incremented twice per append. ALL-view scroll-up got pushed off-screen at 2x rate.Missing bump for non-focused views: when focused on agent X and a None-agent entry arrives, X's view filter is
e.agent is None or e.agent == X, so the entry IS visible — but only the None offset got bumped. X's scroll position drifted on every system message.Fix: compute the set of views whose filter admits the new entry
(always None; agent if not None; otherwise every roster entry),
and bump each of those offsets exactly once.
Regression-free for the focused-on-X-and-Y-agent-arrives case (Y entries are filtered out of X's view, so X's offset stays put).