Skip to content

Add shared UI components and refactor MeshCoreConnector#472

Merged
zjs81 merged 5 commits into
devfrom
ui
Jun 13, 2026
Merged

Add shared UI components and refactor MeshCoreConnector#472
zjs81 merged 5 commits into
devfrom
ui

Conversation

@zjs81

@zjs81 zjs81 commented Jun 13, 2026

Copy link
Copy Markdown
Owner

No description provided.

zjs81 added 5 commits June 12, 2026 21:04
- Introduced `mesh_ui.dart` with reusable widgets including SectionHeader, MeshCard, StatusChip, StatTile, AvatarCircle, SignalBars, RouteChip, PulseDot, BottomSheetHeader, ErrorRetryCard, and ListEntrance.
- Implemented `path_map_ui.dart` for path map screens, featuring path distance calculations, playback controls, and a summary list of observed paths.
- Created `themed_map_tile_layer.dart` for shared cached map tiles with automatic dark-mode treatment.
… path resolution; add PathHopResolver for better contact resolution
@zjs81 zjs81 merged commit 815534d into dev Jun 13, 2026
5 of 6 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7da4e68384

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +4477 to +4479
// No ML data — prefer device est_timeout (it used real airtime), then physics.
if (deviceTimeoutMs != null && deviceTimeoutMs > 0) {
return deviceTimeoutMs.clamp(physicsMin, _hardMaxTimeoutMs);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Cap the timeout floor before clamping

For slow flood routes, _physicsMinTimeout can exceed the 45-second hard maximum—the comment above explicitly notes roughly 150 seconds at SF12. In the cold-start path, deviceTimeoutMs.clamp(physicsMin, _hardMaxTimeoutMs) then receives a lower bound greater than its upper bound and throws ArgumentError. _handleMessageSent catches this and merely marks the bubble sent, without registering the ACK or starting a retry timer, so the message can never transition to delivered or failed. Clamp physicsMin to the hard maximum before using it as a bound.

Useful? React with 👍 / 👎.

Comment on lines +4465 to +4467
final ceiling = deviceTimeoutMs != null && deviceTimeoutMs > physicsMin
? deviceTimeoutMs.clamp(physicsMin, _hardMaxTimeoutMs)
: physicsMax;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Let learned latency widen the device estimate

When a congested route's observed successful RTT is longer than the firmware estimate, this makes deviceTimeoutMs the ceiling and truncates the learned timeout back to that shorter estimate. The retry timer will therefore fire while the original packet is still in flight, producing duplicate transmissions and potentially false failures; the 45-second hard cap already bounds runaway model output. Treat the firmware value as a baseline/floor and allow the learned value to widen it up to the hard cap.

Useful? React with 👍 / 👎.

Comment on lines +199 to +201
// The firmware's expected_ack_table is a single 8-entry circular buffer
// shared across all contacts; exceeding it silently evicts an older slot.
if (_activeMessages.length >= _maxGlobalInFlight) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Release canceled sends from the global in-flight cap

With the new global cap, stale IDs in _activeMessages consume capacity for every contact. MeshCoreConnector.deleteMessage calls untrack, but _cleanupMessage removes the pending contact/message without removing the ID from _activeMessages or pumping queues. After users delete six pending sends, this condition rejects every subsequent queued message across all contacts indefinitely. Cancellation must release the active slot and start waiting queues.

Useful? React with 👍 / 👎.

Comment on lines +1462 to +1466
child: Container(
decoration: BoxDecoration(
color: MeshPalette.bg1,
borderRadius: BorderRadius.circular(MeshRadii.md),
border: Border.all(color: MeshPalette.line2),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Provide light-theme foregrounds for the dark path panel

When the app uses its light theme, this panel remains dark but inherits the light theme's dark foreground colors. The repeater-hops heading, collapse icon, and several playback controls do not set their own light foreground, making them nearly invisible against MeshPalette.bg1. Either use the themed surface color here or establish a matching light DefaultTextStyle/icon theme for the hard-coded dark panel.

Useful? React with 👍 / 👎.

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.

1 participant