Skip to content

feat(ui): scope filter dropdowns to the current selection#97

Open
luohua13 wants to merge 1 commit into
Project-HAMi:mainfrom
luohua13:feat/cascade-filter-dropdowns
Open

feat(ui): scope filter dropdowns to the current selection#97
luohua13 wants to merge 1 commit into
Project-HAMi:mainfrom
luohua13:feat/cascade-filter-dropdowns

Conversation

@luohua13
Copy link
Copy Markdown

The compute-management and workload list pages let you filter by overlapping dimensions (card type, node, card). Previously each dropdown listed every value in the cluster, so it was easy to pick combinations that can never match — e.g. a node that has none of the selected card type, or a card that isn't on the selected node — leaving the user with an empty table and no hint why.

This adds one-way cascading so a dependent dropdown only offers values that are reachable given the current selection:

Compute-management page (card/admin):

  • The node dropdown now lists only nodes that actually carry the selected card type. When the type changes (via the select, the pie chart, or a ?type= route query) a previously chosen node that no longer matches is cleared, so the table is never filtered by an out-of-scope node. The prune runs synchronously before each refresh to avoid querying with a stale node.

Workload list page (task/admin):

  • Adds a card filter dropdown (the backend GetAllContainers already supports the device_id filter). The dropdown lists only the cards on the selected node, and switching node clears a chosen card that doesn't belong to it.

Both cascades reuse the node/card list data already fetched for the filters (the node "type" array and the card "nodeName" field), so no extra API calls are introduced.

The compute-management and workload list pages let you filter by overlapping
dimensions (card type, node, card). Previously each dropdown listed every value
in the cluster, so it was easy to pick combinations that can never match — e.g.
a node that has none of the selected card type, or a card that isn't on the
selected node — leaving the user with an empty table and no hint why.

This adds one-way cascading so a dependent dropdown only offers values that are
reachable given the current selection:

Compute-management page (card/admin):
  * The node dropdown now lists only nodes that actually carry the selected card
    type. When the type changes (via the select, the pie chart, or a ?type=
    route query) a previously chosen node that no longer matches is cleared, so
    the table is never filtered by an out-of-scope node. The prune runs
    synchronously before each refresh to avoid querying with a stale node.

Workload list page (task/admin):
  * Adds a card filter dropdown (the backend GetAllContainers already supports
    the device_id filter). The dropdown lists only the cards on the selected
    node, and switching node clears a chosen card that doesn't belong to it.

Both cascades reuse the node/card list data already fetched for the filters
(the node "type" array and the card "nodeName" field), so no extra API calls
are introduced.

Signed-off-by: luohua13 <jcwang@alauda.io>
@hami-robot
Copy link
Copy Markdown

hami-robot Bot commented May 21, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: luohua13

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hami-robot hami-robot Bot added the size/M label May 21, 2026
@Shenhan11
Copy link
Copy Markdown
Contributor

/lgtm

@hami-robot
Copy link
Copy Markdown

hami-robot Bot commented May 26, 2026

@Shenhan11: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants