Skip to content

Commit 30f598c

Browse files
committed
fix(webapp): type resizable sidebar lengths as panel units
The panel library's min/default/max props are template-literal Unit types; bare strings failed typecheck (would have failed CI where the billing baseline noise is absent).
1 parent 0e1a0fc commit 30f598c

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

apps/webapp/app/components/layout/MetricsLayout.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ function columnsForCount(count: number): GridColumns {
193193
*/
194194
export type MetricsScroll = "page" | "regions";
195195

196+
/** A length the resizable panels accept: pixels or percent (the panel library's `Unit`). */
197+
type PanelLength = `${number}px` | `${number}%`;
198+
196199
type MetricsLayoutSidebarProps = {
197200
children: ReactNode;
198201
/**
@@ -208,13 +211,13 @@ type MetricsLayoutSidebarProps = {
208211
*/
209212
resizable?: boolean;
210213
/** Resizable only: min width of the sidebar panel. Defaults to `"280px"`. */
211-
min?: string;
214+
min?: PanelLength;
212215
/** Resizable only: initial width of the sidebar panel. Defaults to `"380px"`. */
213-
defaultSize?: string;
216+
defaultSize?: PanelLength;
214217
/** Resizable only: max width of the sidebar panel. */
215-
max?: string;
218+
max?: PanelLength;
216219
/** Resizable only: min width of the main panel. Defaults to `"300px"`. */
217-
mainMin?: string;
220+
mainMin?: PanelLength;
218221
/** Resizable only: cookie name the split is persisted under (also the panel-group id). */
219222
autosaveId?: string;
220223
/** Resizable only: server-loaded split snapshot to hydrate from (see `getResizableSnapshot`). */

0 commit comments

Comments
 (0)