Skip to content

feat(core): add new entry to Plugin type for centralised query param handling#1967

Open
tadayosi wants to merge 1 commit intohawtio:mainfrom
tadayosi:issue-903-adjust-nid-2
Open

feat(core): add new entry to Plugin type for centralised query param handling#1967
tadayosi wants to merge 1 commit intohawtio:mainfrom
tadayosi:issue-903-adjust-nid-2

Conversation

@tadayosi
Copy link
Copy Markdown
Member

Fix #903

With this enhancement, the new param nid is only effective within JMX plugin. It should be fine for now. We can later extend the feature to other selected node-based plugins such as Camel and Quartz under separate issues.

@tadayosi
Copy link
Copy Markdown
Member Author

@grgrzybek Please review it

@tadayosi tadayosi force-pushed the issue-903-adjust-nid-2 branch from 5afead2 to 48a6988 Compare February 25, 2026 10:37
@tadayosi
Copy link
Copy Markdown
Member Author

cc @pseudaverse

Copy link
Copy Markdown
Collaborator

@grgrzybek grgrzybek left a comment

Choose a reason for hiding this comment

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

Actually only questions and comments.
Looks great - should be a good base for future extensions.

Comment thread packages/hawtio/src/core/hooks.ts
Comment thread packages/hawtio/src/ui/page/globals.ts
Comment thread packages/hawtio/src/ui/page/HawtioPage.tsx
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 25, 2026

Test Results

2 files  ± 0  2 suites  ±0   2m 34s ⏱️ - 6m 52s
4 tests  - 82  1 ✅  - 83  0 💤  - 2  3 ❌ +3 
6 runs   - 82  1 ✅  - 84  0 💤  - 3  5 ❌ +5 

For more details on these failures, see this check.

Results for commit 000a7d2. ± Comparison against base commit cf906b6.

This pull request removes 82 tests.
Account Lockout (Throttling) ‑ User account gets locked out after multiple failed login attempts
Check whether all data is presented and displayed correctly in About modal window. ‑ Check that the titles are presented in About modal window - Names of Hawtio's Components - #1.1
Check whether all data is presented and displayed correctly in About modal window. ‑ Check that the titles are presented in About modal window - Names of Hawtio's Components - #1.2
Checking the functionality of Camel Endpoints page. ‑ Check that Endpoints table on Camel Endpoints page is not empty - Columns - #1.1
Checking the functionality of Camel Endpoints page. ‑ Check that Endpoints table on Camel Endpoints page is not empty - Columns - #1.2
Checking the functionality of Camel Endpoints page. ‑ Check to add an Endpoint from Data
Checking the functionality of Camel Endpoints page. ‑ Check to add an Endpoint from URI
Checking the functionality of Camel Routes page. ‑ Check route groups - Groups - #1.1
Checking the functionality of Camel Routes page. ‑ Check route groups - Groups - #1.2
Checking the functionality of Camel Routes page. ‑ Check route groups - Groups - #1.3
…

♻️ This comment has been updated with latest results.

@hawtio-ci
Copy link
Copy Markdown

hawtio-ci Bot commented Feb 25, 2026

Test results

Run attempt: 5557
Detailed summary

NAME TESTS PASSED ✅ SKIPPED 💤 FAILED ❌ ERRORS 🚫 TIME 🕖
test-results-quarkus-node(22)-java(17)-firefox 4 1 0 3 0 91.856
test-results-springboot-node(22)-java(17)-firefox 2 0 0 2 0 62.988

@pseudaverse
Copy link
Copy Markdown
Contributor

The one small problem imo: when you click back to jmx plugin, tree is rendered with some selected node but nid is missing.
Probably for separate issue.

@tadayosi tadayosi force-pushed the issue-903-adjust-nid-2 branch from 48a6988 to 7017534 Compare February 26, 2026 04:22
@tadayosi
Copy link
Copy Markdown
Member Author

@pseudaverse I'd say it's an expected behaviour. There is no guarantee that the node selection is preserved between plugins. Plugins may use a specific part of the MBean tree for different purposes, and for some plugins the nid may be totally meaningless. If we expand the support for nid to other plugins, the seleciton will be preserved between those plugins and JMX.

@tadayosi tadayosi force-pushed the issue-903-adjust-nid-2 branch from 3d3460a to 000a7d2 Compare March 23, 2026 06:02
Comment thread packages/hawtio/src/ui/page/HawtioPage.tsx
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces centralized URL query-parameter filtering at the main Hawtio page level so that only recognized/common parameters (and plugin-specific ones) remain in the URL during routing, aiming to prevent navigation issues caused by “stale”/irrelevant query params.

Changes:

  • Added a useEffect in HawtioPage to strip unknown query parameters before rendering a plugin view.
  • Updated plugin route generation to reuse a created element for the parent route and its * child route.
  • Introduced a shared list of common, globally-allowed query params via KNOWN_COMMON_QUERY_PARAMS.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +52 to +54
const knownParams = new Set([...KNOWN_COMMON_QUERY_PARAMS, ...(plugin.knownQueryParams ?? [])])
searchParams.forEach((_, key) => !knownParams.has(key) && searchParams.delete(key))
setSearchParams(searchParams)
Copy link
Copy Markdown
Collaborator

@grgrzybek grgrzybek May 1, 2026

Choose a reason for hiding this comment

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

this still triggers a navigation/update and can cause a re-render loop

setSearchParams() is a state update call and when there's no change, there's no re-render...
but I'd have to see under debugger.

return
}

const plugin = plugins.find(p => p.path && pathname.startsWith(p.path))
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.

Navigation doesn't work properly in the plugins involves Tree

5 participants