fix: filter partial form fields and fix centered text in scroll mode#674
fix: filter partial form fields and fix centered text in scroll mode#674torlando-tech wants to merge 6 commits into
Conversation
PartialManager now only forwards form fields declared by each partial's field list, matching NomadNet TUI's __get_partial_request_data behavior. "*" forwards all fields; an empty list forwards none. This prevents undeclared fields (e.g. password inputs) from leaking to unrelated partial endpoints. MicronComposables scroll-mode centering fix: centered/right-aligned lines now use exact viewport width (fillMaxWidth + TextAlign) instead of min-width, so text actually centers rather than left-aligning. Updated MicronParserTest to use a real-world NomadNet node index line with trailing text after a styled link. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR fixes two independent bugs and updates a related test. The field-filtering change in
Confidence Score: 5/5Safe to merge — all three changes are narrow, well-scoped fixes with no new failure modes introduced. The field-filtering logic in No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[fetchAndUpdate called\nwith allowedFields] --> B{allowedFields\ncontains '*'?}
B -- Yes --> C[Use all form fields]
B -- No --> D{allowedFields\nempty?}
D -- Yes --> E[No fields / return null]
D -- No --> F[Filter keys present\nin allowedFields]
C --> G{filtered\nempty?}
F --> G
G -- Yes --> E
G -- No --> H[Build JSONObject\nand send to partial endpoint]
subgraph rns_api [Link Establishment Retry Loop]
I[attempt 1..3] --> J{remaining\n< 5s?}
J -- Yes --> K[Break — deadline exhausted]
J -- No --> L[Create RNS.Link\nwait up to min\nper_attempt_base, remaining-5s\nor 5s min]
L --> M{link.status\n== ACTIVE?}
M -- Yes --> N[Return active link]
M -- No --> O{reason == 0x03\nDESTINATION_CLOSED?}
O -- Yes --> P[Return error:\nConnection closed by node]
O -- No --> Q[Teardown & retry]
Q --> I
K --> R[Return error:\nConnection timed out]
end
Reviews (6): Last reviewed commit: "chore(greptile): iteration 3 — applied 1..." | Re-trigger Greptile |
Link establishment now retries up to 3 times when the single RNS link request packet is lost (same single-shot-no-retry issue as request_path). Each attempt waits up to the per-hop timeout before tearing down and retrying. Destination-closed (0x03) is treated as permanent and not retried. Reverts the scroll-mode centering change from the previous commit — it caused long lines (ASCII art) to word-wrap instead of scrolling horizontally. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address Greptile review findings: - PartialManager: preserve fieldNames in onSuccess and onFailure PartialState constructors so reloads retain field filtering. Refactor buildFormDataJson to use when-expression, reducing return count from 4 to 3 (fixes detekt ReturnCount). - rns_api.py: capture link_established and link_closed_reason via default args in retry loop closures to prevent late-firing callbacks from a prior iteration corrupting the next iteration's state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
PartialManager.buildFormDataJsonnow only forwards form fields declared by each partial'sfieldNameslist, matching NomadNet TUI's__get_partial_request_data()behavior."*"= all fields, empty list = none. Prevents undeclared fields (e.g. password inputs) from leaking to unrelated partial endpoints.MONOSPACE_SCROLLmode now use exact viewport width (fillMaxWidth+TextAlign) so text actually centers instead of left-aligning withwidthIn(min=).MicronParserTest.backtick before link with formattingnow uses a real-world NomadNet node index line with trailing text after a styled link.Test plan
:micron:testDebugUnitTest— updated parser test passes🤖 Generated with Claude Code