Skip to content

Add Re-index action to workspace chooser tile menu (CS-11741)#5384

Open
FadhlanR wants to merge 7 commits into
mainfrom
reindex-queue-double-click
Open

Add Re-index action to workspace chooser tile menu (CS-11741)#5384
FadhlanR wants to merge 7 commits into
mainfrom
reindex-queue-double-click

Conversation

@FadhlanR

@FadhlanR FadhlanR commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

CS-11741

What

Adds a Re-index item to the "..." (kebab) menu on each owned workspace tile in the workspace chooser. Previously the only way to re-index a workspace was the admin _full-reindex endpoint.

The action calls the existing RealmService.fullReindex(), which POSTs to the realm's _full-reindex endpoint and wraps the call in the indexing animation (self-restoring on error). No backend changes.

Details

  • Owner-gated: the item only appears on tiles the user owns (mirrors the Archive item's canReindexWorkspace shape).
  • Disabled while indexing: gated on the live realmInfo.isIndexing flag rather than task.isRunning. The dropTask resolves the instant the 204 lands (sub-second), while the reindex itself runs much longer — isIndexing stays true for the whole pass. Repeat clicks are server-safe regardless (the reindex queue coalesces them), so this guard is purely a UX nicety.
  • Visible feedback: the tile's RealmIcon now passes @canAnimate={{true}} (as the card URL bar already does), so the indexing pulse shows for the whole queued→running→done window.
  • Failure handling: a failed reindex surfaces an auto-dismissing inline error on the tile.

Tests

New dedicated acceptance module workspace-chooser-reindex-test.gts (mirrors the sibling archive test + the full-reindex-realm integration test): owner-gating, POST-to-endpoint + tile animation, disabled-while-indexing, and failure surfacing an inline error.

Verification

  • pnpm lint:js — clean
  • pnpm lint:types — no new errors (only the pre-existing baseline boxel-ui module-resolution noise)
  • Acceptance suite run pending (local dev stack still coming up); will confirm on this PR.

Screen Recording

Screen.Recording.2026-07-02.at.16.53.42.mov

🤖 Generated with Claude Code

Surface a Re-index item in the "..." menu on each owned workspace tile.
It calls RealmService.fullReindex(), which POSTs to the realm's
_full-reindex endpoint and manages the indexing animation. The tile's
RealmIcon now passes @canAnimate so the indexing pulse is visible for the
whole reindex window, and the menu item is owner-gated and disabled while
the realm is indexing. Failures surface an auto-dismissing inline error on
the tile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@FadhlanR FadhlanR changed the title Add Re-index action to workspace chooser tile menu Add Re-index action to workspace chooser tile menu (CS-11741) Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

    1 files      1 suites   2h 35m 13s ⏱️
3 377 tests 3 362 ✅ 15 💤 0 ❌
3 396 runs  3 381 ✅ 15 💤 0 ❌

Results for commit dcc1935.

Realm Server Test Results

    1 files      1 suites   8m 57s ⏱️
1 674 tests 1 674 ✅ 0 💤 0 ❌
1 753 runs  1 753 ✅ 0 💤 0 ❌

Results for commit dcc1935.

FadhlanR and others added 2 commits July 2, 2026 13:16
…ggling

The disabled-while-indexing test reopened the tile menu before the final
assertion, but the menu was already open from the disabled check, so the
extra trigger click toggled it shut and the Re-index item no longer
existed. The menu item's disabled state is derived from the live indexing
flag and updates in place, so assert on the still-open menu after the
index event instead.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…n test

Fall back to String(error) when a thrown value has no message, so the
inline reindex-error banner always renders. Emit a `full` index-completion
event in the acceptance test to mirror the `_full-reindex` action it triggers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@FadhlanR FadhlanR marked this pull request as ready for review July 2, 2026 10:03
@FadhlanR FadhlanR requested a review from a team July 2, 2026 10:03
@habdelra habdelra requested a review from Copilot July 2, 2026 13:16

Copilot AI 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.

Pull request overview

Adds a user-facing Re-index action to the workspace chooser tile “…” menu for owned workspaces, wiring it to the existing RealmService.fullReindex() behavior and surfacing progress/error feedback in the tile UI.

Changes:

  • Adds an owner-gated Re-index menu item that POSTs to /_full-reindex and disables while realmInfo.isIndexing is true.
  • Enables indexing pulse animation on workspace tiles by passing @canAnimate={{true}} to RealmIcon.
  • Adds acceptance coverage for owner gating, endpoint invocation + animation, disable-while-indexing, and inline error display.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/host/tests/acceptance/workspace-chooser-reindex-test.gts New acceptance module covering the Re-index menu item behavior and UI feedback.
packages/host/app/components/operator-mode/workspace-chooser/workspace.gts Adds the Re-index menu item, inline error display, and tile icon animation support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1361 to +1365
// Auto-dismiss after a few seconds. A plain setTimeout (not an
// ember-concurrency timeout) so it does not keep test `settled()` waiting.
this.reindexErrorTimer = setTimeout(() => {
this.reindexError = undefined;
}, 5000);
Comment on lines +1360 to +1365
this.reindexError = String(error?.message ?? error);
// Auto-dismiss after a few seconds. A plain setTimeout (not an
// ember-concurrency timeout) so it does not keep test `settled()` waiting.
this.reindexErrorTimer = setTimeout(() => {
this.reindexError = undefined;
}, 5000);

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.

do we really want errors to auto dismiss?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[Claude Code 🤖] Good call — agreed it shouldn't auto-dismiss. Removed the timer entirely. The failure now renders as a persistent banner across the top of the tile and stays until the user closes it with the banner's ✕ button (or it clears automatically when they retry the reindex). This also drops the stale-timer bookkeeping Copilot flagged.

reindex error banner

FadhlanR and others added 4 commits July 3, 2026 13:25
The reindex failure error no longer disappears on a timer. It now renders
as a banner across the top of the workspace tile and stays until the user
closes it with the banner's dismiss button or retries the reindex. Removing
the auto-dismiss timer also drops the stale-timer-handle bookkeeping.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A long server error body no longer grows the banner past the tile and over
the workspace name. The message is clamped to three lines with an ellipsis
and the full text stays available via the element's title on hover.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

3 participants