Skip to content

chore: remove the feature-preview one-time carry-up - #32359

Merged
bolichen97 merged 1 commit into
mainfrom
fix/24963-drop-preview-carry-up
Nov 7, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/24963-drop-preview-carry-up

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Each Feature previews switch takes its value from the gateway alone, now that a stable release has shipped the move of those switches to the gateway.

#22913 moved the Settings > Developer > Feature previews switches into gateway config (dashboard.feature_previews.<name>), with localStorage as a cache. To keep a switch someone had turned on before that change, it added a one-time migration: a browser-only ON is carried up with if_unset, a kc-feature-previews-synced marker and a per-switch kc-feature-previews-server-backed record decide whether a cache-only ON is a value the gateway dropped, and two notices report a refused carry. v0.12.0, the first stable release with #22913, is out, so the migration has done its job.

Why it matters

The migration is most of usePreviewFlagServerSync.ts: two extra browser keys, carry counters and two notice strings in every catalog, all to answer "is this ON from before the gateway kept it?". While it stays, the gateway is not the only source of truth: a stale browser ON can still be written back to the gateway, and every later change to the sync has to reason about the unsynced case.

Not a goal

  • Changing the backend if_unset support on the config PATCH: the sidebar session sort still uses it.
  • Retiring the old "Remote crew sessions" key (mc-preview-instance-sessions) and its useRemoteCrewChat fallback; this PR only stops carrying it up.
  • Changing how a toggle is written, ordered, or put back when refused.

What changed (motivation → approach → change)

Before After
A switch on only in this browser is carried up to the gateway once with if_unset It reads as off, like any switch the gateway holds no value for
kc-feature-previews-synced and kc-feature-previews-server-backed decide whether a cache-only ON was dropped Both keys are removed from localStorage when the sync mounts, and nothing reads them
A refused carry shows "on in this browser only" or "turned on before it could be saved" Those two notices are gone, and their strings with them from every catalog under website/src/i18n; the refused-toggle notices are unchanged
The retired "Remote crew sessions" key is carried up as "Chat on a crew" It is cleared when the sync mounts, so it cannot keep that feature on behind a switch reading off

reconcilePreviewFlags is now one rule: each switch takes the gateway's value, off when the gateway holds none, unless a toggle of that switch is still in flight. A config read that fails still leaves the cache alone. The comments in utils/previewFlags.ts and the Preview-gated surfaces paragraph of learn-cron-dashboard.md say the same.

Backwards compatibility

Breaking: a Feature previews switch that is on only in a browser that has not opened the dashboard since before #22913 now reads as off instead of being saved to the gateway; turning it on again in Settings > Developer > Feature previews saves it. Writer sweep on origin/main @ bab2387: the only writers of kc-feature-previews-synced and kc-feature-previews-server-backed were markSynced and markServerBacked in website/src/hooks/usePreviewFlagServerSync.ts, both removed; the only writer of PreviewFlagWriteError.carry was the carry path of persist in the same file, removed; git grep finds no other writer in website/src, src/kiro_crew or the app bundles.

Reader: website/src/pages/settings/FeaturePreviewsSection.tsx:FeaturePreviewsSection -- chat -- featurePreviewsSectionNotice.test.tsx (the refused-toggle notices still name the switch)
Reader: website/src/hooks/usePreviewFlag.ts:useRemoteCrewChat -- chat -- previewFlagServerSync.test.tsx "clears the retired Remote crew sessions key on load, even when the config cannot be read"
Reader: website/src/shell/appShell.tsx:usePreviewFlagServerSync -- chat -- previewFlagServerSync.test.tsx (the hook's signature is unchanged)

Tests

  • previewFlagServerSync.test.tsx drops the carry-up cases and keeps reconcile, in-flight protection and refused-toggle revert. New: a switch on only in this browser reads as off with no write, and both retired keys are cleared on load. The retired-key test now pins that the key is cleared on load with no write, even when the config read fails. These and the toggle test (no third PATCH argument) fail against the old hook.
  • featurePreviewsSectionNotice.test.tsx drops the two carry-notice cases and no longer seeds the synced marker.
  • Ran locally: 59 related frontend test files (1,332 tests, including the i18n parity, dead-key and pseudolocale suites), the 17 related backend test files, tsc -p tsconfig.app.json, eslint, i18n:check, i18n:pseudo (no diff), semgrep, docs-lint.

Manual verification

N/A — unit coverage sufficient: the change removes a migration path, and the tests drive the sync hook and the section through the same query client and storage the app shell uses.

Screenshots / video

Why no screenshot: the only rendered change is that the two refused-carry notices can no longer appear; every state that still renders is unchanged.

Related Issues

Closes #24963

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 7, 2026 13:38
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 38f63cf36255b7c075131f9b2700a99bdb05ac2c — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing to check: the diff only deletes two notices about saving a switch to the gateway and adds or changes no control, so no screenshot is needed.

Notes

  • A preview switch that was on only in an old browser now shows as off, with no message. That's fine because it's rare and fixed by turning it back on in Settings > Developer > Feature previews.

[UX-REVIEWED] 38f63cf

Description read

[DESCRIPTION-READ] 6db093c707bae556c4631ae2548c03ec4881a1e83a1e128346aeabda3d2510c2

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 38f63cf36255b7c075131f9b2700a99bdb05ac2c — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: it removes a migration whose stable release has shipped. The one break, a browser-only ON that was never synced now reading as off, is listed and accepted, and a user can undo it by turning the switch back on.

Notes

  • The removed exports (PREVIEW_FLAGS_SYNCED_KEY, PREVIEW_FLAGS_SERVER_BACKED_KEY, PreviewFlagWriteError.carry) and the narrower reconcilePreviewFlags signature have no readers outside the patch in website/src or src/kiro_crew.
  • The mount-time cleanup of RETIRED_SYNC_KEYS is itself a small migration that will be dead code later. Consider giving it a removal issue so it doesn't end up living forever like the code it replaces.

[DESIGN-REVIEWED] 38f63cf

Description read

[DESCRIPTION-READ] 0b18f3b41974bf8b4e3a24920cf2ef230e86d8de0008947963acbf0e4025e0ca

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 38f63cf36255b7c075131f9b2700a99bdb05ac2c — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: the change deletes a one-time migration whose release has shipped (#24963). The one addition, clearing two dead localStorage keys on mount, protects against nothing.

Notes

  • Item 3 — rides along: the hunk for (const key of RETIRED_SYNC_KEYS) safeRemoveItem(key) clears kc-feature-previews-synced and kc-feature-previews-server-backed, which "nothing reads". Leaving them costs nobody anything. Subtraction: delete RETIRED_SYNC_KEYS, its loop in the mount effect, and the test "clears the keys the one-time carry-up kept".

What this change ships

Inventory (6 items) — 5 justified

Intent: let each Feature previews switch take its value from the gateway alone, now that the migration has done its job. This is a removal (ADDITION-free chore), not a FIX.

  1. A switch that is on only in this browser now reads as off instead of being carried up to the gateway — justified
  2. The two refused-carry notices and their strings are gone from every locale — justified
  3. Two retired sync keys are wiped from localStorage when the dashboard loads — rides along: removes no harm
  4. The retired "Remote crew sessions" key is now cleared on load instead of being carried up as "Chat on a crew" — justified
  5. reconcilePreviewFlags no longer takes a query client, and persist returns nothing — justified
  6. The Preview-gated surfaces spec paragraph and the previewFlags.ts comments now describe one rule — justified

[FIRST-PRINCIPLES-REVIEWED] 38f63cf

Description read

[DESCRIPTION-READ] 02d191b789f3f9c6a306b1afdf6c1b4eb849a378b21a6892f94ccf0a1fd772f1

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 38f63cf36255b7c075131f9b2700a99bdb05ac2c — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 38f63cf

Verdict parsed from the review's SHA-scoped output markers for commit 38f63cf36255b7c075131f9b2700a99bdb05ac2c.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 38f63cf36255b7c075131f9b2700a99bdb05ac2c false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 38f63cf36255b7c075131f9b2700a99bdb05ac2c and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 38f63cf

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 38f63cf36255b7c075131f9b2700a99bdb05ac2c false-positive: <reason, 20 to 500 characters>

@bolichen97
bolichen97 enabled auto-merge (squash) November 7, 2026 13:44
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/24963-drop-preview-carry-up branch from 73d1902 to a2b453d Compare November 7, 2026 16:09
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules/learn-cron-dashboard.md, website/src/pages/settings/FeaturePreviewsSection.tsx and the website/src/i18n/locales/*.json files since this head went green (f58c3cf -> e356cc6); CI re-running.

The rebase was clean and the patch is unchanged. The 47 frontend test files that cover the preview flags and Feature Previews section pass on the new base (1079 tests), and i18n:check, lint:i18n, eslint and the app typecheck pass too.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision labels Nov 7, 2026
v0.12.0 shipped #22913, which keeps the Settings > Developer > Feature
previews switches on the gateway. Its migration for browsers that set a
switch before then (an if_unset carry-up of a browser-only ON, the
kc-feature-previews-synced marker and the per-switch server-backed
record) is no longer needed, so the gateway value is now the only
source of truth and localStorage a pure cache: a switch the gateway
holds no value for reads as off, and the two retired keys are cleared
when the sync mounts.

The carry-refused notices and their strings go with it in every
catalog. Reconcile, in-flight protection and refused-toggle revert are
unchanged.
@bolichen97
bolichen97 force-pushed the fix/24963-drop-preview-carry-up branch from a2b453d to 38f63cf Compare November 7, 2026 19:03
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules/learn-cron-dashboard.md and the website/src/i18n/locales/*.json files since this head went green (e356cc6 -> 21597a3); CI re-running.

The rebase was clean and the patch is unchanged. The previous head's red checks were all GitHub API rate-limit failures inside CI (no review finding, no test failure), so this run replaces them. The 48 frontend test files that cover the preview flags and the Feature Previews section pass on the new base (1102 tests), and i18n:check, lint:i18n, eslint and the app typecheck pass too.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 7, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved: PR Readiness passed on 38f63cf, and all five review lanes (Opus 5.5, GPT 6.1, Design, UX, First Principles) report no blocking finding on this head. No conflict and no open change request.

@bolichen97
bolichen97 merged commit a0d9a5a into main Nov 7, 2026
99 checks passed
@bolichen97
bolichen97 deleted the fix/24963-drop-preview-carry-up branch November 7, 2026 20:23
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Nov 7, 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.

chore(dashboard): remove the feature-preview one-time carry-up and synced marker

2 participants