Skip to content

fix(layout): say when a table's rows are held to 1 to 500 - #3214

Merged
jgregoriorincon merged 1 commit into
opengeos:mainfrom
jgregoriorincon:fix/3197-table-rows-notice
Nov 28, 2026
Merged

jgregoriorincon merged 1 commit into
opengeos:mainfrom
jgregoriorincon:fix/3197-table-rows-notice

Conversation

@jgregoriorincon

@jgregoriorincon jgregoriorincon commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

layout.addElement and layout.update held a table's rows to 1–500 without saying so: 900 became 500 and 0 became 1.

Both now say it, in the same notice as the other held values: Add Element: rows 900 held to 500 (1 to 500), or Element Properties: … for layout.update. A value within the range says nothing, and a value that isn't a whole number of 0 or more is still refused. rows given to layout.update for an element that isn't a table is ignored as before, with no notice.

The range is now one constant that the clamp and the notice share.

The notice is a session notice, like the other held values, so it reaches the desktop app, the browser, the phone, the command line, Python and the Assistant and MCP results. There's no new command or option, so the ribbon, command search, tool descriptions and plugins don't change, and undo works as before.

Testing

  • New test a_table_s_rows_held_to_their_range_are_said (add and update: 900, "900", 501, 0, 1, 500, "7", null, a chart, and rows together with another held value). It failed before the change for the missing notice.
  • cargo nextest run -p rustgis-engine -E 'test(layout_typed_values) + test(add_element)': 19 passed.
  • fmt, clippy, nextest, doctests, the layer check and the schema check are green.
  • Headless ui_shot before and after, running layout.addElement with rows: 900.

UI evidence

The Messages pane after layout.addElement {"kind": "table", "rows": 900}: before (left) nothing is said; after (right) the notice. The Rows box in Element Properties is already limited to 1–500, so only a command run directly (command search, scripts, the assistant, MCP) can ask for a value outside the range.

before and after

Related issue

Closes #3197

Summary by CodeRabbit

  • Bug Fixes
    • Table row counts are now limited to 1–500 when adding or updating a table. Out-of-range values are adjusted to that range, with a notice explaining the adjustment.
    • Row-count notices appear alongside other adjustment notices. Missing or null row counts remain unspecified, and invalid non-integer or negative values still produce an error.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Table row counts are clamped to 1–500. Add and update operations now report when a supplied table row count is clamped.

Changes: Table row limit notices

Layer / File(s) Summary
Row count parsing and clamp notice
crates/engine/src/cmd/layout/elements.rs
Table row parsing accepts zero before clamping to 1–500. A notice is produced when the supplied row count is changed by the clamp.
Add and update notice reporting
crates/engine/src/cmd/layout/elements.rs, crates/engine/src/cmd/layout/update.rs, crates/engine/src/tests/layout_typed_values.rs
Adding or updating a table includes the row clamp notice. Tests cover out-of-range and in-range values, absent and null values, chart inputs, and combined clamp notices.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

Suggested reviewers: elpidioassinaturas, m-hollis-1

Merge Risk: Minimal · up to 9d26a

Adding or updating a table with a row count outside 1 to 500 now reports that the value was held to the limit. In-range and absent values behave as before. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the layout command now tells the user when a table's rows are held to the 1 to 500 range. It matches the raw summary, the objectives, and the description. The title us…
Description check Passed The description covers the summary of the change, the testing done, and a UI evidence section with a before and after image. It also links issue #3197 under Related issue. The template's placeholder c…
Linked Issues check Passed [#3197] The issue requires a notice when layout.addElement or layout.update holds a table's rows to 1–500, giving the value asked and the value kept, and no notice when the value is in range. At head,…
Out of Scope Changes check Passed The changes stay within #3197. They add the table rows notice (held_rows and the table branch in update), reuse the existing say_held and notify mechanism, share one TABLE_ROWS constant between the cl…
Full details: Title check

Explanation

The title names the main change: the layout command now tells the user when a table's rows are held to the 1 to 500 range. It matches the raw summary, the objectives, and the description. The title uses the fix(layout) convention and is 57 characters long.

Full details: Description check

Explanation

The description covers the summary of the change, the testing done, and a UI evidence section with a before and after image. It also links issue #3197 under Related issue. The template's placeholder comments were replaced with content. The UI evidence section states a visible change and includes images, which matches the template's rule for UI changes. The description is complete and specific.

Full details: Linked Issues check

Explanation

[#3197] The issue requires a notice when layout.addElement or layout.update holds a table's rows to 1–500, giving the value asked and the value kept, and no notice when the value is in range. At head, crates/engine/src/cmd/layout/elements.rs defines TABLE_ROWS = (1.0, 500.0) and table_rows() clamps to it. held_rows(p) returns 'rows {n} held to {kept} ({least} to {most})' only when the asked value differs from the kept value, so in-range values produce no notice. The same constant feeds the clamp and the notice. In crates/engine/src/cmd/layout/update.rs, held_rows is called only when the target element is ElementKind::Table, so rows on other kinds stays ignored with no notice. The notice goes through the existing say_held and session notify path, as the other held values do. The add_element call site was not readable in the inspection (output truncated), so its wiring rests on the PR summary, the new test, and the before/after UI evidence. The test a_table_s_rows_held_to_their_range_are_said was not run. Non-whole and negative values remain refused by table_rows, as the issue's expected behavior requires.

Full details: Out of Scope Changes check

Explanation

The changes stay within #3197. They add the table rows notice (held_rows and the table branch in update), reuse the existing say_held and notify mechanism, share one TABLE_ROWS constant between the clamp and the notice, and add a test for the add and update cases. The PR description states that no new command, option, ribbon entry, or tool description is added, and that undo is unchanged. No unrelated files or behavior changes were identified in the inspected hunks. The add_element hunk and the test file were not directly readable in this inspection, so this verdict relies on the summary for those parts.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checked the table rows,
One to five hundred, as it goes.
If clamped, a notice now appears,
For add and update, clear and near.
I twitch my nose and hop away,
The rows are told what changed today.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: bd3a2a79-5d28-4f48-8a1d-8a2e28f83421
Commits

Reviewing files that changed from the base of the PR and between 9fbbdd4 and 9d26a5f.

Files selected for processing: 3

  • crates/engine/src/cmd/layout/elements.rs
  • crates/engine/src/cmd/layout/update.rs
  • crates/engine/src/tests/layout_typed_values.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.

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3214/
Web app https://preview.rustgis.app/pr-3214/app/
Commit 9d26a5f

GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the preview label (once per commit).

@jgregoriorincon
jgregoriorincon added this pull request to the merge queue Nov 28, 2026
Merged via the queue into opengeos:main with commit c98006c Nov 28, 2026
28 checks passed
@jgregoriorincon
jgregoriorincon deleted the fix/3197-table-rows-notice branch November 28, 2026 11:37
m-hollis-1 added a commit to m-hollis-1/rustgis that referenced this pull request Nov 28, 2026
layout.addElement says a picture's file that isn't remembered beside a table's held rows (opengeos#3214).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.

[Bug]: Layout commands hold a table's rows to 1–500 without a word

1 participant