Skip to content

feat(ux): central actionable toast for PTP Ethernet failures and board events, including Advanced - #273

Open
masarray wants to merge 5 commits into
fix/p0-ptp-ethernet-link-preflight-20261021from
feat/p0-center-actionable-toasts-20261021
Open

masarray wants to merge 5 commits into
fix/p0-ptp-ethernet-link-preflight-20261021from
feat/p0-center-actionable-toasts-20261021

Conversation

@masarray

Copy link
Copy Markdown
Owner

Physical operator feedback: PTP SOURCE refused to start because ESP32-P4 Ethernet is not connected; the app returned OFF without clearly instructing the operator what to do. UX must be smart, not hide errors in scrollable diagnostics.

  • Convert existing bottom StatusToast into centered short-lived toast (main Studio and separate Advanced window), readable multiline typography and fade.
  • Route native DeviceController lastErrorChanged to actionable messages with cause-specific instructions: PHY LINK DOWN, Ethernet driver not started, EMAC invalid state, USB lease lost, runtime STOP. Translate opaque board reasons into concrete user actions. Keep complete technical errors in diagnostics/status history.
  • Show meaningful informational events briefly, deduplicate repeated identical messages within 4 seconds; alert stays 4.2s / info 2.3s. Don't toast every polling update, and never automatically restart PTP/SV based on toast.
  • Structural GUI regression contract protects central layout and physical-link guidance.

Stacked on PR #271/#270, NOT merged to main. Native Windows/Qt CI and bench acceptance mandatory; current hardware PTP SOURCE still unproven.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T06:01:10.264486Z 2736431 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 2736431ae2

ℹ️ 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 +213 to +215
function onLastErrorChanged() {
if (device.lastError && device.lastError.length > 0)
root.showMessage(device.lastError, true)

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 Consume each device error only once

DeviceController::setError() emits lastErrorChanged and then deviceMessage for the same failure, so this new handler first records/displays it as critical and the existing onDeviceMessage immediately processes it again as informational. Every native error therefore creates duplicate history entries with conflicting severity, and errors containing words matched by meaningful—for example the Ethernet-driver message containing “not STARTED”—replace the critical 4.2-second toast with a non-error 2.3-second toast. Suppress the paired informational handling or expose a single severity-aware event.

Useful? React with 👍 / 👎.

Comment on lines +343 to +345
const key = (critical ? "E:" : "I:") + userMessage
const now = Date.now()
const duplicate = key === lastToastKey && now - lastToastAt < 4000

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 Allow identical failures after the dedupe window

The four-second deduplication cannot provide another toast for a repeated native error because DeviceController::setError() returns whenever lastError_ == message, so neither signal reaches this code again. For example, after a PHY-down PTP attempt fails and its toast expires, retrying against the same disconnected cable produces the identical actionable error and no second toast even minutes later; the asynchronous start was initially accepted, so PtpExpertPanel does not supply a fallback notification. Clear or re-emit the error per operation before applying this time-bounded UI deduplication.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

2026-10-21 — Actionable center-screen toast UX validated and packaged

HEAD 9bbe201c955f29979086f42c449836198d91c9f4, PR #273 stacked on #271. 4/4 GitHub workflows SUCCESS: Qt harness/High-DPI, Windows lifecycle, Windows native preview/firmware package, naming. No merge/main or public release.

The physical operator discovered ESP32-P4 Ethernet was NOT connected to an active laptop/switch port and wanted prompt, actionable UX instead of guessing from PTP OFF. Studio now centrally displays short (~4.2s error/~2.3s info) readable multilined toast on both Main and detached Advanced windows. Native DeviceController error source lastErrorChanged routes through human instructions for ETHERNET_LINK_DOWN, ETHERNET_DRIVER_NOT_STARTED, ETHERNET_TX_INVALID_STATE, USB control LEASE_EXPIRED, SV runtime fault, preserving raw logs. Deduplicates same toast in a 4s window; only meaningful state info makes toast, not periodic polling. Physical PHY DOWN→UP readback emits one recovery message. No fake PTP ON or auto-restart.

Matched Windows native installer only, extracted and checksum-verified from GitHub Actions https://github.com/masarray/arstack61850/actions/runs/39552645099/artifacts/12324622926 ; ARStack-Studio-Preview-win-x64-setup.exe bytes=31,027,188 SHA-256 47e9fbcd46b66830e5ee93b193d70487aa9dc9ed9a21f69ee788fd1dc7f9d867. Packaging retains matching ESP32-P4 firmware at build 9bbe201c955f2997; installer redistributed as direct standalone EXE (not an Actions ZIP).

Acceptance not claimed: real board hardware must show ETH driver STARTED, PHY UP before successful verified Announce/Sync/FollowUp; test physical cable-down failure toast and PHY-up recovery toast while Advanced is foreground, and PTP+SV endurance. GUI CI success is not physical GM/SMV lock proof. Keep PR #273/#271/#270 unmerged.

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