Skip to content

fix(wework): restore guidance text when editing - #2164

Merged
qdaxb merged 2 commits into
mainfrom
fix/wework-guidance-edit-draft
Jul 23, 2026
Merged

qdaxb merged 2 commits into
mainfrom
fix/wework-guidance-edit-draft

Conversation

@qdaxb

@qdaxb qdaxb commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • reset the buffered composer draft against the expected empty external value after submission
  • add regression coverage for restoring the same queued guidance text into the composer for editing
  • document the composer draft-buffer state invariant in Chinese and English

Why

After submitting guidance text, BufferedChatInput associated its empty local draft with the text that had just been submitted. When the same text was returned from the guidance row for editing, the buffer treated it as the previous source value and kept rendering the empty draft.

This change associates the post-submit empty draft with the expected empty external value, so editing a queued guidance row restores its text correctly.

Impact

Clicking Edit on a queued guidance entry now places the entry text back into the Wework composer as expected.

Validation

  • pnpm --filter wework exec vitest run src/components/layout/BufferedChatInput.test.tsx src/components/chat/ChatInput.test.tsx (99 tests passed)
  • pre-push ESLint, TypeScript, and unit tests passed
  • Prettier and git diff --check passed
  • isolated Tauri verification was attempted, but the isolated instance could not connect to the local cloud service and remained on workbench initialization; the session was stopped cleanly

Summary by CodeRabbit

  • Bug Fixes

    • Improved chat composer draft handling after submitting messages.
    • Restoring a queued message for editing now reliably repopulates the composer, including when the same text is submitted again.
  • Documentation

    • Added guidance covering composer draft buffering and external value synchronization.
  • Tests

    • Added regression coverage for queued-message editing and submitted-text restoration.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7f468549-87c6-47c8-b73f-168770713906

📥 Commits

Reviewing files that changed from the base of the PR and between 90b4827 and 6fa907f.

📒 Files selected for processing (5)
  • docs/en/wework/developer-guide/wework-chat-state-sources.md
  • docs/zh/wework/developer-guide/wework-chat-state-sources.md
  • wework/src/components/chat/ChatInput.test.tsx
  • wework/src/components/layout/BufferedChatInput.test.tsx
  • wework/src/components/layout/BufferedChatInput.tsx

📝 Walkthrough

Walkthrough

BufferedChatInput now clears its buffered source state after submission. Documentation and regression tests cover restoring submitted text when external values are cleared and later reused through queued-message editing.

Changes

Composer draft buffering

Layer / File(s) Summary
Draft reset contract
wework/src/components/layout/BufferedChatInput.tsx, docs/en/wework/developer-guide/..., docs/zh/wework/developer-guide/...
Submission now clears both the draft and its tracked source value; the state-source documentation describes the expected buffering behavior.
Queued-message edit regression coverage
wework/src/components/layout/BufferedChatInput.test.tsx, wework/src/components/chat/ChatInput.test.tsx
Tests verify that submitted or queued text is restored in the composer after editing and external value changes.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

Suggested reviewers: icycrystal4

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wework-guidance-edit-draft

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.

@qdaxb
qdaxb marked this pull request as ready for review July 23, 2026 16:41
@qdaxb
qdaxb merged commit 7654744 into main Jul 23, 2026
21 of 23 checks passed
@qdaxb
qdaxb deleted the fix/wework-guidance-edit-draft branch July 23, 2026 16:42
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