Skip to content

fix(chat): preserve queued edits and render quoted source chips - #7452

Merged
waleedlatif1 merged 1 commit into
stagingfrom
codex/fix-release-7446-review
Sep 3, 2026
Merged

fix(chat): preserve queued edits and render quoted source chips#7452
waleedlatif1 merged 1 commit into
stagingfrom
codex/fix-release-7446-review

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Update composer mode and Search URL state atomically so a queued Build edit cannot be forced back into Search.
  • Clear Search text when leaving through the mode menu while preserving attachments, ordinary agent drafts, and restored queued messages.
  • Preserve citation and resource chips whose JSON contains backticks without consuming adjacent code spans or fenced code.

Knowledge access, Slack, and related documentation fixes from #7446 are covered separately by #7451.

Type of Change

  • Bug fix

Testing

Passed 189 focused tests across six suites, all 45 repository audits, lint, docs-manifest validation, and the app type-check. Regression assertions fail against the previous behavior. The retained changes completed all eight cleanup passes and a simplification review; malformed chip inputs also retain bounded scanning behavior.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 3, 2026 9:16pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR coordinates composer mode and Search URL updates so queued edits retain their content, and makes chat-chip sanitization preserve backticks inside JSON strings.

  • Moves non-Search query and filter cleanup into the shared mode setter.
  • Explicitly clears Search text when the user leaves Search while retaining attachments.
  • Replaces chip sanitization with a JSON-string-aware delimiter scan.
  • Adds regression coverage for queued-message restoration, mode transitions, and quoted chip payloads.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-sanitize.ts Introduces a bounded JSON-aware scan that preserves backticks inside source and workspace-resource payloads without consuming neighboring Markdown delimiters.
apps/sim/app/workspace/[workspaceId]/home/hooks/use-mothership-mode.ts Centralizes mode, query, and Search-filter updates into one URL-state operation when leaving Search.
apps/sim/app/workspace/[workspaceId]/home/components/user-input/user-input.tsx Adds an explicit Search-exit text reset while preserving attachments and prevents an empty URL seed from overwriting a restored queued message.
apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/mode-switcher/mode-switcher.tsx Delegates composer cleanup to UserInput before applying the shared atomic mode transition.
apps/sim/app/workspace/[workspaceId]/home/home.tsx Relies on the shared mode transition to clear Search state during queued-message restoration and result summarization.
apps/sim/app/workspace/[workspaceId]/home/search-params.ts Defines the combined parser set used to update mode and Search parameters atomically.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Search composer] --> B{User action}
  B -->|Choose Build or Assistant| C[Clear editor search text]
  C --> D[Atomically update mode and remove q/source/updated]
  B -->|Edit queued message| E[Restore queued request mode]
  E --> D
  D --> F[Load queued text and attachments]
  G[Chat response text] --> H[JSON-aware chip delimiter scan]
  H --> I[Preserve payload backticks]
  I --> J[Render source or resource chip]
Loading

Reviews (2): Last reviewed commit: "fix(chat): preserve queued edits and ren..." | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 23 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/app/workspace/[workspaceId]/home/types.ts Outdated
@waleedlatif1
waleedlatif1 force-pushed the codex/fix-release-7446-review branch from 2bba034 to 605b3b6 Compare September 3, 2026 21:16
@waleedlatif1 waleedlatif1 changed the title fix(app): correct knowledge access and chat state fix(chat): preserve queued edits and render quoted source chips Sep 3, 2026
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 10 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 68f740d into staging Sep 3, 2026
32 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/fix-release-7446-review branch September 3, 2026 21:30
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