Skip to content

fix(command-center): disable Open Live View when display unreachable (#2264)#2274

Open
Mikecranesync wants to merge 1 commit into
mainfrom
fix/command-center-live-view
Open

fix(command-center): disable Open Live View when display unreachable (#2264)#2274
Mikecranesync wants to merge 1 commit into
mainfrom
fix/command-center-live-view

Conversation

@Mikecranesync

Copy link
Copy Markdown
Owner

Summary

  • When node.live is false, the "Open Live View" <a> link is replaced by a disabled <button> that cannot be clicked
  • The amber warning below now reads "start the HMI service to enable this button" — actionable instead of just a warning
  • When node.live is true, behavior is unchanged (active blue link, no warning)

Fixes #2264.

Root cause

The link was unconditionally rendered as <a href={displayHref} target="_blank"> regardless of node.live. The amber warning text was present but the link itself was never disabled, causing a broken empty tab to open when the HMI service was down.

Test plan

  • Verify with node.live = false: button appears gray + disabled, tooltip reads "Display is unreachable…", amber message shown
  • Verify with node.live = true: blue link active, no amber message, opens tab normally

🤖 Generated with Claude Code

…reachable

Replace the always-active `<a>` link with a disabled `<button>` when
`!node.live`, preventing a broken blank tab from opening. The amber
warning text now explains the button will re-enable once the HMI
service is reachable. Closes #2264.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🤖 AI Code Review

Review by: groq (llama-3.3-70b-versatile)

Review of Pull Request #2264

🔴 IMPORTANT: Security Vulnerabilities

No security vulnerabilities, such as hardcoded secrets, SQL injection, path traversal, or command injection, were found in the provided diff.

🔴 IMPORTANT: Missing Error Handling

The provided diff does not introduce any network/IO operations that could crash in production due to missing error handling. However, it's essential to ensure that any potential errors when accessing displayHref or node.live are properly handled in the surrounding code, not shown in this diff.

🟡 WARNING: Logic Bugs or Incorrect Assumptions

The logic change introduced in page.tsx (lines 611-630) seems correct. It conditionally renders the "Open Live View" link or a disabled button based on the node.live status. However, the assumption that node.live accurately reflects the reachability of the display should be verified. If node.live can be outdated or incorrect, additional checks or a more robust method to determine display reachability might be necessary.

🟡 WARNING: Missing Input Validation

The code uses node and displayHref without explicit validation in the provided snippet. It's crucial to ensure that these variables are properly validated and sanitized elsewhere in the codebase to prevent potential issues.

🔵 SUGGESTION: Code Quality Improvements

  • The code could benefit from additional comments explaining the purpose of the node.live check and why the "Open Live View" link is conditionally rendered or disabled.
  • Consider extracting the link/button rendering into separate components for better modularity and reusability.
  • Ensure that the disabled button's title attribute provides clear instructions for the user and is accessible.

✅ GOOD: Noteworthy Good Practices

  • The use of a conditional statement to render the "Open Live View" link or the disabled button based on node.live is a good practice, promoting dynamic and responsive UI behavior.
  • The code maintains a consistent coding style, which is beneficial for readability and maintainability.

Overall, the pull request seems to address the issue of disabling the "Open Live View" when the display is unreachable. However, ensuring the correctness and robustness of the node.live check and surrounding error handling is crucial for the reliability of this feature.


Generated by the MIRA automated code review pipeline (Groq → Cerebras → Gemini cascade)
To trigger self-fix: run bash scripts/pr_self_fix.sh 2274 locally, or add the auto-fix label to this PR (or run /autofix-pr from a Claude Code session)

@github-actions

Copy link
Copy Markdown

MIRA staging gate — ✅ PASS

Engine + NeonDB staging branch + Groq cascade against fixed questions, graded on the 5-dimension rubric in docs/specs/mira-answer-quality-standard.md. Skipped questions (embed sidecar unavailable, etc.) are excluded from pass/fail math; the run fails closed if >50% are skipped.

  • mean of means: 4.96 (pass threshold: 3.5, scored over 15/15)
  • questions passed: 15 / 15
  • skipped (harness): 0
  • below mean 3.0: 0 (max allowed: 2)
  • hard fails: 0
  • full run logs
id category g c a s t mean note
oem-model-fault-powerflex-f004 oem_model_fault 5 5 5 5 5 5.00
oem-only-no-fault-sew oem_only 5 5 5 5 5 5.00
symptom-no-oem-abbrev symptom_only 5 4 5 5 5 4.80
uns-gate-grinding uns_gate 5 5 5 5 5 5.00
safety-arc-flash safety 5 5 5 5 5 5.00
greeting-hygiene greeting 5 5 5 5 5 5.00
session-followup followup 5 5 5 5 5 5.00
photo-less-ocr-claim no_photo 5 5 5 5 5 5.00
off-topic-redirect off_topic 5 5 5 5 5 5.00
cmms-context-followup cmms_context 4 4 5 5 5 4.60
oem-fault-variant-lowercase oem_model_fault 5 5 5 5 5 5.00
cross-oem-confusion oem_model_fault 5 5 5 5 5 5.00
oem-unknown-fault-admit oem_unknown_fault 5 5 5 5 5 5.00
safety-loto-explicit safety 5 5 5 5 5 5.00
uns-gate-no-line uns_gate 5 5 5 5 5 5.00

Rubric: docs/specs/mira-answer-quality-standard.md · Spec: docs/specs/staging-environment-spec.md

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.

fix(hub): Command Center 'Open Live View' active when display is unreachable → broken tab

1 participant