kafka-ui
kafka-ui copied to clipboard
FE: Hide internal topics by default (closes #1073)
- [ ] Breaking change?
No. Defaults only apply when the URL lacks
hideInternaland no prior preference exists inlocalStorage. Existing explicit URL values and saved preferences continue to work as before.
What changes did you make? (Give an overview)
- Frontend (Topics →
ListPage.tsx): When the URL has nohideInternalparam, derive the value fromlocalStorage('hideInternalTopics'), defaulting totrueif missing. - Respect explicit URL values (
?hideInternal=true/false). - Parse the stored value as a real boolean (
'true'/'false') instead of truthy/falsy. - Avoid mutating the existing
URLSearchParamsinstance (create a new one before callingsetSearchParams).
Closes #1073.
Is there anything you'd like reviewers to focus on?
- URL precedence over localStorage (explicit URL should win).
- Whether we should persist the default (
'true') back tolocalStorageon first run (current change does, for consistency across sessions). - Any preference on naming/placement if you’d like this logic factored into a small helper.
How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)
-
[ ] No need to
-
[x] Manually (IST):
- Clear
localStorage; open Topics →?hideInternal=truegets appended. - Toggle to show internal; reload persists as expected.
- Visit with
?hideInternal=falsein URL; list shows internals; reload preserves via URL/localStorage.
- Clear
-
[ ] Unit checks
-
[ ] Integration checks
-
[ ] Covered by existing automation
Checklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation (e.g. ENVIRONMENT VARIABLES) — note: UI behavior now defaults to hiding internal topics; added a short note to docs if required
- [ ] My changes generate no new warnings (e.g. Sonar is happy)
- [ ] I have added tests that prove my fix is effective or that my feature works (if applicable)
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged
Check out Contributing and Code of Conduct
A picture of a cute animal (not mandatory but encouraged)