Skip to content

fix(native-chat): handle reordering with timestampless transcripts - #10050

Merged
AmethystLiang merged 1 commit into
mainfrom
native-chat-reorders
Jul 23, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
native-chat-reorders

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

Problem

Transcripts from some sources (e.g., Grok) carry no timestamps on their turns. The previous logic excluded these messages from the pending-send matching algorithm, leaving seeded prompts and pending sends permanently stranded at the list tail—which appeared to users as conversation reordering.

Solution

Updated the matching logic to treat timestamp === null as a match candidate:

  • messageIsAfterPendingTimestamp(): Changed to return true for timestampless messages (since they cannot be ordered chronologically, they must be treated as current)
  • launchPromptAsMessage() and shouldPruneLaunchPrompt(): Updated filter to include timestampless messages when checking for matching completed turns

Added concise comments explaining the rationale: a launch prompt seeds a brand-new session, so a matching user turn with no timestamp can only be its own delivery.

Testing

  • Added 3 test cases covering timestampless transcript scenarios:
    • Pruning a first send against a timestampless transcript turn
    • Hiding a first send while its timestampless transcript turn is visible
    • Hiding and pruning the launch prompt against a timestampless transcript
  • All existing tests remain passing

Grok transcripts carry no timestamps. Previous logic excluded these rows
from matching, leaving pending sends and launch prompts unmatched and
causing the seeded bubble to appear rank-pinned at the list tail — which
reads as conversation reordering.

Now pending sends, launch prompts, and their pruning rules treat null
timestamps as matching-eligible, allowing echo suppression and proper
cleanup of delivered messages.
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bfffe247-72de-49e7-9308-4b9d206f6486

📥 Commits

Reviewing files that changed from the base of the PR and between 6d55c7f and 7d61156.

📒 Files selected for processing (2)
  • src/renderer/src/components/native-chat/native-chat-pending.test.ts
  • src/renderer/src/components/native-chat/native-chat-pending.ts

📝 Walkthrough

Walkthrough

Updated native chat pending-send and launch-prompt matching to treat transcript messages with timestamp: null as represented content. Added tests covering pending-send pruning, hiding pending messages, and pruning launch prompts for timestampless transcripts.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers problem, solution, and testing, but it omits required Screenshots, AI Review Report, Security Audit, and Notes sections. Add the missing template sections, including Screenshots, AI Review Report with cross-platform checks, Security Audit, and Notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: native chat now handles timestampless transcripts to avoid reordering.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AmethystLiang
AmethystLiang merged commit bae29fd into main Jul 23, 2026
2 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…tablyai#10050)

Grok transcripts carry no timestamps. Previous logic excluded these rows
from matching, leaving pending sends and launch prompts unmatched and
causing the seeded bubble to appear rank-pinned at the list tail — which
reads as conversation reordering.

Now pending sends, launch prompts, and their pruning rules treat null
timestamps as matching-eligible, allowing echo suppression and proper
cleanup of delivered messages.
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.

1 participant