Skip to content

refactor: DH-19267: columns changed filter event takes an id rather than a panel#2417

Merged
dgodinez-dh merged 3 commits intodeephaven:mainfrom
dgodinez-dh:dag_FilterColumnsSourceId
Apr 24, 2025
Merged

refactor: DH-19267: columns changed filter event takes an id rather than a panel#2417
dgodinez-dh merged 3 commits intodeephaven:mainfrom
dgodinez-dh:dag_FilterColumnsSourceId

Conversation

@dgodinez-dh
Copy link
Copy Markdown
Contributor

https://deephaven.atlassian.net/browse/DH-19267

Refactors InputFilterEvent.COLUMNS_CHANGED to take an id instead of a panel. This can be a panel id or a widget id. This will allow deephaven.ui components to send this event. Note that more work will need to be done on Linker. This will be done later when we address https://deephaven.atlassian.net/browse/DH-18840

@dgodinez-dh dgodinez-dh requested review from a team and bmingles and removed request for a team April 22, 2025 18:49
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2025

Codecov Report

Attention: Patch coverage is 31.57895% with 13 lines in your changes missing coverage. Please review.

Project coverage is 46.92%. Comparing base (2827f51) to head (1e51672).

Files with missing lines Patch % Lines
...ckages/dashboard-core-plugins/src/FilterPlugin.tsx 22.22% 7 Missing ⚠️
...kages/dashboard-core-plugins/src/linker/Linker.tsx 0.00% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #2417    +/-   ##
========================================
  Coverage   46.92%   46.92%            
========================================
  Files         712      712            
  Lines       39341    39343     +2     
  Branches    10024     9836   -188     
========================================
+ Hits        18462    18463     +1     
- Misses      20868    20869     +1     
  Partials       11       11            
Flag Coverage Δ
unit 46.92% <31.57%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

children?: ReactNode;
};

export type WidgetId = string;
Copy link
Copy Markdown
Contributor

@bmingles bmingles Apr 24, 2025

Choose a reason for hiding this comment

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

In case you haven't seen it, we now have a Brand type (packages/utils/src/TypeUtils.ts). It's useful for ensuring things like Ids don't get assigned to the wrong a field expecting a different id type. Usage is:

type WidgetId = Brand<'WidgetId'> // 2nd generic defaults to string

or

type WidgetId = Brand<'WidgetId', string>
...

// creation
const id = 'someId' as WidgetId

That said, it does require some type assertions in certain cases when creating ids, so there are tradeoffs. Can also sometimes create a rabbit hole when converting a type that is already in use in a lot of places. Just wanted to call it out in case it is a good fit here.

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.

Updated


type LayoutConfig = { id?: string; component?: string };

export type PanelId = string | string[] | null | undefined;
Copy link
Copy Markdown
Contributor

@bmingles bmingles Apr 24, 2025

Choose a reason for hiding this comment

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

Same suggestion here to consider the Brand type.

Suggested change
export type PanelId = string | string[] | null | undefined;
export type PanelId = Brand<'PanelId', string | string[] | null | undefined>;

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.

Updated

Copy link
Copy Markdown
Contributor

@bmingles bmingles left a comment

Choose a reason for hiding this comment

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

Left suggestions for using Brand type helper.

@dgodinez-dh dgodinez-dh requested a review from bmingles April 24, 2025 19:34
Copy link
Copy Markdown
Contributor

@bmingles bmingles left a comment

Choose a reason for hiding this comment

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

LGTM

@dgodinez-dh dgodinez-dh merged commit 8126c69 into deephaven:main Apr 24, 2025
11 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 24, 2025
@dgodinez-dh dgodinez-dh deleted the dag_FilterColumnsSourceId branch May 1, 2026 13:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants