Conversation
The filter state stayed set after the last override went away. A new override then turned the filter on again and hid other flags. Two effects now reset each filter when its condition is false. Add tests for both filters. Co-authored-by: Ramon Niebla <nieblara@users.noreply.github.com>
nieblara
marked this pull request as ready for review
October 6, 2026 03:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR re-lands #837 and fixes the UI bug that caused its revert in #850.
Commits
9197f92from fix: Add local flag overrides using dev server (#837) #850. This brings back the full change from feat: Add local flag overrides using dev server #837: local flag overrides, the "local" chip, the "Only show local flags" filter, and the greyed out overrides filter.The bug
#837 removed the
useEffectthat reset the filter state ininternal/dev_server/ui/src/Flags.tsx. The checkboxes showedonlyShowOverrides && overridesPresent, but the stored state never reset. Only "Remove all overrides" cleared it.Steps to see the bug:
The filter turned on again and hid other flags. "Only show local flags" had the same problem.
The fix
Two effects in
Flags.tsxreset each filter when it no longer applies:onlyShowOverridesresets when no overrides exist.onlyShowLocalresets when no local flags exist. The effect skips this reset whileflagsis not loaded yet.The effects watch the data, not one handler. They cover
removeOverride, "Remove all overrides", and any other change tooverrides, such as an update from outside the component.Tests
src/__tests__/Flags.test.tsxhas four new tests. They use a stateful wrapper and a mockedfetch.I ran the tests without the fix. All four new tests failed because the other flags were hidden. With the fix, all 13 tests pass.
What I ran
go build ./...: passed.go test ./internal/dev_server/...: passed.internal/dev_server/ui:npm ci,npm test -- --run(13 passed),npm run lint,npx tsc -b, andnpm run buildall passed.internal/dev_server/ui/dist/index.htmlis rebuilt and committed.I did not change anything outside this re-land and fix.