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 3 commits intomainfrom
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 primarily adds partial form-field filtering to Key changes:
Important discrepancy — PR title is stale: The PR title and description claim to "fix centered text in scroll mode," but this change was introduced in commit Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller as request_nomadnet_page
participant EL as _establish_link
participant RNS as RNS.Link
participant CB as on_link_established/closed
Caller->>EL: _establish_link(dest_hash, deadline)
note over EL: Phase 1–3: path → identity → destination
loop attempt 1..MAX_LINK_ATTEMPTS (3)
EL->>EL: check remaining > 5s
alt remaining < 5s
EL-->>Caller: error "Connection timed out"
end
EL->>RNS: RNS.Link(node_dest, established_cb, closed_cb)
note over EL,CB: Callbacks bound via default-arg capture<br/>to avoid late-binding closure bug
RNS-->>CB: on_link_established(link) OR on_link_closed(link)
CB->>EL: link_established.set()
EL->>EL: wait(timeout=min(per_attempt_base, remaining-5), min 5s)
alt link.status == ACTIVE
EL-->>Caller: return active link ✓
else teardown_reason == 0x03 (DESTINATION_CLOSED)
EL-->>Caller: error "Connection closed by node" (no retry)
else timeout / other failure
EL->>RNS: link.teardown()
note over EL: record last_reason, last_status → retry
end
end
EL-->>Caller: error "Connection timed out (N hops)"
|
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! |
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