Conversation
hibig
commented
Jul 16, 2026
- llmodels/model-routes/cluster child rows use ExpandedRowGrid + Cell (auto-flow spans, no parent-key/grid-line math)
- define --seal-table-row-min-height token in global.less
- routes created_at column: span -> fixed width 180
- llmodels/model-routes/cluster child rows use ExpandedRowGrid + Cell (auto-flow spans, no parent-key/grid-line math) - define --seal-table-row-min-height token in global.less - routes created_at column: span -> fixed width 180
There was a problem hiding this comment.
Code Review
This pull request refactors the child row layouts in cluster management, model instances, and model routes to use the new ExpandedRowGrid component, allowing them to dynamically align with their parent table columns instead of relying on hardcoded inline paddings and spans. Feedback focuses on improving TypeScript type safety (such as typing the dataIndex parameter as optional and replacing any with RouteTarget), simplifying fallback status code checks, and cleaning up now-unused variables and calculations related to createTimeSpan in the routes columns hook.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| const spanFor = (dataIndex: string): number => { | ||
| switch (dataIndex) { | ||
| case 'instance_type': | ||
| return Math.max(middleSpan - 3, 1); | ||
| case 'image_name': | ||
| return 2; | ||
| case 'replicas': | ||
| return 1; | ||
| default: | ||
| // name / created_at / operations align 1:1 with their parent column. | ||
| return 1; | ||
| } | ||
| }; |
There was a problem hiding this comment.
The dataIndex parameter in spanFor is typed as string, but table columns can have an optional dataIndex (which is typed as string | undefined). To prevent potential TypeScript compilation errors when passing col.dataIndex, update the parameter type to string | undefined (or make it optional).
| const spanFor = (dataIndex: string): number => { | |
| switch (dataIndex) { | |
| case 'instance_type': | |
| return Math.max(middleSpan - 3, 1); | |
| case 'image_name': | |
| return 2; | |
| case 'replicas': | |
| return 1; | |
| default: | |
| // name / created_at / operations align 1:1 with their parent column. | |
| return 1; | |
| } | |
| }; | |
| const spanFor = (dataIndex?: string): number => { | |
| switch (dataIndex) { | |
| case 'instance_type': | |
| return Math.max(middleSpan - 3, 1); | |
| case 'image_name': | |
| return 2; | |
| case 'replicas': | |
| return 1; | |
| default: | |
| // name / created_at / operations align 1:1 with their parent column. | |
| return 1; | |
| } | |
| }; |
| interface TargetItemProps extends SharedGrid { | ||
| onSelect: (val: any, record: any) => void; | ||
| data: any; | ||
| sourceModels: any[]; | ||
| modelList?: Global.BaseOption<number>[]; | ||
| } |
There was a problem hiding this comment.
Since RouteTarget is imported in this file, we can type the data property in TargetItemProps as RouteTarget instead of any to improve type safety and maintainability.
| interface TargetItemProps extends SharedGrid { | |
| onSelect: (val: any, record: any) => void; | |
| data: any; | |
| sourceModels: any[]; | |
| modelList?: Global.BaseOption<number>[]; | |
| } | |
| interface TargetItemProps extends SharedGrid { | |
| onSelect: (val: any, record: any) => void; | |
| data: RouteTarget; | |
| sourceModels: any[]; | |
| modelList?: Global.BaseOption<number>[]; | |
| } |
| const weightNode = | ||
| data.fallback_status_codes && data.fallback_status_codes?.length > 0 ? ( | ||
| <> | ||
| {data.weight > 0 && <span style={{ marginInline: 8 }}>/</span>} | ||
| <span>{intl.formatMessage({ id: 'routes.table.label.fallback' })}</span> | ||
| </> | ||
| ) : ( | ||
| <AutoTooltip ghost> | ||
| {intl.formatMessage({ id: 'routes.form.target.weight' })}:{' '} | ||
| {data.weight || 0} | ||
| </AutoTooltip> | ||
| ); |
There was a problem hiding this comment.
The check data.fallback_status_codes && data.fallback_status_codes?.length > 0 can be simplified to just data.fallback_status_codes?.length using optional chaining, which is cleaner and more idiomatic.
| const weightNode = | |
| data.fallback_status_codes && data.fallback_status_codes?.length > 0 ? ( | |
| <> | |
| {data.weight > 0 && <span style={{ marginInline: 8 }}>/</span>} | |
| <span>{intl.formatMessage({ id: 'routes.table.label.fallback' })}</span> | |
| </> | |
| ) : ( | |
| <AutoTooltip ghost> | |
| {intl.formatMessage({ id: 'routes.form.target.weight' })}:{' '} | |
| {data.weight || 0} | |
| </AutoTooltip> | |
| ); | |
| const weightNode = | |
| data.fallback_status_codes?.length ? ( | |
| <> | |
| {data.weight > 0 && <span style={{ marginInline: 8 }}>/</span>} | |
| <span>{intl.formatMessage({ id: 'routes.table.label.fallback' })}</span> | |
| </> | |
| ) : ( | |
| <AutoTooltip ghost> | |
| {intl.formatMessage({ id: 'routes.form.target.weight' })}:{' '} | |
| {data.weight || 0} | |
| </AutoTooltip> | |
| ); |
| dataIndex: 'created_at', | ||
| sorter: tableSorter(6), | ||
| span: createTimeSpan, | ||
| width: 180, |
There was a problem hiding this comment.
Since the created_at column was refactored to use a fixed width: 180 instead of span: createTimeSpan, the variable createTimeSpan and its dependent calculations (overflow, CREATE_TIME_PREFERRED_SPAN, CREATE_TIME_MIN_SPAN) are now dead code. Please clean them up from the file to keep the codebase clean and maintainable.
There was a problem hiding this comment.
Pull request overview
This PR refactors expandable child-row rendering in several SealTable-based pages to share the parent table’s column grid (via ExpandedRowGrid + ChildGridOptions), reducing per-page padding/grid-math and improving alignment consistency across parent/child rows.
Changes:
- Pass parent grid metadata (
gridTemplate,prefixWidth,columns) fromSealTablerenderChildren options down into child-row components. - Replace legacy
RowChildren+Row/Collayouts withExpandedRowGridin model routes, clusters/pools, and llmodels instances child rows. - Standardize sizing tokens and columns (add
--seal-table-row-min-heightglobal token; set model-routescreated_atcolumn to a fixed width).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/model-routes/index.tsx | Forwards SealTable grid options into the route-target child rows. |
| src/pages/model-routes/hooks/use-routes-columns.tsx | Changes created_at sizing (span → fixed width) in the routes table columns hook. |
| src/pages/model-routes/components/route-targets.tsx | Rebuilds route-target expanded rows using ExpandedRowGrid aligned to parent columns. |
| src/pages/llmodels/components/table-list.tsx | Forwards parent grid options into llmodels instance child rows. |
| src/pages/llmodels/components/instance/instances.tsx | Threads shared grid props down from child list to each child row. |
| src/pages/llmodels/components/instance/instance-item.tsx | Replaces Row/Col child layout with ExpandedRowGrid using parent grid alignment. |
| src/pages/cluster-management/hooks/use-pools-columns.tsx | Removes per-column padding styles now that layout is grid-aligned. |
| src/pages/cluster-management/components/pool-rows.tsx | Rebuilds pool expanded rows with ExpandedRowGrid and span mapping to parent tracks. |
| src/pages/cluster-management/clusters.tsx | Forwards SealTable grid options into the worker-pool child rows. |
| src/global.less | Adds a global --seal-table-row-min-height token for consistent row sizing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| title: intl.formatMessage({ id: 'common.table.createTime' }), | ||
| dataIndex: 'created_at', | ||
| sorter: tableSorter(6), | ||
| span: createTimeSpan, | ||
| width: 180, | ||
| render: (value: string) => ( |
| import { DeleteOutlined } from '@ant-design/icons'; | ||
| import { | ||
| AutoTooltip, | ||
| ChildGridOptions, |