Skip to content

feat(tray): app health in the tray tooltip and menu - #314

Merged
rowkav09 merged 2 commits into
mainfrom
feat/tray-health
Sep 23, 2026
Merged

rowkav09 merged 2 commits into
mainfrom
feat/tray-health

Conversation

@rowkav09

Copy link
Copy Markdown
Member

Closes #121

  • New GET /api/tray on the status handler, with the same same-origin guard. It returns { status, action, text } built with the existing createTrayHealth model (feat: add privacy-safe tray health state #184) from the live app status.
  • The tray adds a greyed-out line at the top of the menu and uses the same text as the tooltip. It refreshes every 15 seconds. Possible lines: "working", "starting...", "can't reach your server", "sign-in rejected, run setup", "no update from the server lately", "Discord needs attention", or "not responding" if the app doesn't answer.
  • Never includes track, user name or server address. Capped at 63 characters (the Windows tooltip limit).
  • A closed Discord counts as fine, not a problem.
  • For fixes, "Open dashboard" (right below the line) goes to the status page, which shows what's wrong and has the diagnostics button.
  • Tests: health transitions, stale data, sign-in failure, privacy and length, the endpoint and its cross-site 403. The Windows tray self-test is updated for the new menu items.

@mira-reviewer-rk

mira-reviewer-rk Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Mira PR Walkthrough

This PR adds app health monitoring to the system tray tooltip and menu. It implements a new API endpoint /api/tray that returns health status information, updates the tray to display health status with a greyed-out menu line and tooltip, and adds corresponding tests. The health status is derived from existing app status monitoring and includes various states like "working", "starting...", or error messages.

⚠️ Potential overlap with other open PRs — these may be stepping on this one:

  • #311 (merge-conflict risk) — Both PRs modify test/app-status.test.js, creating a direct merge conflict. Shared: test/app-status.test.js

5 files reviewed · 1 comment (⚠️ 1 warning)


Comment @mira-reviewer-rk help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

/mira pause

@github-actions github-actions Bot added area:server area:tray mira-paused Pause automatic Mira reviews on this pull request size:M labels Sep 23, 2026
@codecov

codecov Bot commented Sep 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@mira-reviewer-rk mira-reviewer-rk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mira Review Summary

The review notes that test/app-status.test.js:167 is missing coverage for the tray endpoint's cross-site guard, a maintainability concern. No other issues are listed.

Comment thread test/app-status.test.js
@@ -167,3 +167,39 @@ test("status and diagnostics show validated build details (#119)", () => {
assert.equal(broken.snapshot().build, null);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Refactor suggestion
⚠️ Warning

Missing test coverage for tray endpoint cross-site guard

The test 'tray endpoint serves the same line' includes a cross-site request check (sec-fetch-site: cross-site). However, the test does not verify that the guard works for other unsafe sites (e.g., 'cross-origin', 'same-origin' but with wrong value). The test only checks cross-site returns 403. It should also verify that same-site requests (undefined or 'same-origin') succeed. The existing test for /api/status may have such coverage. Since the guard is shared across all API endpoints, the test coverage is adequate but could be more explicit.


Prompt for AI Agents
Add a test case to verify that same-origin requests (undefined sec-fetch-site or 'same-origin') succeed for /api/tray endpoint, ensuring the guard works correctly.

Not useful? Reply @mira-reviewer-rk reject to dismiss this suggestion.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added same-site (403), same-origin (200) and none/direct (200) cases next to the cross-site one.

@rowkav09
rowkav09 merged commit a5e0f3f into main Sep 23, 2026
12 of 13 checks passed
@rowkav09
rowkav09 deleted the feat/tray-health branch September 23, 2026 23:51
@github-project-automation github-project-automation Bot moved this from Backlog to Done in nowplaying Sep 23, 2026
This was referenced Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:server area:tray mira-paused Pause automatic Mira reviews on this pull request size:M

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add privacy-safe health status to the Windows tray

1 participant