Skip to content

feat(p0): center-screen actionable Studio toast for board faults, PTP Ethernet and operator attention - #272

Open
masarray wants to merge 7 commits into
fix/p0-ptp-ethernet-link-preflight-20261021from
feat/p0-central-actionable-operator-toast-20261021
Open

masarray wants to merge 7 commits into
fix/p0-ptp-ethernet-link-preflight-20261021from
feat/p0-central-actionable-operator-toast-20261021

Conversation

@masarray

Copy link
Copy Markdown
Owner

Field UX feedback (2026-10-21) — prevent ambiguous PTP/SMV failures

The operator tested PTP SOURCE while the ESP32-P4 Ethernet port was not connected to an active laptop Ethernet port or switch. Old Studio silently put error messages into a tiny bottom text/footer and returned the PTP switch to OFF. This is correct for hardware safety but poor operator guidance.

Engineering change (stacked on #271)

  • Replace 36px bottom-only toast with one calm compact center-screen alert including a legible headline and an actionable 1–3 line remedy. Display in Main and active Advanced Window, which is a separate Qt Window and previously hid the Main overlay. Auto-dismiss: 4.6s faults, 2.8s useful confirmations; dismissal never acknowledges/reset board errors.
  • Central JS policy categorizes PHY/link DOWN ("Sambungkan port Ethernet ESP32-P4 ke laptop atau switch yang aktif; tunggu LINK menyala"), ETH driver not started, EMAC TX invalid state, PTP SOURCE failed/timeout, SV lease expiry and runtime stop, firmware/profile/capture faults, generic device/session failures, and copy/update success. Keep raw engineering messages in existing event history and Copy diagnostics, not on-screen textual noise.
  • Fix actual C++ DeviceController error-to-UI boundary: setError emits deviceMessage, which Main was always treating as informational. Now error severity is inferred from verified lastError equality; terminal SmartSessionController states and PTP START terminal failure also display. No backend authority mutation.
  • Coalesce duplicate faults for 8s, preserve error toast against success chatter; a fresh PTP START resets dedupe so repeated failure remains visible. Board-verified PHY DOWN→UP can report recovery once.
  • Default courtesy PTP SOURCE attempt is gated on board-measured PHY DOWN or driver STOPPED; stops sending doomed PTP START, instead shows the operator exactly what to connect. PTP board firmware still independently enforces ETH_EVENT proof and actual PTP L2 TX before RUNNING.
  • New CI workspace guard prevents regressions back to bottom-only, error-suppressed or busy telemetry toasts. Qt runtime smoke, session harness, MSVC and Windows preview gate required.
    No merge to main/release without physical test. Hardware PTP TX success remains unproven until operator plugs Ethernet into active switch/NIC and captures actual Announce+Sync+FollowUp.

@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-21T05:38:45.481804Z 3788f1a 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: 3788f1a82a

ℹ️ 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".

and "now - lastOperatorNoticeMs < 8000" in main_qml
and "messageTimer.interval = notice.error ? 4600 : 2800" in main_qml
and "statusHistoryModel.append({" in main_qml
and "anchors.centerIn: parent" not in toast_qml

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 Narrow the anchor check to the toast root

The newly added workspace check always fails at this revision because StatusToast.qml legitimately contains anchors.centerIn: parent on the !/i icon label, even though the toast root itself has no centering anchor. Running check_operator_workspace.py against an archive of this commit exits with status 1 at this contract, so the regression suite cannot pass until the assertion inspects only the root or otherwise distinguishes the nested label.

AGENTS.md reference: AGENTS.md:L251-L257

Useful? React with 👍 / 👎.

Comment on lines +363 to +364
const linkDown = /ETHERNET_LINK_DOWN|Ethernet PHY link is DOWN/i.test(m) ||
(/PTP/i.test(m) && device.ptpEthernetLink === "DOWN")

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 Limit link-down mapping to actual PTP failures

When the board reports PHY DOWN, this condition classifies every message containing PTP as a start failure regardless of the failure argument or message semantics. For example, the existing successful Copy diagnostics path sends "PTP and firmware diagnostics copied." from PtpExpertPanel.qml, but in the common link-down troubleshooting state it now displays the Ethernet-disconnected error instead of confirming the copy; restrict this fallback to start/failure messages rather than all PTP text.

Useful? React with 👍 / 👎.

Comment on lines +418 to +419
const notice = operatorNotice(raw, error === true)
if (!notice) 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 Keep routine footer messages transient

For routine messages that operatorNotice() intentionally ignores, this return occurs after assigning statusMessage but before starting messageTimer. Calls such as the existing AC/DC mode notifications therefore remain in the footer indefinitely, whereas previously every showMessage() call restarted the timer; clear these messages with a separate footer timer or preserve the prior timer behavior even when no toast is created.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Final UX engineering checkpoint (2026-10-21) — exact HEAD artifact

PR #272 HEAD a03da5e5a1de13daa9aa30bf23ed08419b4178d4 (stacked onto #271 and previous field fixes), OPEN, unmerged to main. All 4 workflows SUCCESS on exact head: Product Naming Guard, ARStack Studio Qt (workspace contract, native deterministic harness, headless QML launch, Hi-DPI smoke), Windows Lifecycle, ARStack Studio Native Preview with matched embedded firmware and clean install/upgrade/uninstall/NSIS migration.

Operator-centered UX implemented

  • The 36px bottom-only informational toast is replaced by a calm, 490px width center-screen actionable toast in Main AND the distinct Advanced native QML Window, with readable concise headline, a board-specific remedy, auto-dismiss 4.6s for faults and 2.8s for confirmations.
  • Main's prior onDeviceMessage(message) unconditionally classified C++ setError() as informational; it now labels device errors correctly via lastError, along with terminal SmartSessionController states, PTP START terminal failure, firmware update failure and confirmed success, last physical SV STOP cause, and captured/copy status messages. Common causal actions: ETHERNET_LINK_DOWN -> connect ESP32-P4 physical Ethernet to live switch/laptop and wait LINK; driver STOPPED, ETHERNET_TX_INVALID_STATE, session heartbeat expiry, runtime fault, PTP failed, firmware/profile/capture failure. Raw evidence stays in event history and Copy diagnostics.
  • One notification policy, dedupe/priority (repeat events don't flood GUI; an actionable repeated PTP START is a fresh intent); session error state transitions only; verified physical PHY DOWN→UP can notify recovery. Toast disappearing never silently changes board state or marks a failure resolved.
  • Default courtesy PTP SOURCE attempt is inhibited if last board ETH readback reports PHY DOWN or driver STOPPED: no doomed START or spurious surprise OFF, one actionable request to connect network. Board firmware on fix(p0): gate PTP SOURCE on real Ethernet link, preserve INVALID_STATE and fail clearly in Studio #271 still owns true ETH_EVENT and 3-frame verified SOURCE start safety.

Native Windows preview artifact: https://github.com/masarray/arstack61850/actions/runs/39550746804/artifacts/12323972267 (GitHub zipped artifact). Extracted installer EXE only ARStack-Studio-Preview-win-x64-setup.exe size 31,036,616 bytes, SHA256 5a78b1053458e46adc8c5b0f0c5bcce2d409faefb3105f595785de6f339e74f7; independently verified against SHA256SUMS.txt in build. Exact installed firmware build ID a03da5e5a1de13da (prefix 16 hex).

Next physical check: installing matched Studio+firmware and triggering SOURCE with ETH UNPLUGGED must show center-screen Indonesian connect-cable action and OFF, never fake SOURCE running/LOCK; with Ethernet connected and link UP, START needs actual Announce/Sync/Follow_Up evidence. Test central notices in both Main and Advanced and confirm no repeated toast spam. SV/PTP 1-hour endurance and relay interoperability remain NOT ACCEPTED; do not merge/release from CI alone.

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