Repository navigation
Conversation
Contributor
This branch has not been deployed
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.
Closes #588
Problem
With the default settings (
showDeletedoff), a message stacked under a deleted message stays stacked after the deleted one is hidden. It is displayed without its sender, under the previous visible message, so another user's name appears to be its author.AbstractChatModelcomputesstackedby comparing each message with the previous one in the list, hidden deleted messages included.Solution
_isStacked(index)compares the sender with the previous displayed message: deleted messages are skipped whenshowDeletedis off.showDeletednow also updates the stacked state, so toggling the setting does not need a reload.flowchart TD A[Bob deletes the first of his two messages] --> B{Chat opened with deleted messages hidden} B -->|Before| C[Remaining message shown under Alice] B -->|After| D[Remaining message shows Bob]Narrated recording, before then after (sound on):
evidence_upload.mp4
Edge cases and unchanged behavior checked
Checked in the running app (JupyterLab 4.6.6 with the extension built from
mainatc112d54, then from this branch, withoutjupyter_collaboration) and shown in the recording. The chats were seeded with messages from two users, Alice and Bob:showDeletedon in the settings shows the deleted message under Bob's name and stacks his reply under it; turning it off again gives the reply Bob's name back, without reloading.Checked by tests only: the three new unit tests in
model.spec.ts(hidden deleted message, shown deleted message,showDeletedtoggled).Not changed: when a message is deleted while the chat is open, its header stays visible until the chat is reopened, as on
main.Tests run
With the source change reverted and the tests kept, 2 of the 3 new tests fail (the third covers the behavior that must not change).
prettier --checkandeslintpass on the changed files, andjlpm build(TypeScript) passes.Not run: the UI tests and the Python tests (no Python change).
AI tools (Claude Code) assisted with this change; the bug was reproduced and the fix verified manually in the running app.
🤖 Generated with Claude Code