Skip to content

Add spec for result view auto-refresh on logical ID change#266

Open
IanMayo wants to merge 10 commits intomainfrom
claude/speckit-specify-089-6fGbR
Open

Add spec for result view auto-refresh on logical ID change#266
IanMayo wants to merge 10 commits intomainfrom
claude/speckit-specify-089-6fGbR

Conversation

@IanMayo
Copy link
Member

@IanMayo IanMayo commented Feb 17, 2026

Summary

This PR introduces the formal specification for the Result View Auto-Refresh feature (001-result-auto-refresh), which enables result views to automatically update when underlying result data changes, while preserving the analyst's viewport state.

Key Changes

Notable Details

  • Feature absorbs E03 feat(023): Add epic workflow support for large feature breakdown #83 as noted in the user description
  • Specification is technology-agnostic and implementation-ready
  • All acceptance scenarios are independent and testable
  • Offline-first design with no network dependencies
  • Debounce strategy for handling rapid successive updates
  • Deferred rendering for background tabs to optimize resource usage

https://claude.ai/code/session_01Hryx1Gtq4c5dk539KzVVNB

Defines auto-refresh behavior for result views bound to logical result
IDs, including viewport preservation, debouncing, pause/resume, and
multi-view independence. Absorbs E03 #83 into E04 results visualization.

https://claude.ai/code/session_01Hryx1Gtq4c5dk539KzVVNB
Phase 0: research.md — technical decisions on registry events, Vega
signal API for viewport, 300ms debounce, service-layer controller.

Phase 1: data-model.md, contracts (AutoRefreshController, viewport
handle, useAutoRefresh hook), quickstart.md.

Phase 2: planning blog post and LinkedIn summary.

All constitution gates pass. No new dependencies required.

https://claude.ai/code/session_01Hryx1Gtq4c5dk539KzVVNB
Clarification session: pause/resume toggle is a small icon button
in the tab header next to the close button (per-tab action pattern).

https://claude.ai/code/session_01Hryx1Gtq4c5dk539KzVVNB
When the same logical result ID is open in multiple views (panel + editor
tab), each refreshes independently with its own auto-refresh state.
Updated FR-004 and edge cases.

https://claude.ai/code/session_01Hryx1Gtq4c5dk539KzVVNB
48 tasks across 8 phases: setup, foundation, 4 user stories
(auto-refresh, viewport preservation, multi-view, pause/resume),
Storybook/E2E, and polish with evidence collection and PR creation.

https://claude.ai/code/session_01Hryx1Gtq4c5dk539KzVVNB
Phase 1+2: Setup and Foundation for result view auto-refresh.

- AutoRefreshController in services/session-state/src/refresh/
  - register/unregister views per logical result ID
  - subscribe to ResultIdRegistry change events
  - per-view state management (paused, stale, visible)
  - debounce rapid updates (300ms trailing edge)
  - visibility-deferred refresh for background tabs
  - pause/resume with pending event capture

- ChartRenderer viewport extension
  - forwardRef + useImperativeHandle for ChartRendererHandle
  - captureViewport() reads Vega signals matching known prefixes
  - restoreViewport() writes signals back and re-runs dataflow
  - viewportConstants.ts with VIEWPORT_SIGNAL_PREFIXES

- useAutoRefresh React hook
  - register on mount, unregister on unmount
  - state/pause/resume/toggle operations
  - hasPendingUpdate computed property

- 29 tests passing (20 controller + 9 viewport)

https://claude.ai/code/session_01Hryx1Gtq4c5dk539KzVVNB
…extension

Phase 3-6: All four user stories implemented.

- ChartPanelWrapper integration:
  - useAutoRefresh hook binds active tab to controller
  - Pause/resume indicator button in tab header (next to close)
  - Pending update badge (blue dot) when paused with changes
  - Warning banner for error/unavailable states (FR-009, FR-010)
  - ChartRendererHandle ref passed for viewport capture/restore

- PanelContext extended:
  - ChartTabData.resultId for auto-refresh binding
  - autoRefreshController field in PanelContextValue

- VS Code extension wiring:
  - createAutoRefreshController called after registry creation
  - Controller disposed via context.subscriptions

- Hook test (10 tests):
  - Mount/unmount registration lifecycle
  - toggle/pause/resume operations
  - hasPendingUpdate reactive property

https://claude.ai/code/session_01Hryx1Gtq4c5dk539KzVVNB
Phase 7: Storybook stories and E2E test specs.

- AutoRefresh story: simulates data updates with viewport preservation
  - Refresh button triggers re-render, viewport info displayed
  - Interactive zoom-then-refresh demonstration

- PauseResume story: demonstrates toggle and pending badge
  - Pause/Resume button with visual state
  - Data change while paused shows pending badge
  - Resume flushes pending update

- Playwright E2E specs (ChartAutoRefresh.spec.ts):
  - Theme variant screenshots (light, dark, vscode)
  - Data update interaction test
  - Pause/resume with pending flush interaction test

https://claude.ai/code/session_01Hryx1Gtq4c5dk539KzVVNB
Evidence: test-summary.md (49 tests passing), usage-example.md,
e2e-summary.md (61 E2E tests passing), 7 theme-variant screenshots.
Media: shipped blog post and LinkedIn summary.

https://claude.ai/code/session_01Hryx1Gtq4c5dk539KzVVNB
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.

2 participants