Skip to content

fix(tui): Center the initially selected session in the session_list (resolves #8558) - #8560

Merged
rekram1-node merged 2 commits into
anomalyco:devfrom
ariane-emory:fix/center-selected-session
Jan 15, 2026
Merged

rekram1-node merged 2 commits into
anomalyco:devfrom
ariane-emory:fix/center-selected-session

Conversation

@ariane-emory

@ariane-emory ariane-emory commented Jan 14, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR attempts to ensure that the initially selected session when the session_list is opened is always within the viewport when opening the session list by trying to center it within the viewport.

Resolves #8558

Before (after following the procedure described in the issue)

Screenshot 2026-01-14 at 6 40 43 PM

After

Screenshot 2026-01-14 at 6 41 35 PM

How did you verify your code works?

A/B testing and running all tests in the project to ensure that no failures were introduced.

- Add 'center' parameter to moveTo() function for viewport centering
- Use setTimeout to defer scroll until component is rendered
- Pass center=true from filter/current effect for initial positioning
- Keyboard navigation retains edge-scroll behavior for smooth UX

This fixes an issue where the selected item could be outside the visible
viewport when opening dialogs like the session list.
@ariane-emory
ariane-emory marked this pull request as ready for review January 14, 2026 23:55
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@ariane-emory

Copy link
Copy Markdown
Contributor Author

If desired, I do also have another branch in my pocket that automatically recenters the viewport as the selection is moved using the keyboard in all of the modal selection list windows that use dialog-select.ts, but that seems more like a new feature rather than something that is part of this specific fix.

@rekram1-node
rekram1-node merged commit 08ca123 into anomalyco:dev Jan 15, 2026
5 checks passed
@ariane-emory
ariane-emory deleted the fix/center-selected-session branch January 16, 2026 19:57
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
MarsQiu007 referenced this pull request in MarsQiu007/openNovel Jul 31, 2026
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Currently active session not always visible when opening the session_list

2 participants