Skip to content

About: credits tables fit without side-scrolling and their columns resize - #3320

Merged
FredApps merged 3 commits into
mainfrom
about-credits-columns
Nov 5, 2026
Merged

FredApps merged 3 commits into
mainfrom
about-credits-columns

Conversation

@FredApps

@FredApps FredApps commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

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 now egui_extras tables:

  • Fits by default. Each column opens at the width of its header and its widest cell; the spare width goes to the text columns (Name; Company and Model), so the table fills the dialog exactly and nothing scrolls sideways.
  • Every column resizes. Drag any column's right edge, the last column included. Widening a column grows the table, as in a spreadsheet, and only then does it scroll sideways. If a column's natural width or the window changes (a longer name, a resized window) the columns go back to a new fit and dragged widths are dropped.
  • Easier to read. The header stays put while the rows scroll; counts and dates are right-aligned; every cell is vertically centred.
  • Room for it. This widens the About dialog from 660 to 820 points, so every column fits at its natural width. Dialogs keep their existing behaviour on small windows.

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 -- --check
  • cargo clippy -p gridcraft-ui-egui --all-targets -- -D warnings
  • cargo nextest run -p gridcraft-ui-egui -E 'test(/about|credit|contributor/)': 26 passed
  • cargo check -p gridcraft-ui-egui --lib --target wasm32-unknown-unknown

The 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 breaking fit_widths on 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

  • New direct dependency egui_extras (from the pinned egui fork, default features off), which adds enum-map to Cargo.lock.
  • The About width change (the About dialog from 660 to 820 points).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements
    • Contributor and model tables support resizable columns, clearer text and number alignment, and improved horizontal and vertical scrolling. Contributor sorting remains available, and column widths adapt to content and available space.
    • The About dialog is wider, providing a more spacious layout.

…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>
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The About dialog is wider. The contributors and models views now use resizable tables with fitted columns and scrolling. The contributors view handles empty data and retains sorting.

Changes: About dialog and credits

Layer / File(s) Summary
Table layout support
crates/ui-egui/Cargo.toml, crates/ui-egui/src/credits.rs
The UI crate adds egui_extras and column-fitting helpers. Tests cover width distribution, minimum widths, column dragging, and refitting after content or window-size changes.
Credits table display
crates/ui-egui/src/credits.rs, crates/ui-egui/src/dialogs/show.rs
The contributors view handles empty data and uses a resizable table with sortable headers. The models view uses a resizable table with formatted, aligned values. Both tables use scrolling. The About dialog default width increases from 660 to 820 pixels.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Possibly related issues

Suggested reviewers: aiongg

Merge Risk: Minimal · up to 3beb4

The About tables gain resizable columns and scrolling. No merge-blocking issue was identified; normal checks remain appropriate.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main change: the About credits tables fit without side-scrolling and support column resizing.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 8 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Clippy (1.99.0)

Clippy execution timed out

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 6527e6f and 3beb484.

Files selected for processing: 1
  • crates/ui-egui/src/credits.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread crates/ui-egui/src/credits.rs Resolved
FredApps and others added 2 commits November 4, 2026 17:18
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>
@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
79.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@FredApps
FredApps merged commit ede12f9 into main Nov 5, 2026
10 of 11 checks passed
ysdlm added a commit to ysdlm/gridcraft that referenced this pull request Nov 5, 2026
- 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
ysdlm added a commit to ysdlm/gridcraft that referenced this pull request Nov 5, 2026
- 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
ysdlm added a commit to ysdlm/gridcraft that referenced this pull request Nov 8, 2026
- 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
ysdlm added a commit to ysdlm/gridcraft that referenced this pull request Nov 8, 2026
- 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
ysdlm added a commit to ysdlm/gridcraft that referenced this pull request Nov 12, 2026
- 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
ysdlm added a commit to ysdlm/gridcraft that referenced this pull request Nov 13, 2026
- 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
ysdlm added a commit to ysdlm/gridcraft that referenced this pull request Nov 15, 2026
- 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
ysdlm added a commit to ysdlm/gridcraft that referenced this pull request Nov 19, 2026
- 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
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.

1 participant