Skip to content

Preserve selected message in inspector on updates - #249

Merged
alcarney merged 2 commits into
swyddfa:developfrom
adranjan4:fix-247-preserve-message-selection
Aug 9, 2026
Merged

Preserve selected message in inspector on updates#249
alcarney merged 2 commits into
swyddfa:developfrom
adranjan4:fix-247-preserve-message-selection

Conversation

@adranjan4

@adranjan4 adranjan4 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • cd lib/lsp-devtools && hatch test (or pytest on tests/inspector/test_message_browser.py)
  • Run lsp-devtools inspect, feed chatty traffic, select a middle row — selection should stick
  • Move to the last row — new messages should still follow the tail

Stop always jumping to the latest row when new LSP traffic arrives.
Auto-follow only when the cursor is already on the last message (swyddfa#247).
@adranjan4

Copy link
Copy Markdown
Contributor Author

pre-commit.ci is failing with the same ruff/mypy issues present on develop (not introduced here). Happy to help clean those up in a follow-up if needed.

@alcarney

alcarney commented Aug 4, 2026

Copy link
Copy Markdown
Member

Thanks for opening this!

pre-commit.ci is failing with the same ruff/mypy issues present on develop

Yeah, it's a sign that the code is relatively immature still, happy to ignore any existing errors for now.

I've not had chance to try the branch out myself yet, but the implementation looks good. If you're adding tests though, I'd prefer it them to use a SqlHandler instance with an in-memory db connection, rather than having to maintain a separate _FakeDb implementation.

Drop the _FakeDb stub in favor of an in-memory SqlHandler, as
requested in review.

Co-authored-by: Cursor <cursoragent@cursor.com>
@adranjan4

Copy link
Copy Markdown
Contributor Author

Thanks for the review! Updated the tests to use SqlHandler(":memory:") instead of _FakeDb.

@alcarney

alcarney commented Aug 9, 2026

Copy link
Copy Markdown
Member

Thanks! I've finally had a chance to try it out and can confirm it works as expected 😄

@alcarney
alcarney merged commit 1d01bf2 into swyddfa:develop Aug 9, 2026
14 of 15 checks passed
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.

inspector overrides user's selected message on update

2 participants