Skip to content

PMM-14901: RTA details arrows respect filters#5397

Open
mattiasimonato wants to merge 22 commits into
v3from
PMM-14901-rta-details-arrows-respect-filters
Open

PMM-14901: RTA details arrows respect filters#5397
mattiasimonato wants to merge 22 commits into
v3from
PMM-14901-rta-details-arrows-respect-filters

Conversation

@mattiasimonato
Copy link
Copy Markdown
Contributor

@mattiasimonato mattiasimonato commented May 21, 2026

PMM-14901

Link to the Feature Build: SUBMODULES-4370

Fixes RTA overview details pane navigation so prev/next arrows move only through filtered table rows, not the full query list from the API.

  • OverviewTable syncs navigableQueries from Material React Table (after column/global filters, before pagination).
  • RealtimeOverview uses that list for arrow navigation and first/last button state.
  • Adds unit tests with a mocked table to ensure the next row is not taken from unfiltered API data.

@mattiasimonato mattiasimonato requested a review from a team as a code owner May 21, 2026 13:07
@mattiasimonato mattiasimonato requested review from fabio-silva and matejkubinec and removed request for a team May 21, 2026 13:07
@mattiasimonato mattiasimonato requested a review from Copilot May 21, 2026 13:08
Copy link
Copy Markdown
Contributor

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

Note

Copilot was unable to run its full agentic suite in this review.

Updates RTA overview details-pane navigation so prev/next arrows traverse only the rows currently visible after table filtering (rather than the full API result set).

Changes:

  • OverviewTable now exposes a filtered, pre-pagination navigableQueries list derived from the MRT row model.
  • RealtimeOverview uses navigableQueries for adjacent navigation and first/last button state.
  • Adds a unit test that mocks OverviewTable to verify navigation ignores API-only (filtered-out) rows.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
ui/apps/pmm/src/pages/rta/overview/table/OverviewTable.tsx Tracks table filter state and syncs a filtered/pre-pagination query list up to the parent for navigation.
ui/apps/pmm/src/pages/rta/overview/RealtimeOverview.tsx Switches details-pane navigation to use the filtered query list rather than raw API results.
ui/apps/pmm/src/pages/rta/overview/RealtimeOverview.navigation.test.tsx Adds tests ensuring next/prev navigation follows filtered rows, not the API’s full list.

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

Comment thread ui/apps/pmm/src/pages/rta/overview/table/OverviewTable.tsx Outdated
Comment thread ui/apps/pmm/src/pages/rta/overview/RealtimeOverview.tsx
Comment thread ui/apps/pmm/src/pages/rta/overview/RealtimeOverview.tsx
Comment thread ui/apps/pmm/src/pages/rta/overview/table/OverviewTable.tsx Outdated
Comment thread ui/apps/pmm/src/pages/rta/overview/table/OverviewTable.tsx Outdated
Comment thread ui/apps/pmm/src/pages/rta/overview/RealtimeOverview.tsx
@fabio-silva fabio-silva self-requested a review May 22, 2026 08:44
Comment thread ui/apps/pmm/src/pages/rta/overview/table/OverviewTable.utils.ts
Comment thread ui/apps/pmm/src/pages/rta/overview/table/OverviewTable.tsx Outdated
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread ui/apps/pmm/src/pages/rta/overview/table/OverviewTable.tsx Outdated
Copy link
Copy Markdown
Contributor

@matejkubinec matejkubinec left a comment

Choose a reason for hiding this comment

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

@mattiasimonato looks good outside of the one comment, one thing, do you think it would make sense to provide this functionality on the percona-ui level? (I've used a similar pattern on the alerts page POC, and it might be good to upstream it if the pattern will be used more often)

@pmcf-percona is the next/prev table item in a details pane a pattern that would be used on more parts of the application?

}
);
const [selectedQueryIndex, setSelectedQueryIndex] = useState<number>();
const tableQueries = queries ?? EMPTY_QUERIES;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
const tableQueries = queries ?? EMPTY_QUERIES;
const tableQueries: QueryData[] = queries ?? [];

Or is there other reason to declare EMPTY_QUERIES?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Likely, yes. So now it's in RTA and planned for Alerts. I see it potentially coming to Inventory as well, so this panel may be restricted to always consuming lists from MRT at Peak Design level

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@matejkubinec Yes, there’s a reason for EMPTY_QUERIES.

While queries is still undefined, queries ?? [] creates a new empty array on every render. That was making OverviewTable re-sync navigable rows over and over and caused a render loop (fixed in f84b62c). The module-level constant keeps the same empty array reference, so that doesn’t happen

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mattiasimonato looks good outside of the one comment, one thing, do you think it would make sense to provide this functionality on the percona-ui level? (I've used a similar pattern on the alerts page POC, and it might be good to upstream it if the pattern will be used more often)

@pmcf-percona is the next/prev table item in a details pane a pattern that would be used on more parts of the application?

@matejkubinec Yeah, I think it makes sense to upstream this if we’ll reuse it. I’d rather not block this PR on a percona-ui change though.

If you’re good with that, let’s add a follow-up ticket 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@matejkubinec Yes, there’s a reason for EMPTY_QUERIES.

While queries is still undefined, queries ?? [] creates a new empty array on every render. That was making OverviewTable re-sync navigable rows over and over and caused a render loop (fixed in f84b62c). The module-level constant keeps the same empty array reference, so that doesn’t happen

Yeah, I thought it would be something like that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@mattiasimonato looks good outside of the one comment, one thing, do you think it would make sense to provide this functionality on the percona-ui level? (I've used a similar pattern on the alerts page POC, and it might be good to upstream it if the pattern will be used more often)
@pmcf-percona is the next/prev table item in a details pane a pattern that would be used on more parts of the application?

@matejkubinec Yeah, I think it makes sense to upstream this if we’ll reuse it. I’d rather not block this PR on a percona-ui change though.

If you’re good with that, let’s add a follow-up ticket 👍

Yes, let's create a follow up.

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.

6 participants