Repository navigation
About: credits tables fit without side-scrolling and their columns resize - #3320
Conversation
…size The Contributors table and the Models table were egui Grids inside a two-way scroll area: they opened wider than the dialog, so they scrolled sideways, and Company and Model sat almost touching. Both are now egui_extras tables. Each column opens at the width of its header and widest cell, the spare width goes to the text columns (Name; Company and Model), and every column edge can be dragged. Widening a column grows the table like a spreadsheet, and only then does it scroll sideways; the header stays put while the rows scroll. Counts and dates are right-aligned and every cell is vertically centred. The sorted column stays highlighted and its direction shows on the toolbar's sort-order button, so headers no longer reserve room for an arrow. The opening widths come from fit_widths, a pure function with unit tests that a fitted table fills its room exactly and that only the text columns give way when room is short. The About dialog opens 820 points wide, so every column fits at its natural width. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
The last column was egui's remainder column, which has no drag handle, so it could only be resized from the edge before it. It is now an ordinary column with its own handle. A table keeps its column widths, so switching to a longer name left the Name column at its old width and clipped the text. The table now goes back to the opening fit whenever that fit changes: a longer widest cell or a resized window. Dragged widths are dropped at that point. fit_widths could overflow the room when one column hit the minimum, because the other columns did not take up its share. Columns now give way in proportion to their width above the minimum. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comparing the fitted widths missed the case it was meant for. Name is the only growing column, so a longer name takes its extra width from the spare room and the fit comes out the same: a dragged Name width stayed, clipping the longer name. It could also drop dragged widths by accident. The fit comes from the available width inside the scroll area, which scrolling can nudge, so scrolling a widened table could reset it. The table now compares the natural widths and the clip rect's width, which scrolling does not move. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
- i18n: tr_fill resolves every placeholder from the original template, so a
value that itself looks like a placeholder (a macro named {book}) is not
rewritten; tr_error and the error-template slots look the catalog up
without tracing, keeping runtime data (file names) out of the
untranslated-label trace
- zh errors: the specific output-range templates come before the
{OVERWRITE_ERROR} catch-all, which used to shadow them
- snapshot: a trace line that doesn't parse leaves the file untouched
instead of being silently dropped and overwritten
- fonts: the craft-chain test strips the baseline-variant '@FIRST' suffix
before comparing with the manifest keys, as the fallback test already does
- zh: translate the labels the form-controls merge brought in (Assign
Action, Change Control Value, Controls, Form Controls, Format Control,
Press Button)
- credits: keep the localization on top of the fitted-table rework (storytold#3320):
the empty-list note, the contributor headers and the model-table headers
translate again
- i18n: tr_fill resolves every placeholder from the original template, so a
value that itself looks like a placeholder (a macro named {book}) is not
rewritten; tr_error and the error-template slots look the catalog up
without tracing, keeping runtime data (file names) out of the
untranslated-label trace
- zh errors: the specific output-range templates come before the
{OVERWRITE_ERROR} catch-all, which used to shadow them
- snapshot: a trace line that doesn't parse leaves the file untouched
instead of being silently dropped and overwritten
- fonts: the craft-chain test strips the baseline-variant '@FIRST' suffix
before comparing with the manifest keys, as the fallback test already does
- zh: translate the labels the form-controls merge brought in (Assign
Action, Change Control Value, Controls, Form Controls, Format Control,
Press Button)
- credits: keep the localization on top of the fitted-table rework (storytold#3320):
the empty-list note, the contributor headers and the model-table headers
translate again
- i18n: tr_fill resolves every placeholder from the original template, so a
value that itself looks like a placeholder (a macro named {book}) is not
rewritten; tr_error and the error-template slots look the catalog up
without tracing, keeping runtime data (file names) out of the
untranslated-label trace
- zh errors: the specific output-range templates come before the
{OVERWRITE_ERROR} catch-all, which used to shadow them
- snapshot: a trace line that doesn't parse leaves the file untouched
instead of being silently dropped and overwritten
- fonts: the craft-chain test strips the baseline-variant '@FIRST' suffix
before comparing with the manifest keys, as the fallback test already does
- zh: translate the labels the form-controls merge brought in (Assign
Action, Change Control Value, Controls, Form Controls, Format Control,
Press Button)
- credits: keep the localization on top of the fitted-table rework (storytold#3320):
the empty-list note, the contributor headers and the model-table headers
translate again
- i18n: tr_fill resolves every placeholder from the original template, so a
value that itself looks like a placeholder (a macro named {book}) is not
rewritten; tr_error and the error-template slots look the catalog up
without tracing, keeping runtime data (file names) out of the
untranslated-label trace
- zh errors: the specific output-range templates come before the
{OVERWRITE_ERROR} catch-all, which used to shadow them
- snapshot: a trace line that doesn't parse leaves the file untouched
instead of being silently dropped and overwritten
- fonts: the craft-chain test strips the baseline-variant '@FIRST' suffix
before comparing with the manifest keys, as the fallback test already does
- zh: translate the labels the form-controls merge brought in (Assign
Action, Change Control Value, Controls, Form Controls, Format Control,
Press Button)
- credits: keep the localization on top of the fitted-table rework (storytold#3320):
the empty-list note, the contributor headers and the model-table headers
translate again
- i18n: tr_fill resolves every placeholder from the original template, so a
value that itself looks like a placeholder (a macro named {book}) is not
rewritten; tr_error and the error-template slots look the catalog up
without tracing, keeping runtime data (file names) out of the
untranslated-label trace
- zh errors: the specific output-range templates come before the
{OVERWRITE_ERROR} catch-all, which used to shadow them
- snapshot: a trace line that doesn't parse leaves the file untouched
instead of being silently dropped and overwritten
- fonts: the craft-chain test strips the baseline-variant '@FIRST' suffix
before comparing with the manifest keys, as the fallback test already does
- zh: translate the labels the form-controls merge brought in (Assign
Action, Change Control Value, Controls, Form Controls, Format Control,
Press Button)
- credits: keep the localization on top of the fitted-table rework (storytold#3320):
the empty-list note, the contributor headers and the model-table headers
translate again
- i18n: tr_fill resolves every placeholder from the original template, so a
value that itself looks like a placeholder (a macro named {book}) is not
rewritten; tr_error and the error-template slots look the catalog up
without tracing, keeping runtime data (file names) out of the
untranslated-label trace
- zh errors: the specific output-range templates come before the
{OVERWRITE_ERROR} catch-all, which used to shadow them
- snapshot: a trace line that doesn't parse leaves the file untouched
instead of being silently dropped and overwritten
- fonts: the craft-chain test strips the baseline-variant '@FIRST' suffix
before comparing with the manifest keys, as the fallback test already does
- zh: translate the labels the form-controls merge brought in (Assign
Action, Change Control Value, Controls, Form Controls, Format Control,
Press Button)
- credits: keep the localization on top of the fitted-table rework (storytold#3320):
the empty-list note, the contributor headers and the model-table headers
translate again
- i18n: tr_fill resolves every placeholder from the original template, so a
value that itself looks like a placeholder (a macro named {book}) is not
rewritten; tr_error and the error-template slots look the catalog up
without tracing, keeping runtime data (file names) out of the
untranslated-label trace
- zh errors: the specific output-range templates come before the
{OVERWRITE_ERROR} catch-all, which used to shadow them
- snapshot: a trace line that doesn't parse leaves the file untouched
instead of being silently dropped and overwritten
- fonts: the craft-chain test strips the baseline-variant '@FIRST' suffix
before comparing with the manifest keys, as the fallback test already does
- zh: translate the labels the form-controls merge brought in (Assign
Action, Change Control Value, Controls, Form Controls, Format Control,
Press Button)
- credits: keep the localization on top of the fitted-table rework (storytold#3320):
the empty-list note, the contributor headers and the model-table headers
translate again
- i18n: tr_fill resolves every placeholder from the original template, so a
value that itself looks like a placeholder (a macro named {book}) is not
rewritten; tr_error and the error-template slots look the catalog up
without tracing, keeping runtime data (file names) out of the
untranslated-label trace
- zh errors: the specific output-range templates come before the
{OVERWRITE_ERROR} catch-all, which used to shadow them
- snapshot: a trace line that doesn't parse leaves the file untouched
instead of being silently dropped and overwritten
- fonts: the craft-chain test strips the baseline-variant '@FIRST' suffix
before comparing with the manifest keys, as the fallback test already does
- zh: translate the labels the form-controls merge brought in (Assign
Action, Change Control Value, Controls, Form Controls, Format Control,
Press Button)
- credits: keep the localization on top of the fitted-table rework (storytold#3320):
the empty-list note, the contributor headers and the model-table headers
translate again


What changes
The About ▸ Contributors table and the About ▸ Models table were egui
Grids inside a two-way scroll area: they opened wider than the dialog, so they scrolled sideways by default, and Company and Model sat almost touching. Both are nowegui_extrastables:The sorted column stays highlighted and its direction shows on the toolbar's sort-order button, so headers no longer reserve room for an arrow.
How it was verified
Run on Linux, scoped to the UI crate. I did not run the full workspace gate.
cargo fmt --all -- --checkcargo clippy -p gridcraft-ui-egui --all-targets -- -D warningscargo nextest run -p gridcraft-ui-egui -E 'test(/about|credit|contributor/)': 26 passedcargo check -p gridcraft-ui-egui --lib --target wasm32-unknown-unknownThe opening widths come from
fit_widths, a pure function with unit tests: a fitted table fills its room exactly (no sideways scroll, no gap) with the spare width on the growing columns, and too little room shrinks only those columns. Each test was seen to fail by breakingfit_widthson purpose (once without the spare share, once without the shrink).Four later tests cover the live table. One drags every column's right edge through real pointer events and checks that only that column changes and that it stays put. One checks that a longer name, a longer cell or a narrower window refits the table. One checks that scrolling a widened table keeps its widths. One checks that columns at the minimum still fit the room. Each failed on earlier code in hosted gate runs on effectcraft.
For reviewers
egui_extras(from the pinned egui fork, default features off), which addsenum-maptoCargo.lock.🤖 Generated with Claude Code
Summary by CodeRabbit