Skip to content

chore: fix the misspelled apigateway module and drop a magic row count - #84

Merged
Bccorb merged 1 commit into
mainfrom
chore/small-cleanups
Jul 20, 2026
Merged

chore: fix the misspelled apigateway module and drop a magic row count#84
Bccorb merged 1 commit into
mainfrom
chore/small-cleanups

Conversation

@Bccorb

@Bccorb Bccorb commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Closes #44.

The three items

1. Duplicated table widths (EC2 passing widths twice) - already fixed. The shared list-table helper from #30 removed it; there are no .widths( calls left in src/ui/. Nothing to do.

2. Misspelled model file - src/models/apigatway.rs renamed to apigateway.rs, matching src/aws/apigateway.rs. The typo had also spread to the render function, render_apigatway, which is renamed too. No apigatway spelling remains anywhere.

3. Hardcoded item count - ACCOUNT_OVERVIEW_ROWS: usize = 10 is gone.

On the row count

It was a number nothing read. The account overview free-scrolls (view_uses_free_scroll), and both callers of active_view_item_count return early for free-scroll views, so the count was never consumed for that view.

It also happened to be correct today: the view builds exactly ten inventory rows. That is precisely the kind of number that silently goes wrong the first time a service row is added, which is what the issue means by a latent smell.

The account overview now reports no selectable rows, which is what it actually has. I checked the "latent scroll desync" the issue mentions and it does not exist: End sets the offset to u16::MAX, but the view clamps its own offset against the rendered row count before drawing.

Verification

  • cargo test: 140 passed, 0 failed
  • cargo clippy --all-targets -- -D warnings: clean
  • cargo fmt --check: clean
  • Rendered the account overview against a live account and drove End: the offset clamps from u16::MAX to 7, the inventory table still renders, the last row is still visible, and the selection stays at 0 as a free-scroll view requires.
  • New tests assert the account overview reports no selectable rows and that scrolling a view with no rows cannot underflow the selection index.
  • Drove the real TUI through the view switch and End: clean exit, no panic.

The API Gateway model lived in apigatway.rs while its fetcher and view used the
correct spelling, and the view's render function carried the same typo.

The account overview reported a hardcoded row count of 10. Nothing read it: the
view free-scrolls a fixed layout and clamps its own offset while rendering, and
both callers of the count return early for free-scroll views. It happened to
match the ten inventory rows today, which is exactly the kind of number that
drifts the moment a service is added. It now reports no selectable rows, which
is what the view actually has.

The third item on the issue, EC2 passing table widths twice, is already gone:
the shared list-table helper removed it.
@Bccorb
Bccorb merged commit 2395538 into main Jul 20, 2026
2 checks passed
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.

tech-debt: small cleanups (duplicated table widths, misspelled model file, magic item count)

1 participant