Skip to content

feat: aggregated page-session card — one card per page-driving run (#413) - #438

Merged
omridevk merged 5 commits into
mainfrom
feat/page-session-card
Aug 12, 2026
Merged

omridevk merged 5 commits into
mainfrom
feat/page-session-card

Conversation

@omridevk

@omridevk omridevk commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Closes #426, closes #427, closes #428. Parent: #413.

What

A turn where the AI drives the live page now renders as ONE aggregated page-session card instead of a flat stack of per-action tool cards:

  • Streaming: card appears on the first act, browser-chrome header (traffic dots · title · URL pill · pulsing "acting"), rows append live with shimmer on the active step. No screen area (the real page behind the widget is the live view).
  • Settled collapsed: one line — status dot · Edited the page (or Ran script on the page for script-only runs) · N actions · chevron.
  • Settled expanded: step rail (lucide verb icon · verb · target · value chip per row; done/error/aborted states), targets labeled from element-capture accessibleNames; collapsed Reasoning · script section holds the run's thinking (flat ReasoningText) and executed typescriptCode.
  • Code mode aware: execute_typescript runs whose subcalls are page acts fold into the session (fold-by-parentage — mixed-tool runs stay whole); thinking folds into open sessions; reply text closes; approval-requested calls never fold.

Visual source of truth: docs/assets/page-session-card-spike/ (#414), validated against regenerated exhibits; chrome styled per the codeimage reference (fixed-height band — the one fixed height — full-strength dots, container-query ladder with one element per crossing, zero layout shift).

Structure

  • @conciv/ui-kit-chat: opt-in page-session segment kind in groupSegments (no options = byte-identical), renderer contract (PageSessionConfig), pageSession prop on styled Thread + Activity, shared segment→props helpers, ReasoningText split out of Reasoning, SHIMMER exported.
  • @conciv/extension-page: SessionCard + pure pageSessionSteps/pageSessionScripted, stories (Streaming/Settled/Expanded/Narrow/Aborted/WithError) behind an Ark-splitter resize decorator, solid-browser rail-identity tests.
  • @conciv/ui-kit-system: sanctioned Splitter re-export (stories-only consumer).
  • apps/conciv: chat-pane wiring; real-pane history-reload test.
  • Consumers that don't opt in keep today's flat grouping — the generic message primitive is untouched.

Verification

  • TDD throughout; two adversarial review rounds (opus agent + codex gpt-5.6-sol), all confirmed findings fixed: fold-by-parentage, scoped chain suppression, thread last-renderable streaming boundary, status/error agreement, honest history URL (no pill when unknown), zero-step phantom guard, approval fold guard.
  • Gates: serial package suites, typecheck 93/93, lint, widget IT against a --force-rebuilt embed (turbo cache twice restored a stale bundle — hash pairs in the run log), full affected serial gate 105/105 (whiteboard CI-only per policy), fallow zero introduced.
  • Streaming remount flicker RCA'd (For-keyed rail rows) and pinned by DOM-node-identity tests.

Follow-ups

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added consolidated page-action session cards that group related actions into a single “Edited the page” experience.
    • Session cards display action progress, locations, scripts, reasoning, errors, and expandable details.
    • Added support for streaming, completed, aborted, and failed page sessions.
    • Added configurable card layouts and splitter-based resizing for narrow panels.
  • Bug Fixes

    • Prevented duplicate action cards, standalone action entries, and unnecessary Chain of Thought displays in page-action transcripts.
    • Improved page-action transcript stability while sessions are streaming or reloaded.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e384caa9-1cef-4c40-b385-105bc21bf757

📥 Commits

Reviewing files that changed from the base of the PR and between 27deb94 and c9e800d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • apps/conciv/src/pane/chat-pane.tsx
  • packages/extensions/page/src/client/cards/session-card.tsx
  • packages/extensions/page/src/client/cards/session-steps.ts
  • packages/extensions/page/src/shared/defs.ts
  • packages/extensions/page/test/defs.test.ts
  • packages/extensions/page/test/session-card.solid.browser.test.tsx
  • packages/extensions/page/test/session-steps.test.ts
  • packages/ui-kit-chat/package.json
  • packages/ui-kit-chat/src/store/grouping.ts
  • packages/ui-kit-chat/src/styled/activity.tsx
  • packages/ui-kit-chat/test/page-session-injection.browser.test.tsx
🚧 Files skipped from review as they are similar to previous changes (8)
  • packages/extensions/page/test/session-steps.test.ts
  • packages/extensions/page/src/client/cards/session-steps.ts
  • packages/extensions/page/src/shared/defs.ts
  • packages/extensions/page/test/defs.test.ts
  • packages/ui-kit-chat/src/styled/activity.tsx
  • apps/conciv/src/pane/chat-pane.tsx
  • packages/ui-kit-chat/test/page-session-injection.browser.test.tsx
  • packages/extensions/page/src/client/cards/session-card.tsx

📝 Walkthrough

Walkthrough

Changes

Page-session card

Layer / File(s) Summary
Page-session grouping contracts
packages/ui-kit-chat/src/store/*, packages/ui-kit-chat/src/index.tsx, packages/extensions/page/src/shared/defs.ts, packages/ui-kit-chat/test/grouping.test.ts, packages/extensions/page/test/defs.test.ts
Page actions, paired results, reads, blank text, and code-mode calls can form one page-session segment. Default grouping remains unchanged.
SessionCard presentation
packages/extensions/page/src/client/cards/*, packages/ui-kit-chat/src/tools/*, packages/ui-kit-system/src/splitter.tsx, packages/extensions/page/test/*, packages/extensions/page/vitest.config.ts
SessionCard derives step state and renders streaming, settled, expanded, aborted, error, location, reasoning, and script content. Stories and browser tests cover these states.
Thread and activity injection
packages/ui-kit-chat/src/styled/thread.tsx, packages/ui-kit-chat/src/styled/activity.tsx, packages/ui-kit-chat/src/styled/reasoning.tsx, packages/ui-kit-chat/test/page-session-injection.browser.test.tsx
Thread and activity rendering accept PageSessionConfig, select page-session segments, and pass calls, thinking, results, and streaming state to the renderer.
Application and end-to-end integration
apps/conciv/src/pane/chat-pane.tsx, apps/conciv/test/page-session-card.browser.test.tsx, packages/embed/tests/e2e/element-capture.it.test.ts
ChatPane enables the page-session renderer. Browser and embed tests verify one aggregated card for historical and live page actions.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ChatPane
  participant ThreadMessages
  participant groupSegments
  participant SessionCard
  ChatPane->>ThreadMessages: provide PageSessionConfig
  ThreadMessages->>groupSegments: group page tool calls and results
  groupSegments-->>ThreadMessages: return page-session segment
  ThreadMessages->>SessionCard: provide session parts and streaming state
  SessionCard-->>ThreadMessages: render aggregated page-action card
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: aggregating page-driving actions into one page-session card.
Linked Issues check ✅ Passed The implementation and tests cover page-session grouping, SessionCard states, thread and activity injection, historical transcripts, and non-opted-in behavior.
Out of Scope Changes check ✅ Passed The changes support page-session grouping, rendering, integration, testing, or required UI primitives and dependencies.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/page-session-card

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/ui-kit-chat/src/styled/thread.tsx (1)

142-155: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Extract the duplicated page-session selection logic into page-session.ts. Both views now carry their own copy of asPageSession, renderable, lastRenderableIndex, and liveSegment, plus near-identical Dynamic wiring. The copies have already diverged: the Activity copy omits reply segments from renderable, which produces the streaming-state defect raised separately at packages/ui-kit-chat/src/styled/activity.tsx line 279. packages/ui-kit-chat/src/store/page-session.ts currently shares only the leaf helpers, so each new segment rule must be applied twice.

  • packages/ui-kit-chat/src/styled/thread.tsx#L142-L155: move asPageSession and the lastRenderableIndex computation into packages/ui-kit-chat/src/store/page-session.ts as a helper that accepts the parts, the segments, and a per-view renderable predicate. Call that helper here.
  • packages/ui-kit-chat/src/styled/activity.tsx#L274-L286: call the same helper, and supply the Activity predicate that uses stepIndices for chains.

The per-view differences are the chain filter and the resultFor source. Keep those as parameters.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui-kit-chat/src/styled/thread.tsx` around lines 142 - 155, The
duplicated page-session selection and last-renderable-index logic must be
centralized. In packages/ui-kit-chat/src/store/page-session.ts, add a helper
accepting parts, segments, and a per-view renderable predicate, while preserving
configurable chain filtering and resultFor sources; move the shared
asPageSession and lastRenderableIndex behavior there. In
packages/ui-kit-chat/src/styled/thread.tsx lines 142-155 and
packages/ui-kit-chat/src/styled/activity.tsx lines 274-286, replace local
implementations with the shared helper, supplying each view’s chain predicate,
resultFor source, and Activity’s stepIndices-based behavior; ensure Activity
includes reply segments in its predicate.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/ui-kit-chat/src/store/grouping.ts`:
- Around line 47-67: Update foldableParentIds to absorb a parent only when it
has a confirmed foldable page act in the same session; exclude
approval-requested and other non-foldable children from firstActChildIndex.
Ensure a non-page tool between the parent and its first act does not create an
act-less absorbed session—preserve the parent or convert the grouping to a
chain—and add coverage for both cases.

In `@packages/ui-kit-chat/src/styled/activity.tsx`:
- Around line 279-286: Update the renderable helper in the activity component to
also return true for reply segments, matching the Thread view’s behavior. Move
the existing asReply declaration above renderable so it can be used there,
ensuring lastRenderableIndex and liveSegment identify a trailing reply as the
final renderable segment.

---

Nitpick comments:
In `@packages/ui-kit-chat/src/styled/thread.tsx`:
- Around line 142-155: The duplicated page-session selection and
last-renderable-index logic must be centralized. In
packages/ui-kit-chat/src/store/page-session.ts, add a helper accepting parts,
segments, and a per-view renderable predicate, while preserving configurable
chain filtering and resultFor sources; move the shared asPageSession and
lastRenderableIndex behavior there. In
packages/ui-kit-chat/src/styled/thread.tsx lines 142-155 and
packages/ui-kit-chat/src/styled/activity.tsx lines 274-286, replace local
implementations with the shared helper, supplying each view’s chain predicate,
resultFor source, and Activity’s stepIndices-based behavior; ensure Activity
includes reply segments in its predicate.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 615febe6-a3b7-4c7a-a60f-14ecaed8fef1

📥 Commits

Reviewing files that changed from the base of the PR and between f6874a2 and 5813048.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (31)
  • apps/conciv/src/pane/chat-pane.tsx
  • apps/conciv/test/page-session-card.browser.test.tsx
  • docs/assets/page-session-card-spike/fake-form.html
  • packages/embed/tests/e2e/element-capture.it.test.ts
  • packages/extensions/page/package.json
  • packages/extensions/page/src/client.tsx
  • packages/extensions/page/src/client/cards/session-card.stories.tsx
  • packages/extensions/page/src/client/cards/session-card.tsx
  • packages/extensions/page/src/client/cards/session-steps.ts
  • packages/extensions/page/src/client/cards/story.fixtures.ts
  • packages/extensions/page/src/shared/defs.ts
  • packages/extensions/page/test/defs.test.ts
  • packages/extensions/page/test/session-card.solid.browser.test.tsx
  • packages/extensions/page/test/session-steps.test.ts
  • packages/extensions/page/vitest.config.ts
  • packages/ui-kit-chat/src/index.tsx
  • packages/ui-kit-chat/src/primitives/message/message.stories.tsx
  • packages/ui-kit-chat/src/primitives/message/message.tsx
  • packages/ui-kit-chat/src/store/grouping.ts
  • packages/ui-kit-chat/src/store/page-session.ts
  • packages/ui-kit-chat/src/styled/activity.tsx
  • packages/ui-kit-chat/src/styled/reasoning.tsx
  • packages/ui-kit-chat/src/styled/thread.tsx
  • packages/ui-kit-chat/src/tools.tsx
  • packages/ui-kit-chat/src/tools/styled/card-shell.tsx
  • packages/ui-kit-chat/src/tools/styled/collapsible-card.tsx
  • packages/ui-kit-chat/src/tools/styled/tool-card.tsx
  • packages/ui-kit-chat/test/grouping.test.ts
  • packages/ui-kit-chat/test/page-session-injection.browser.test.tsx
  • packages/ui-kit-system/src/index.tsx
  • packages/ui-kit-system/src/splitter.tsx

Copilot AI 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.

Pull request overview

Adds opt-in aggregation of page-driving tool runs into a single streaming or settled session card across chat surfaces.

Changes:

  • Adds page-session grouping, rendering contracts, and app wiring.
  • Implements session cards with steps, captures, scripts, reasoning, and status states.
  • Adds browser, integration, unit, and Storybook coverage.

Reviewed changes

Copilot reviewed 31 out of 32 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pnpm-lock.yaml Updates dependency resolutions.
packages/ui-kit-system/src/splitter.tsx Re-exports Ark Splitter.
packages/ui-kit-system/src/index.tsx Exposes Splitter publicly.
packages/ui-kit-chat/test/page-session-injection.browser.test.tsx Tests thread/activity injection.
packages/ui-kit-chat/test/grouping.test.ts Tests session grouping rules.
packages/ui-kit-chat/src/tools/styled/tool-card.tsx Supports custom flush headers.
packages/ui-kit-chat/src/tools/styled/collapsible-card.tsx Adds flush-header styling.
packages/ui-kit-chat/src/tools/styled/card-shell.tsx Forwards custom header options.
packages/ui-kit-chat/src/tools.tsx Exports shimmer styling.
packages/ui-kit-chat/src/styled/thread.tsx Renders page sessions in threads.
packages/ui-kit-chat/src/styled/reasoning.tsx Extracts reusable reasoning text.
packages/ui-kit-chat/src/styled/activity.tsx Renders sessions in activity views.
packages/ui-kit-chat/src/store/page-session.ts Defines session renderer contracts/helpers.
packages/ui-kit-chat/src/store/grouping.ts Implements page-session segmentation.
packages/ui-kit-chat/src/primitives/message/message.tsx Supports session segment indices.
packages/ui-kit-chat/src/primitives/message/message.stories.tsx Updates segment story typing.
packages/ui-kit-chat/src/index.tsx Exports session APIs.
packages/extensions/page/vitest.config.ts Adds Solid browser-test project.
packages/extensions/page/test/session-steps.test.ts Tests step derivation.
packages/extensions/page/test/session-card.solid.browser.test.tsx Tests session-card behavior.
packages/extensions/page/test/defs.test.ts Tests mutating tool-name derivation.
packages/extensions/page/src/shared/defs.ts Exposes page act names.
packages/extensions/page/src/client/cards/story.fixtures.ts Extends card fixtures.
packages/extensions/page/src/client/cards/session-steps.ts Derives session steps.
packages/extensions/page/src/client/cards/session-card.tsx Implements the aggregated card.
packages/extensions/page/src/client/cards/session-card.stories.tsx Adds visual session scenarios.
packages/extensions/page/src/client.tsx Exports session-card APIs.
packages/extensions/page/package.json Adds Solid testing dependency.
packages/embed/tests/e2e/element-capture.it.test.ts Verifies aggregated widget rendering.
docs/assets/page-session-card-spike/fake-form.html Reformats the visual fixture.
apps/conciv/test/page-session-card.browser.test.tsx Tests history-reloaded sessions.
apps/conciv/src/pane/chat-pane.tsx Enables page sessions in chat.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file
Suppressed comments (2)

packages/ui-kit-chat/src/store/grouping.ts:55

  • Approval-requested child acts still contribute their parent ID here. For [execute_typescript parent, page.fill child awaiting approval], the parent is moved into a step-less page session and disappears, even though approval calls must never cause folding. Exclude approval-requested acts when deriving foldable parents.
    if (!pageActNames.has(part.name)) return

packages/ui-kit-chat/src/store/grouping.ts:64

  • Only reply text is treated as a split between a parent and its first act child. A non-page top-level call or approval call in that interval also closes a session, but this pre-scan still marks the parent as foldable; the parent then becomes a step-less hidden session while the later act opens a second card. Derive parent foldability using all session-closing boundaries, not replies alone.
    const split = replyIndices.some((replyIndex) => replyIndex > parentIndex && replyIndex < childIndex)
    if (!split) ids.add(parent)

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +56 to +58
function stepDescriptor(capture: ToolCaptureView | undefined): ElementDescriptor | undefined {
return capture?.after?.descriptor ?? capture?.before?.descriptor
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 9927cda — descriptor selection is now per-field: accessibleName/value each take the first non-empty of after→before (descriptorField), so a named before-capture wins over an unnamed after-capture. Unit tests cover both fields.

if (!pageSession || segment.kind !== 'page-session') return null
return pageSessionHasSteps(props.turn.parts, segment.indices, pageSession.actNames) ? segment : null
}
const renderable = (segment: Segment): boolean => asPageSession(segment) !== null || visibleChain(segment) !== null

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 9927cda — activity's renderable now counts replies as boundaries, matching the thread surface; browser test pins [act, result, reply] settling the card in a live activity. (The two surfaces' chain-visibility predicates deliberately remain separate — they gate on different things — but the boundary semantics now agree.)

Comment on lines +44 to +54
const firstRow = document.querySelector('li')

setParts((previous) => [...previous, fillCall('f2', '#email', 'ada@')])
await expect.element(page.getByText('Filling #email…')).toBeVisible()
expect(document.querySelectorAll('li')[0]).toBe(firstRow)
const secondRow = document.querySelectorAll('li')[1]

setParts((previous) => [...previous.slice(0, 1), fillCall('f2', '#email', 'ada@example.com')])
await expect.element(page.getByText('“ada@example.com”')).toBeVisible()
expect(document.querySelectorAll('li')[0]).toBe(firstRow)
expect(document.querySelectorAll('li')[1]).toBe(secondRow)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 9927cda — the identity test now uses getByRole('listitem') locators; node-identity comparisons kept.

const ACTION_FORMAT = new Intl.NumberFormat()
const ACTION_PLURAL = new Intl.PluralRules('en')

const GERUNDS: Record<string, string> = {fill: 'Filling', check: 'Checking', select: 'Selecting', click: 'Clicking'}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 9927cda — running phrases now derive from each tool def's canonical label.running via pageVerbGerund (hand-kept map deleted); a guard test asserts every act verb yields a gerund. Side effect: fill's canonical copy is "Typing …", which replaced "Filling …".

Comment on lines +51 to +54
parts.forEach((part, index) => {
if (isReplyText(part)) replyIndices.push(index)
if (part.type !== 'tool-call') return
if (part.id && !parentIndexById.has(part.id)) parentIndexById.set(part.id, index)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partly disagree, differently resolved: the repo has no functional-style rule banning local mutation in a pure function, and a typed reduce over one accumulator object is the same mutation in different clothes — so the literal suggestion is declined. The underlying legibility point was real though: c9e800d rewrites the scan declaratively with es-toolkit (uniqBy for first-occurrence maps, flatMap projections, a filter for the unsplit parents). The sequential fold in placeSegmentPart stays a fold by design.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/extensions/page/src/client/cards/session-card.tsx (1)

86-95: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Replace the as const assertion.

Declare ROW_DELAYS as readonly string[]; its indexed use only requires read-only strings and keeps the same behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/extensions/page/src/client/cards/session-card.tsx` around lines 86 -
95, Replace the as const assertion on ROW_DELAYS with an explicit readonly
string[] type annotation, preserving the existing delay values and indexed usage
behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/extensions/page/src/client/cards/session-card.tsx`:
- Around line 173-176: Update sessionStatus and the related status contract to
preserve aborted sessions: retain streaming and error precedence, then return an
aborted status when any step has state "aborted" instead of marking the session
complete. Extend ToolStatus, StatusVisual, cardPhase, and StepGlyph handling as
needed so aborted sessions render their aborted visual without an ordinal.

---

Nitpick comments:
In `@packages/extensions/page/src/client/cards/session-card.tsx`:
- Around line 86-95: Replace the as const assertion on ROW_DELAYS with an
explicit readonly string[] type annotation, preserving the existing delay values
and indexed usage behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8a85e2b2-e240-405c-806f-28c0f3dca0b3

📥 Commits

Reviewing files that changed from the base of the PR and between 5813048 and 27deb94.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • packages/extensions/page/src/client/cards/session-card.tsx
  • packages/ui-kit-chat/src/styled/activity.tsx
  • packages/ui-kit-chat/src/styled/thread.tsx
  • packages/ui-kit-chat/src/tools/styled/collapsible-card.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/ui-kit-chat/src/styled/activity.tsx
  • packages/ui-kit-chat/src/tools/styled/collapsible-card.tsx
  • packages/ui-kit-chat/src/styled/thread.tsx

Comment on lines +173 to +176
function sessionStatus(steps: ReadonlyArray<PageSessionStep>, streaming: boolean, errored: boolean): ToolStatus {
if (streaming) return 'running'
return errored || steps.some((step) => step.state === 'error') ? 'error' : 'complete'
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -C 4 'ToolStatus|StatusVisual|aborted' \
  packages/ui-kit-chat/src \
  packages/extensions/page/src \
  packages/extensions/page/test

Repository: conciv-dev/conciv

Length of output: 34991


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- local skill files ---'
fd -HI 'SKILL|skill' . --type f | head -80

printf '%s\n' '--- relevant source outlines ---'
ast-grep outline packages/extensions/page/src/client/cards/session-card.tsx
ast-grep outline packages/ui-kit-chat/src/tools/primitives/tool-status.ts
ast-grep outline packages/ui-kit-chat/src/tools/primitives/status-visual.tsx
ast-grep outline packages/ui-kit-chat/src/tools/primitives/tool-presentation.ts
ast-grep outline packages/ui-kit-chat/src/tools/styled/card-shell.tsx

Repository: conciv-dev/conciv

Length of output: 11876


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- repository review skill ---'
cat .claude/skills/conciv-review/SKILL.md

printf '%s\n' '--- code review skill ---'
cat .github/skills/code-review/SKILL.md

printf '%s\n' '--- session card ---'
sed -n '150,320p' packages/extensions/page/src/client/cards/session-card.tsx

printf '%s\n' '--- shared status types and visuals ---'
cat packages/ui-kit-chat/src/tools/primitives/tool-status.ts
sed -n '1,90p' packages/ui-kit-chat/src/tools/primitives/status-visual.tsx
sed -n '1,70p' packages/ui-kit-chat/src/tools/primitives/tool-presentation.ts

printf '%s\n' '--- status consumers ---'
rg -n -C 5 'cardPhase|sessionStatus|StepGlyph|status=' \
  packages/extensions/page/src/client/cards/session-card.tsx \
  packages/ui-kit-chat/src/tools/styled/card-shell.tsx

Repository: conciv-dev/conciv

Length of output: 40288


Preserve aborted session state.

A settled session with an aborted step is shown as complete, and StepGlyph shows the ordinal. Preserve error precedence, then add aborted handling for the aggregate status and step glyph. Extend ToolStatus, StatusVisual, and cardPhase if the shared status contract represents aborted.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/extensions/page/src/client/cards/session-card.tsx` around lines 173
- 176, Update sessionStatus and the related status contract to preserve aborted
sessions: retain streaming and error precedence, then return an aborted status
when any step has state "aborted" instead of marking the session complete.
Extend ToolStatus, StatusVisual, cardPhase, and StepGlyph handling as needed so
aborted sessions render their aborted visual without an ordinal.

omridevk and others added 3 commits August 12, 2026 16:47
…ontract (#426)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
#427)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d and activity (#428)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI 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.

Pull request overview

Copilot reviewed 30 out of 31 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file
Suppressed comments (10)

packages/ui-kit-chat/src/styled/activity.tsx:283

  • Reply segments are omitted from the live boundary. If reply text starts after a page session while the turn is still live, the session remains lastRenderableIndex and continues rendering as “Editing the page” even though reply text closes the session. Include replies when finding the last renderable segment, matching the thread implementation.
  const renderable = (segment: Segment): boolean => asPageSession(segment) !== null || visibleChain(segment) !== null

packages/extensions/page/src/client/cards/session-steps.ts:58

  • Choosing the entire after descriptor suppresses a valid before.accessibleName whenever an after-capture exists but has no usable name. This breaks the required after-name → before-name → input fallback. Resolve capture fields independently, trying the non-empty after value and then the before value.
function stepDescriptor(capture: ToolCaptureView | undefined): ElementDescriptor | undefined {
  return capture?.after?.descriptor ?? capture?.before?.descriptor
}

packages/extensions/page/test/session-card.solid.browser.test.tsx:44

  • This UI test selects implementation-detail <li> tags directly. The repository’s browser-test rules require native role/text locators; using getByRole('listitem') preserves the node-identity assertion without coupling it to markup.
  const firstRow = document.querySelector('li')

packages/extensions/page/test/session-card.solid.browser.test.tsx:111

  • This bypasses the browser locator assertion API by inspecting document.body.textContent. Use a text locator so absence is asserted with the repository’s web-first browser-test behavior.
  expect(document.body.textContent).not.toContain(location.host)

packages/extensions/page/test/session-card.solid.browser.test.tsx:125

  • This presence check also reads the DOM synchronously instead of using a web-first locator, so it can race rendering and violates the browser-test convention. Assert the location text through expect.element.
  expect(document.body.textContent).toContain(location.host)

packages/ui-kit-chat/src/store/grouping.ts:52

  • This forEach mutates multiple accumulators (replyIndices and both maps). The repository’s functional-style law requires map/reduce/flatMap instead of forEach plus mutation; derive this scan with a reducer so state flow is explicit.
  parts.forEach((part, index) => {
    if (isReplyText(part)) replyIndices.push(index)

packages/ui-kit-chat/src/store/grouping.ts:159

  • This forEach performs the whole grouping operation by mutating the shared grouping object. That conflicts with the repository’s functional-style law against forEach plus mutation; make segment placement a reducer that returns the next grouping state.
  parts.forEach((part, index) => placeSegmentPart(grouping, part, index))

packages/extensions/page/src/client/cards/session-card.tsx:302

  • defaultOpen is only the initial uncontrolled state. Because this card intentionally stays mounted while streaming changes, a card mounted open during streaming remains expanded after settling instead of transitioning to the required settled-collapsed state. Track controlled open state (as Reasoning does) and plumb open/onOpenChange through CardShell and ToolCard.
          defaultOpen={props.streaming}

packages/extensions/page/src/client/cards/session-card.tsx:305

  • The browser-chrome header is rendered in every state, so a settled collapsed card still shows traffic dots, URL, and badge. The PR contract specifies the compact collapsed row as status · title · action count · chevron, with browser chrome for streaming/expanded states. Render a compact header while settled and closed, switching to SessionHeader when open or streaming.
          header={

packages/extensions/page/test/session-card.solid.browser.test.tsx:96

  • These status assertions synchronously inspect locator elements instead of using web-first browser assertions. Assert one error icon as visible and the complete icon as absent through expect.element, so rendering is awaited rather than sampled.

This issue also appears in the following locations of the same file:

  • line 111
  • line 125
  expect(page.getByRole('img', {name: 'error'}).elements().length).toBeGreaterThan(0)
  expect(page.getByRole('img', {name: 'complete'}).elements()).toHaveLength(0)

if (isReplyText(part)) replyIndices.push(index)
if (part.type !== 'tool-call') return
if (part.id && !parentIndexById.has(part.id)) parentIndexById.set(part.id, index)
if (!pageActNames.has(part.name)) return
omridevk added a commit that referenced this pull request Aug 12, 2026
The feature (#438) shipped and was visually verified against the mockup;
the generator stays recoverable from git history (last at bc2c8a3).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
omridevk and others added 2 commits August 12, 2026 17:44
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI 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.

Pull request overview

Copilot reviewed 31 out of 32 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file
Suppressed comments (4)

packages/extensions/page/test/session-card.solid.browser.test.tsx:139

  • This direct body-text assertion is synchronous and bypasses the required web-first locator behavior. Assert the host through the native browser locator so the check retries with useful diagnostics.
  expect(document.body.textContent).toContain(location.host)

packages/extensions/page/src/client/cards/session-card.tsx:273

  • The streaming branch already renders a labeled running dot beside “acting”, then this unconditional status visual renders the same running indicator again. This duplicates both the visual indicator and the screen-reader announcement; render the general status dot only in the settled fallback.
      <Show when={props.streaming} fallback={<span class={HEAD_BADGE}>{mutatingBadge(SESSION_META)}</span>}>
        <span class={HEAD_LIVE}>
          <StatusVisual status="running" form="dot" />
          <span class={HEAD_LIVE_TEXT}>acting</span>
        </span>
      </Show>
      <StatusVisual status={props.status} form="dot" />
    </span>

packages/extensions/page/src/client/cards/session-card.tsx:206

  • Aborted and successfully completed rows both fall back to the ordinal; their only distinction is muted color. Screen-reader and non-color users therefore cannot identify the aborted action. Add semantic aborted text or an equivalent status icon.
      <Switch fallback={<>{props.ordinal}</>}>

packages/extensions/page/test/session-card.solid.browser.test.tsx:125

  • This direct document.body.textContent assertion bypasses the browser locator's retry and diagnostics. Use the repository's web-first native locator assertion for the absent host text.

This issue also appears on line 139 of the same file.

  expect(document.body.textContent).not.toContain(location.host)

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

Labels

None yet

Projects

None yet

2 participants