Skip to content

Improve turn start feedback#3078

Open
gbarros-dev wants to merge 2 commits into
pingdotgg:mainfrom
gbarros-dev:grok-turn-start-feedback
Open

Improve turn start feedback#3078
gbarros-dev wants to merge 2 commits into
pingdotgg:mainfrom
gbarros-dev:grok-turn-start-feedback

Conversation

@gbarros-dev

@gbarros-dev gbarros-dev commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep the turn-start status visible from send click through draft promotion and provider start
  • move transient local dispatch state into a non-persisted per-thread store so route/component remounts do not hide the loading row
  • keep the elapsed timer continuous when the label changes from Starting request to Working
  • add unit and browser coverage for dispatch-state persistence, acknowledgement, and the draft first-send transition

Verification

  • vp test apps/web/src/session-logic.test.ts apps/web/src/localDispatchStore.test.ts apps/web/src/components/ChatView.logic.test.ts apps/web/src/components/chat/MessagesTimeline.logic.test.ts
  • cd apps/web && vp test run src/components/ChatView.browser.tsx --project browser -t "sends bootstrap turn-starts"
  • vp check
  • vp run typecheck

Note: vp check exits successfully and still reports existing react(no-unstable-nested-components) warnings outside this change.

Note

Show 'Starting request' label before the AI turn begins in the chat timeline

  • Adds a phase field ('starting' | 'running') to the working timeline row in MessagesTimeline.logic.ts, driving distinct UI labels: "Starting request for..." before the turn begins and "Working for..." once it is running.
  • Moves local dispatch state from React component state into a per-thread Zustand store (localDispatchStore.ts), preserving the original start timestamp across re-renders and preventing navigation between threads from clearing in-flight dispatch state.
  • Updates hasServerAcknowledgedLocalDispatch in ChatView.logic.ts so acknowledgement requires a new turn with a non-null startedAt, not just a session metadata change.
  • Reorders deriveActiveWorkStartedAt in session-logic.ts to prefer the local send timestamp when available, falling back to the running turn's startedAt for recovered sessions.

Macroscope summarized 74d6dc1.


Note

Medium Risk
Touches send/busy state, draft promotion, and when local vs server work is shown—user-visible timing bugs are possible but changes are well covered by unit and browser tests.

Overview
Improves chat feedback from send through provider turn start by keeping a per-thread local dispatch in a new Zustand localDispatchStore (keyed by scoped thread ref) instead of ChatView component state, so draft promotion and remounts no longer drop the loading row.

Acknowledgement logic in hasServerAcknowledgedLocalDispatch now clears local dispatch only when the latest turn actually changes and has a startedAt, not on incidental session metadata updates—matching the new “starting” window.

The timeline working indicator gains a phase (starting | running): copy shows “Starting request” until latestTurn is running with a start time, then “Working”. deriveActiveWorkStartedAt prefers the local send timestamp when present so the elapsed timer stays continuous across the label change.

ChatView stops resetting local dispatch on draftId/threadId changes; optimistic message cleanup still runs on thread id change. Tests cover store behavior, acknowledgement, timeline phases, draft first-send browser flow, and session timing.

Reviewed by Cursor Bugbot for commit 74d6dc1. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5dc031f7-db36-4a5a-8721-1fe3234f5b81

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Jun 14, 2026
@gbarros-dev gbarros-dev force-pushed the grok-turn-start-feedback branch from 922724a to 6d3f72f Compare June 14, 2026 14:22
@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Jun 14, 2026
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Jun 14, 2026
@gbarros-dev gbarros-dev marked this pull request as ready for review June 14, 2026 15:37

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 74d6dc1. Configure here.

Comment thread apps/web/src/components/ChatView.tsx
@macroscopeapp

macroscopeapp Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces new state management infrastructure and changes runtime behavior for turn feedback timing. An unresolved review comment identifies a potential bug where the working timer may reset during phase transitions, which warrants human review.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant