Skip to content

fix: wake a sleeping engine before listing its snapshots - #2268

Merged
geodro merged 2 commits into
mainfrom
fix/snapshots-sleeping-engine
Oct 21, 2026
Merged

geodro merged 2 commits into
mainfrom
fix/snapshots-sleeping-engine

Conversation

@geodro

@geodro geodro commented Oct 21, 2026

Copy link
Copy Markdown
Member

Opening an engine's Snapshots tab, whether from the Services page or the camera button on a site's service card, showed "No snapshots yet" whenever the engine was asleep. The tab asked for the listing straight away, an asleep engine answers with no databases, and since the snapshots ride along with those databases the list came back empty and nothing asked again once the engine was up.

The tab now does what the Databases tab already does: it keeps the engine awake while open, shows a loading row until the engine is ready, and only then loads the listing. A stopped engine shows the start hint instead of claiming there are no snapshots.

Opening an engine's Snapshots tab, whether from the Services page or the camera button on a site's service card, showed "No snapshots yet" whenever the engine was asleep. The tab asked for the listing straight away, an asleep engine answers with no databases, and the snapshots ride along with those databases, so the list came back empty and nothing asked again once the engine was up.

The tab now does what the Databases tab already does: it keeps the engine awake while open, shows a loading row until the engine is ready, and only then loads the listing. A stopped engine shows the start hint instead of claiming there are no snapshots.
@geodro
geodro requested a review from a team as a code owner October 21, 2026 09:26
@geodro geodro added the no-ui-change Touches UI files without a visible change; skips the screenshot check label Oct 21, 2026
@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with both previous findings fixed.

Summary

The Snapshots tab wakes sleeping engines, waits before requesting their snapshots, and asks users to start stopped engines.

  • The Snapshots tab waits for a sleeping engine to wake before listing snapshots.

Reviews (2) · Last reviewed commit: "docs: say the Snapshots tab wakes a slee..." · Reviewed by Greptile

Comment on lines +340 to +343
{#if stopped}
<p class="text-sm text-gray-500 dark:text-gray-400">{m.databases_startHint()}</p>
{:else if !up}
<LoadingRow />

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 Wake behavior is undocumented

This changes what users see for sleeping and stopped engines, but no documentation changes accompany it. CLAUDE.md requires a relevant docs/ update for every behavior change. Before merging, document that opening Snapshots wakes a sleeping engine and that a stopped engine must be started.

Context Used: CLAUDE.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: internal/ui/web/src/tabs/services/ServiceSnapshotsTab.svelte
Line: 340-343

Comment:
**Wake behavior is undocumented**

This changes what users see for sleeping and stopped engines, but no documentation changes accompany it. `CLAUDE.md` requires a relevant `docs/` update for every behavior change. Before merging, document that opening Snapshots wakes a sleeping engine and that a stopped engine must be started.

**Context Used:** CLAUDE.md ([source](https://github.com/lerd-env/lerd/blob/main/CLAUDE.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

Fair, the Snapshots tab entry in the web UI docs now says opening it wakes a sleeping engine and that a stopped one has to be started first. In e412a34.

Comment on lines +43 to +46
// The snapshots ride along with the engine's databases, so the tab reads the
// same listing the Databases tab does rather than fetching its own, and skips
// a service that has no databases for the same reason it does.
// a service that has no databases for the same reason it does. An asleep
// engine lists nothing, so it is woken the same way and asked once ready.

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 Comment exceeds the limit

This expands the comment from three lines to four. CLAUDE.md limits comment blocks to two or three lines. Before merging, shorten it while keeping the reason for waiting until the engine is ready.

Suggested change
// The snapshots ride along with the engine's databases, so the tab reads the
// same listing the Databases tab does rather than fetching its own, and skips
// a service that has no databases for the same reason it does.
// a service that has no databases for the same reason it does. An asleep
// engine lists nothing, so it is woken the same way and asked once ready.
// Snapshots arrive with the engine's databases. A sleeping engine lists
// nothing, so wake it and wait until it is ready before loading.

Context Used: CLAUDE.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: internal/ui/web/src/tabs/services/ServiceSnapshotsTab.svelte
Line: 43-46

Comment:
**Comment exceeds the limit**

This expands the comment from three lines to four. `CLAUDE.md` limits comment blocks to two or three lines. Before merging, shorten it while keeping the reason for waiting until the engine is ready.

```suggestion
  // Snapshots arrive with the engine's databases. A sleeping engine lists
  // nothing, so wake it and wait until it is ready before loading.
```

**Context Used:** CLAUDE.md ([source](https://github.com/lerd-env/lerd/blob/main/CLAUDE.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

Trimmed it to two lines, keeping why it waits for the engine to be ready. In e412a34.

@geodro
geodro merged commit 28a6e06 into main Oct 21, 2026
12 checks passed
@geodro
geodro deleted the fix/snapshots-sleeping-engine branch October 21, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-ui-change Touches UI files without a visible change; skips the screenshot check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant