Skip to content

feat: chat refinement + write-mode badges on proposals card#44

Closed
gabe-lyons wants to merge 1 commit intofeat/mcp-appsfrom
feat/proposals-chat-write-mode
Closed

feat: chat refinement + write-mode badges on proposals card#44
gabe-lyons wants to merge 1 commit intofeat/mcp-appsfrom
feat/proposals-chat-write-mode

Conversation

@gabe-lyons
Copy link
Copy Markdown

Summary

Stacked on top of #28. Turns /improve-context from a one-shot checkbox flow into a fully interactive component: the user can chat with the proposals card to refine the list before submitting, and each proposal carries a visible write-mode badge so they see the blast radius up front.

  • Per-proposal write-mode badgeProposalItem gains write_mode: "direct" | "needs_approval" (defaults to needs_approval). UI renders a green ShieldCheck ("Writes directly") or amber ShieldAlert ("Needs approval") with a tooltip.
  • Inline chat refinement — new textarea below the proposal list. Enter submits, Shift+Enter newlines. Sent via sendProposalRefinement with source: \"proposal_chat\" + origin_message_id, renders as a normal user bubble, does not flip the card to the submitted state — Submit is still the only action that consumes the proposals.
  • Agent guidanceimprove-context/SKILL.md updated with the labeling rule (touches shared DataHub metadata → needs_approval; user-scoped → direct) and how to handle proposal_chat turns (clarify in text, or re-emit present_proposals with a revised list).

Out of scope (intentional): no actual approval gate or split-write routing — the badge is informational. Future work could branch the submit path on write_mode.

Test plan

  • uv run pytest tests/unit/ — 88 passed
  • pnpm tsc --noEmit — clean
  • Manual: open http://localhost:5173, run /improve-context after a substantive question, verify badges render correctly per proposal
  • Manual: type a refinement ("drop chore: rename package to datahub-analytics-agent + add PyPI metadata #2, add one about churn"), confirm it appears as a normal user bubble and the card stays interactive
  • Manual: hit Submit, confirm the existing selection-chip + results flow still works unchanged

🤖 Generated with Claude Code

Turns /improve-context into a fully interactive component:

- ProposalItem gains write_mode ("direct" | "needs_approval") so the agent
  can label the blast radius of each proposal. UI renders a green
  ShieldCheck (writes directly) or amber ShieldAlert (needs approval) badge
  per row with a tooltip explaining the consequence.
- Adds an inline chat input to the proposals card so users can refine
  ("drop #3, add one about churn") before submitting. Refinement turns flow
  through a new sendProposalRefinement helper tagged source="proposal_chat"
  with origin_message_id, render as a normal user bubble, and don't put the
  card into the submitted state — selection still requires the Submit button.
- Skill prompt teaches the agent when to label needs_approval vs direct,
  and how to handle proposal_chat follow-ups (clarify in plain text, or
  re-emit present_proposals with a revised list for material changes).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gabe-lyons
Copy link
Copy Markdown
Author

Closed — opened in error.

@gabe-lyons gabe-lyons closed this May 6, 2026
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