Feat/render session#1652
Draft
Douglasymlai wants to merge 2 commits into
Draft
Conversation
Introduces a frontend-owned render-session layer under `src/components/ChatBox/renderSession/` that normalizes raw messages into typed `ChatBlock` / `ChatTurn` structures. The agent no longer needs to emit runtime UI schemas — the frontend classifies blocks from existing message steps and task state. Key changes: - Add `renderSession/types.ts`: `ChatBlock` discriminated union (markdown, user_message, question, completion, plan, work_log …) - Add `renderSession/normalizeMessages.ts`: converts `Message[]` + task state into `ChatTurn[]` with input-type detection for HITL - Add `renderSession/RenderSessionProvider.tsx`: context that supplies `chatTurns`, `activeAsk`, `taskId`, and a `submitReply` action - Add `renderSession/ChatTurnView.tsx` and `MessageBlockRenderer.tsx` as routing shells for individual blocks - Add `MessageItem/blocks/QuestionBlock.tsx`: renders `AgentStep.ASK` inline with text, choice, or context controls; owns a 30-second visible countdown that auto-submits "skip" when it expires - Update `UserQueryGroup` to render ASK messages as `QuestionBlock` instead of plain `AgentMessageCard` - Wrap `ProjectSection` content with `RenderSessionProvider` - Remove the global 30-second auto-skip timer from `ChatBox/index.tsx` (it now lives in `QuestionBlock` where the countdown is visible) Tests (39 passing): - Unit: normalizer covers simple turns, ASK active/inactive, files, orphan messages, multi-turn, detectInputType, extractChoices - Component: QuestionBlock text/choice submit, disabled-when-inactive, skipped state after fake-timer advancement Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ign custom ui for user input
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.
Related Issue
Closes #
Description
Testing Evidence (REQUIRED)
What is the purpose of this pull request?
Contribution Guidelines Acknowledgement