kafka-ui icon indicating copy to clipboard operation
kafka-ui copied to clipboard

FE: Hide internal topics by default (closes #1073)

Open Devansh-ops opened this issue 1 month ago • 0 comments

  • [ ] Breaking change? No. Defaults only apply when the URL lacks hideInternal and no prior preference exists in localStorage. 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 no hideInternal param, derive the value from localStorage('hideInternalTopics'), defaulting to true if 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 URLSearchParams instance (create a new one before calling setSearchParams).

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 to localStorage on 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=true gets appended.
    • Toggle to show internal; reload persists as expected.
    • Visit with ?hideInternal=false in URL; list shows internals; reload preserves via URL/localStorage.
  • [ ] 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) cute-bush-baby

Devansh-ops avatar Oct 08 '25 23:10 Devansh-ops