Frun1na opened a new pull request, #4594:
URL: https://github.com/apache/rocketmq-dashboard/pull/4594

   ### Which Issue(s) This PR Fixes
   
   
   ### Brief Description
   
   The consumer page already remounts its content by the selected instance 
(#1707) so filters and per-item caches reset cleanly. The topic page had no 
such boundary: switching instances kept the previous instance's search text, 
type filter and table page, and `routesByTopic` / `consumersByTopic` are keyed 
by topic name only and never cleared, so a topic with the same name in another 
instance showed the previous instance's routes and consumer data.
   
   This PR splits `TopicPage` into a wrapper and a `TopicPageContent` keyed by 
the selected instance, mirroring the consumer page, so all page state resets 
when the instance changes.
   
   ### How Did You Test This Change?
   
   New regression test `resets the search text when the selected instance 
changes` (fails on master, passes with this PR):
   
   ```
   $ cd web && npx vitest run src/pages/instance/__tests__/TopicPage.test.tsx
   
    Test Files  1 passed (1)
         Tests  27 passed (27)
   ```
   
   ```
   $ cd web && npm run lint
   
   ✖ 10 problems (0 errors, 10 warnings)
   ```
   
   All 10 lint warnings are pre-existing and in files this PR does not touch.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / 
`refactor:` / `chore:` / `docs:` / `perf:`)
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` 
(no new UI text in this PR)
   - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks) (frontend-only change)
   - [x] New source files carry the ASF license header (no new source files)
   - [x] Documentation touched where behaviour changed (README / `docs/` / 
in-app help) (no behaviour that docs cover)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to