chore: fix the misspelled apigateway module and drop a magic row count - #84
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #44.
The three items
1. Duplicated table widths (EC2 passing
widthstwice) - already fixed. The shared list-table helper from #30 removed it; there are no.widths(calls left insrc/ui/. Nothing to do.2. Misspelled model file -
src/models/apigatway.rsrenamed toapigateway.rs, matchingsrc/aws/apigateway.rs. The typo had also spread to the render function,render_apigatway, which is renamed too. Noapigatwayspelling remains anywhere.3. Hardcoded item count -
ACCOUNT_OVERVIEW_ROWS: usize = 10is gone.On the row count
It was a number nothing read. The account overview free-scrolls (
view_uses_free_scroll), and both callers ofactive_view_item_countreturn 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:
Endsets the offset tou16::MAX, but the view clamps its own offset against the rendered row count before drawing.Verification
cargo test: 140 passed, 0 failedcargo clippy --all-targets -- -D warnings: cleancargo fmt --check: cleanEnd: the offset clamps fromu16::MAXto 7, the inventory table still renders, the last row is still visible, and the selection stays at 0 as a free-scroll view requires.