Skip to content

Use React data-view for Kafka clusters table#2539

Open
MikeEdgar wants to merge 2 commits into
streamshub:mainfrom
MikeEdgar:data-view-research
Open

Use React data-view for Kafka clusters table#2539
MikeEdgar wants to merge 2 commits into
streamshub:mainfrom
MikeEdgar:data-view-research

Conversation

@MikeEdgar
Copy link
Copy Markdown
Member

@MikeEdgar MikeEdgar commented Apr 30, 2026

For #2501

Subsequent changes will be coming to migrate all tables to use the new component.

@MikeEdgar MikeEdgar force-pushed the data-view-research branch 6 times, most recently from 817819b to cc7e9d4 Compare May 7, 2026 14:40
@MikeEdgar MikeEdgar added this to the 0.13.0 milestone May 7, 2026
@MikeEdgar MikeEdgar force-pushed the data-view-research branch 3 times, most recently from c66f136 to 5f2c265 Compare May 11, 2026 12:19
@MikeEdgar MikeEdgar changed the title Experiment with React data-view for Kafka clusters table Use React data-view for Kafka clusters table May 11, 2026
@MikeEdgar MikeEdgar force-pushed the data-view-research branch 2 times, most recently from 8dee1e9 to 536444a Compare May 12, 2026 18:46
@MikeEdgar MikeEdgar marked this pull request as ready for review May 12, 2026 18:48
@MikeEdgar MikeEdgar force-pushed the data-view-research branch from 536444a to 50489c3 Compare May 13, 2026 11:26
@MikeEdgar MikeEdgar force-pushed the data-view-research branch from 50489c3 to d09b70b Compare May 15, 2026 12:38
Copy link
Copy Markdown
Contributor

@alexcreasy alexcreasy left a comment

Choose a reason for hiding this comment

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

Overall it's a really nice improvement, there's a couple of points I've raised - the one about ignoring the api error response is only potentially serious issue. The rest are just generally some small changes to promote best practice.

Comment thread api/src/main/webui/src/api/client.ts
Comment thread api/src/main/webui/src/api/types.ts Outdated
Comment thread api/src/main/webui/src/api/types.ts
* synthetic URLSearchParams that includes the current page number.
* Uses local state to avoid flashing during navigation.
*/
const paginationSearchParams = useMemo(() => {
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.

Just wondering why you have 2 memos that manipulate URL params and whether it might make sense condense them into 1 to avoid any potential strange issues or race conditions? (

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I was seeing some race conditions using a single memo to manipulate the params for both useDataViewSort and useDataViewPagination. I couldn't really narrow down to why or where it was happening, but I am definitely open to doing this with less code/functions if we can.

}, [onSetFilters]);

// Custom hook for text filter handlers
const useTextFilterHandlers = (filterId: string) => {
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.

This needs to be defined elsewhere, it's a strong convention in React that hooks need to be declared at the top level. You could move it outside the component declaration in this file, or move it to its own file.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I moved this hook at the top level outside of the component. Is it mainly just a convention or are there technical reasons for doing so? I'm all for sticking to conventions, just curious.

Comment thread api/src/main/webui/src/components/common/ResourceListDataView.tsx Outdated
MikeEdgar added 2 commits May 20, 2026 13:02
Signed-off-by: Michael Edgar <medgar@redhat.com>
Signed-off-by: Michael Edgar <medgar@redhat.com>
@MikeEdgar MikeEdgar force-pushed the data-view-research branch from d09b70b to 3be1148 Compare May 20, 2026 17:04
@MikeEdgar MikeEdgar requested a review from alexcreasy May 20, 2026 17:11
@MikeEdgar
Copy link
Copy Markdown
Member Author

@alexcreasy I believe I've addressed your review comments, but let me know if something is still missing or out of place. The PR branch has been rebased, but the original commit is unchanged and your feedback is addressed in the second commit. Thanks!

@sonarqubecloud
Copy link
Copy Markdown

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.

3 participants