Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions .github/workflows/ask-agent-workspace-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Apply Ask Agent evidence workspace

on:
push:
branches:
- feat/ask-agent-evidence-workspace-v2180
paths:
- .github/workflows/ask-agent-workspace-integration.yml
workflow_dispatch:

permissions:
contents: write

concurrency:
group: ask-agent-workspace-${{ github.ref }}
cancel-in-progress: false

jobs:
integrate-and-verify:
runs-on: ubuntu-latest
steps:
- name: Checkout exact branch head
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # actions/checkout@v7
with:
ref: feat/ask-agent-evidence-workspace-v2180
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # actions/setup-python@v6
with:
python-version: "3.12"

- name: Apply bounded integration patch
env:
PR_NUMBER: "351"
run: python scripts/patch_ask_agent_workspace.py

- name: Verify patch shape
run: |
git diff --check
test -f frontend/src/components/AskAgentWorkspace.tsx
test -f docs/adr/0125-ask-agent-evidence-workspace.md
grep -F 'AskAgentWorkspace as AskAgentPanel' frontend/src/App.tsx
grep -F '| #351 | Ask Agent evidence workspace' docs/product-technical-gap-baseline.md
if grep -F 'function AskAgentPanel({' frontend/src/App.tsx; then
echo 'Legacy inline AskAgentPanel remains' >&2
exit 1
fi

- name: Set up Node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # actions/setup-node@v5
with:
node-version: "24"

- name: Enable Corepack
run: corepack enable

- name: Install locked frontend dependencies
working-directory: frontend
run: pnpm install --frozen-lockfile

- name: Run focused Ask Agent tests
working-directory: frontend
run: pnpm run test -- src/components/AskAgentWorkspace.test.tsx

- name: Run frontend lint
working-directory: frontend
run: pnpm run lint

- name: Run full frontend tests
working-directory: frontend
run: pnpm run test

- name: Build frontend
working-directory: frontend
run: pnpm run build

- name: Build Storybook state inventory
working-directory: frontend
run: pnpm run build-storybook

- name: Publish verified source change and remove one-shot machinery
run: |
rm -rf frontend/dist frontend/storybook-static
rm -f scripts/patch_ask_agent_workspace.py
rm -f .github/workflows/ask-agent-workspace-integration.yml
git diff --check
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add -A
git commit -m 'feat: integrate verified Ask Agent evidence workspace'
git push origin HEAD:feat/ask-agent-evidence-workspace-v2180
12 changes: 12 additions & 0 deletions CHANGELOG.d/2.18.0-ask-agent-evidence-workspace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Added

- Rebuilt the Global Ask destination as a responsive evidence workspace with a
dedicated semantic composer, explicit empty/loading/error/answer states,
separated Event Lineage and citation evidence, and answer focus management.
- Added Storybook scenes for empty, loading, answered, unavailable, and phone
layouts while preserving stale-session recovery and cited-post navigation.

## Fixed

- Replaced the unrelated Keyman-link button treatment in the Ask chatbox and
prevented Enter during IME composition from submitting a partial question.
66 changes: 66 additions & 0 deletions docs/adr/0125-ask-agent-evidence-workspace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# ADR 0125 — Ask Agent evidence workspace and composer contract

**Decision status:** Accepted
**Date:** 2026-08-21
**Figma File ID:** `1Su3lDRmiZdcUs47t1QwIX`
**Figma desktop frame:** `11:2` (`Ask Agent / Desktop / Answered`)
**Figma mobile frame:** `11:3` (`Ask Agent / Mobile / Answered`)
**Stack placement:** This change is a direct child of PR #264 head `8832216fcd2b0a1dcb486ea83269e25695ce378a`.

## Context

The stacked buyer surface already provided authorized Global Ask, durable
session recovery, cited-post navigation, and Event Lineage focus continuity.
The visible Ask Agent screen, however, remained a generic content section: the
composer reused a Keyman link-style button, the answer, timeline, citations,
and evidence facts shared one undifferentiated card, and the screen had no
component or Storybook state boundary of its own.

The project UI/UX Standard Guide v3.0 requires a clearly differentiated focused
input, visible action controls, responsive PC/tablet/phone behavior, and a
mobile layout that places the primary action within the content flow. ADR 0002
also established the safe Figma file above as the public design-system boundary
and forbids copying confidential source-organization material.

## Decision

1. Extract the destination into `AskAgentWorkspace`, with a stateful controller
and a presentational `AskAgentWorkspaceView`.
2. Use a semantic form and a visually primary Ask button. Enter submits,
Shift+Enter inserts a line break, and an IME composition Enter never submits.
3. Separate composer, pending/error/empty state, answer, Event Lineage timeline,
and cited evidence into explicit regions. A completed answer receives focus.
4. Keep every existing security and truth boundary: only the authenticated
`/api/ask` contract is called, stale sessions retry once without the expired
identifier, previous evidence is hidden while a replacement answer is
pending, and source actions retain the #263/#264 Event Lineage handoff.
5. Reuse existing design tokens and define responsive breakpoints at 1024px and
768px. The phone state uses a single column and a full-width primary action.
The primary action uses the shared `color/on-accent` token in both light and
dark modes rather than an inline foreground literal.
6. Keep editable answered-state desktop and mobile specifications in the Figma
frames recorded above. Inventory Empty, Loading, Answered, Unavailable, and
Phone Answered executable scenes in Storybook so state and edge-event review
remains coupled to the production component.

## Consequences

- Ask Agent is no longer coupled to the post-popup or Keyman control styles.
- Future streaming, follow-up history, or source comparison can evolve inside a
bounded component without expanding `App.tsx`.
- The component preserves the exact accessible labels relied on by existing
integration tests and downstream stacked PRs.
- Figma and CSS share named color, radius, and spacing concepts while Storybook
remains the executable source for loading, unavailable, and responsive states.
- This ADR does not claim the unmerged stack is protected-main behavior.

## Verification

- Focused controller, keyboard, session recovery, source navigation, and design
token/breakpoint contract tests.
- Existing App-level citation, timeline, stale-session, pending-answer, and
Event Lineage focus regressions.
- Frontend lint, production build, complete Vitest suite, and Storybook build.
- Desktop and mobile Figma screenshots checked for clipping, overflow, action
prominence, and source-evidence hierarchy.
- Responsive and focus-visible CSS review against the UI/UX guide.
Loading
Loading