Skip to content

feat(greenfield): add Storybook and refresh test tooling - #405

Open
mira-2026 wants to merge 5 commits into
mira/greenfield-rewrite-phase-three-cache-browserfrom
mira/greenfield-rewrite-phase-three-metrics
Open

feat(greenfield): add Storybook and refresh test tooling#405
mira-2026 wants to merge 5 commits into
mira/greenfield-rewrite-phase-three-cache-browserfrom
mira/greenfield-rewrite-phase-three-metrics

Conversation

@mira-2026

@mira-2026 mira-2026 commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a production-isolated Storybook component workbench for the greenfield browser UI
  • cover shared primitives and implemented task, agent, jobs, cache, monitoring, notification, auth, and security states with 48 story files
  • pin the coordinated Storybook stack to 10.6.0-alpha.4, Vite to 8.2.1, and retain the qualified Effect refresh at 4.0.0-beta.106
  • add dark Canvas, Docs, and manager themes, AutoDocs, responsive/virtualized states, and one-worker Chromium interaction/accessibility tests
  • include the prerequisite three-worker Bun test runner and exact timing inventories so the expanded suite remains bounded

Boundaries and behavior

  • Vite and Storybook are development-only; Bun continues to own installation, application tests, production builds, and runtime
  • no root Vite configuration is introduced
  • production Tailwind discovery, TypeScript graphs, source boundaries, and browser release artifacts exclude story code
  • Storybook may import reviewed browser modules; production code cannot import stories or Storybook authority
  • reusable UI controls and the schedule disable-intent flow are exercised through real components instead of parallel story-only implementations
  • Effect 4.0.0-beta.106 remains the resolved runtime dependency; architecture references and release-manifest fixtures now match that reviewed pin

Behavior and regression coverage

  • interaction stories cover pointer and keyboard paths, controlled args, modals, schedule transitions, responsive cards, and virtualized inventories
  • the TimePicker interaction now waits for the Headless UI exit transition to unmount before the automatic axe scan, removing CI-speed timing nondeterminism without changing production Select behavior
  • timing inventories fail closed on missing or stale files, while worker counts remain capped at three for Bun suites and one for Chromium

Verification

  • Exact-head Storybook: 48 story files and 166 one-worker Chromium interaction/accessibility tests
  • TimePicker Storybook interaction: 3 consecutive focused CI-mode passes
  • Effect release-manifest fixtures: 10 focused tests across web, worker, and frontend assets
  • Storybook TypeScript and typed lint, generated-doc check, formatting, and diff checks
  • Resolved installed Effect version and upstream tag: 4.0.0-beta.106
  • Full pre-fix gate at ea39d162: 1,580 Bun tests, 278 browser tests, 91.16% coverage, type/lint/format/boundaries/docs/database/audit, and clean-source build:release
  • Exact-head hosted checks — rerunning on 6eb53d8c

Risk checklist

  • No secrets, tokens, .env files, database dumps, or runtime state committed
  • No production API, schema, authentication, or deployment behavior changes
  • Storybook prerelease use was explicitly approved for the required upstream fixes
  • Storybook and Vite cannot enter production source or release artifacts
  • Test concurrency remains capped at three; Storybook Chromium execution remains one worker

Deployment / operations

  • No deploy or restart needed
  • Rollback is the previous stack head e3b390e7

Notes for reviewers

Review production/source isolation, Storybook interaction teardown, real-component state coverage, fail-closed test-runner inventories, and the intentional Effect 4.0.0-beta.106 audit alignment. Update the coordinated Storybook package set together when stable 10.6 is available.

@mira-2026
mira-2026 requested a review from rajohan as a code owner August 8, 2026 23:54
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Testing & Quality

    • Improved test-suite execution with parallel workers, browser coverage support, failure handling, and test-timing optimization.
    • Added automatic cleanup of outdated timing records and strengthened test fixture isolation for more reliable results.
    • Updated coverage validation and agent route checks, including notification controls.
  • Documentation

    • Added guidance on test isolation, worker limits, timing files, and refreshing test inventories.

Walkthrough

The PR replaces browser test sharding with two-partition coverage execution, adds timing inventory validation and pruning, reuses delivery-test fixtures at suite scope, updates test scripts and dependencies, and strengthens agent route readiness assertions.

Changes

Test execution and timing management

Layer / File(s) Summary
Timing inventories and test runner
greenfield/.bun*-test-timings.json, greenfield/scripts/runTestSuite.*, greenfield/package.json, greenfield/docs/development/testing-and-prs.md
Adds versioned timing inventories, parallel test commands, timing updates, validation, pruning, and atomic inventory replacement.
Two-partition coverage orchestration
greenfield/scripts/runCoverage.*, greenfield/package.json
Runs Bun and browser coverage partitions with timing data, browser preload settings, and updated failure handling. Removes browser inventory discovery and sharding logic.
Suite-level delivery fixtures
greenfield/scripts/delivery/*Production*.test.ts
Initializes shared release fixtures once per suite and cleans them after completion.
Agent route readiness assertions
greenfield/src/browser/agents/AgentsRoute.test.tsx
Mocks empty notifications and checks the agent heading and notification button before route assertions.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested labels: area: ci, type: performance, type: dependencies, type: maintenance

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description follows the repository template, but it mainly describes Storybook changes that are not present in the changeset. Rewrite the description to document the test-runner changes, timing inventories, dependency refresh, fixture reuse, and removed browser sharding.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title mentions a real test-tooling refresh, but the Storybook change is not present in the summarized changes.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@mira-2026 mira-2026 changed the title mira/greenfield rewrite phase three metrics test(greenfield): parallelize rewrite verification Aug 8, 2026
@mira-2026 mira-2026 added status: needs-review Ready for human or agent review type: performance Performance, resource usage, or responsiveness work type: tests Adds or updates automated tests/coverage type: dependencies Dependency updates and lockfile maintenance type: documentation Documentation, README, comments, and operational notes area: ci CI, test runners, workflow checks, and release gates labels Aug 8, 2026

@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

🤖 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 `@greenfield/package.json`:
- Line 60: Restore the Effect dependency to version 4.0.0-beta.104 in
greenfield/package.json and update greenfield/bun.lock accordingly, preserving
the version expected by the greenfield documentation and tests.
🪄 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: 7ec14d96-2fee-46dd-baa2-930947178638

📥 Commits

Reviewing files that changed from the base of the PR and between e3b390e and e0e3751.

⛔ Files ignored due to path filters (2)
  • greenfield/bun.lock is excluded by !**/*.lock and included by **/*
  • greenfield/docs/generated/packages-and-runtime.md is excluded by !**/generated/** and included by **/*
📒 Files selected for processing (15)
  • greenfield/.bun-browser-test-timings.json
  • greenfield/.bun-test-timings.json
  • greenfield/docs/development/testing-and-prs.md
  • greenfield/package.json
  • greenfield/scripts/delivery/installProductionSystemdUnits.test.ts
  • greenfield/scripts/delivery/productionReleaseActivation.test.ts
  • greenfield/scripts/delivery/productionReleasePublication.test.ts
  • greenfield/scripts/delivery/systemdProductionServices.test.ts
  • greenfield/scripts/runBrowserTests.test.ts
  • greenfield/scripts/runBrowserTests.ts
  • greenfield/scripts/runCoverage.test.ts
  • greenfield/scripts/runCoverage.ts
  • greenfield/scripts/runTestSuite.test.ts
  • greenfield/scripts/runTestSuite.ts
  • greenfield/src/browser/agents/AgentsRoute.test.tsx
💤 Files with no reviewable changes (2)
  • greenfield/scripts/runBrowserTests.ts
  • greenfield/scripts/runBrowserTests.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: backend-checks
  • GitHub Check: frontend-checks
  • GitHub Check: dashboard-checks
  • GitHub Check: Analyze JavaScript and TypeScript
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-08-07T17:05:36.638Z
Learnt from: mira-2026
Repo: rajohan/Mira-Dashboard PR: 397
File: greenfield/src/server/domains/agents/service.test.ts:225-239
Timestamp: 2026-08-07T17:05:36.638Z
Learning: In Bun test files, write rejection assertions as `expect(promise).rejects...` without `await`. The repository's installed matcher types return `void`, and ESLint's `typescript(await-thenable)` rule rejects awaiting these matcher assertions.

Applied to files:

  • greenfield/scripts/runTestSuite.test.ts
  • greenfield/scripts/delivery/systemdProductionServices.test.ts
  • greenfield/scripts/runCoverage.test.ts
  • greenfield/scripts/delivery/installProductionSystemdUnits.test.ts
  • greenfield/scripts/delivery/productionReleaseActivation.test.ts
  • greenfield/scripts/delivery/productionReleasePublication.test.ts
📚 Learning: 2026-08-07T18:47:49.639Z
Learnt from: mira-2026
Repo: rajohan/Mira-Dashboard PR: 398
File: greenfield/src/server/domains/monitoring/catalogErrors.ts:3-3
Timestamp: 2026-08-07T18:47:49.639Z
Learning: In the greenfield TypeScript application, use the pinned Effect version 4.0.0-beta.104 API. Preserve `Schema.Literals` for readonly literal tuples and arrays, and do not replace it with variadic `Schema.Literal(...)` unless the replacement has been validated against the pinned Effect version.

Applied to files:

  • greenfield/scripts/runTestSuite.test.ts
  • greenfield/scripts/delivery/systemdProductionServices.test.ts
  • greenfield/scripts/runCoverage.test.ts
  • greenfield/scripts/runTestSuite.ts
  • greenfield/scripts/delivery/installProductionSystemdUnits.test.ts
  • greenfield/scripts/runCoverage.ts
  • greenfield/scripts/delivery/productionReleaseActivation.test.ts
  • greenfield/scripts/delivery/productionReleasePublication.test.ts
🔇 Additional comments (13)
greenfield/src/browser/agents/AgentsRoute.test.tsx (1)

114-120: LGTM!

Also applies to: 174-180, 216-216, 256-256, 284-284, 312-312, 346-346

greenfield/.bun-browser-test-timings.json (1)

1-67: LGTM!

greenfield/.bun-test-timings.json (1)

1-277: LGTM!

greenfield/docs/development/testing-and-prs.md (1)

26-36: LGTM!

greenfield/scripts/runTestSuite.ts (1)

2-34: LGTM!

Also applies to: 36-102, 161-163

greenfield/scripts/runTestSuite.test.ts (1)

6-7: LGTM!

Also applies to: 46-71

greenfield/package.json (1)

26-31: LGTM!

Also applies to: 50-52, 62-62, 81-81, 91-91, 101-108

greenfield/scripts/runCoverage.ts (1)

16-22: LGTM!

Also applies to: 57-71, 80-115, 174-180

greenfield/scripts/runCoverage.test.ts (1)

12-16: LGTM!

Also applies to: 32-49, 94-94, 106-132

greenfield/scripts/delivery/installProductionSystemdUnits.test.ts (1)

1-1: LGTM!

Also applies to: 38-65, 79-79

greenfield/scripts/delivery/productionReleaseActivation.test.ts (1)

2-10: LGTM!

Also applies to: 63-98, 187-187, 263-263, 325-325, 390-390, 449-449, 521-521, 643-643

greenfield/scripts/delivery/productionReleasePublication.test.ts (1)

1-1: LGTM!

Also applies to: 36-37, 54-83, 170-170, 207-207, 235-235

greenfield/scripts/delivery/systemdProductionServices.test.ts (1)

1-1: LGTM!

Also applies to: 29-64, 83-83, 224-224

Comment thread greenfield/package.json
@mira-2026 mira-2026 changed the title test(greenfield): parallelize rewrite verification feat(greenfield): add Storybook component workbench Aug 9, 2026
@mira-2026 mira-2026 added type: feature Adds user-visible functionality area: frontend Frontend UI, client state, routing, and browser behavior labels Aug 9, 2026
@mira-2026 mira-2026 changed the title feat(greenfield): add Storybook component workbench feat(greenfield): add Storybook and refresh test tooling Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI, test runners, workflow checks, and release gates area: frontend Frontend UI, client state, routing, and browser behavior status: needs-review Ready for human or agent review type: dependencies Dependency updates and lockfile maintenance type: documentation Documentation, README, comments, and operational notes type: feature Adds user-visible functionality type: performance Performance, resource usage, or responsiveness work type: tests Adds or updates automated tests/coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant