Skip to content

fix(signage-manager): keep templates on their live ID - #536

Merged
MrYuion merged 4 commits into
developfrom
fix/signage-manager-templates
Oct 2, 2026
Merged

MrYuion merged 4 commits into
developfrom
fix/signage-manager-templates

Conversation

@MrYuion

@MrYuion MrYuion commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

On the templates page:

  • Deep links: a deep link past the first page selected nothing.
  • Draft ids: a template with pending changes was stored under its draft id, so approve, undo and edits returned 404. This was already true after an in-app layout save.
  • Lists: failed loads looked like "No templates", and every edit cleared the list.
  • Undo: "Undo changes" deleted the draft without asking.
  • Floating layouts: with no saved position they previewed at 0% in the manager but showed at 50% on screens.

Changes

  • Deep links: loadTemplate(id) fetches an unmatched route id. A link opened during a search does not join the results.
  • Live ids: templates are kept and routed under their live id. Drafts this session fetched or saved stay over their live record until they are approved, undone or deleted.
  • List: error with Retry, the server total in the header, and rows kept on screen across reloads. A deleted template is dropped at once and its route left.
  • Undo: asks for confirmation. The request-approval modal shows a versions error.
  • Apply template: shows loading and catches errors. Remove and save failures no longer reject.
  • Smaller fixes: names decoded in the approved and mapping lists, distinct panel ids, pluginName reused, and resolvePlugin checks the cache first.
  • Floating layouts: the manager default is 50%, matching the player, with a comment to keep them in step.

Testing

  • Unit tests for each fix. Each fails without its fix.
  • nx test signage-manager (994) and nx build signage-manager pass.
  • Local PlaceOS stack, with 210+ templates and real draft responses: deep links, held drafts across pages and reloads, approve and undo releasing drafts, layout save then approve, search with a selection, list errors, undo confirm, apply-template errors, & names, floating 50%, delete.

Notes

  • A draft made outside this session shows as approved until it is opened, because the template index never returns drafts.
  • Backend: the index ignores approved=true, and the paged next link skips one row per page.

Independent of the other signage PRs from this review. Based on develop.


Changes made by Claude Opus 5.5 (1M context) in Claude Code, running in T3 Code.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 2, 2026

Copy link
Copy Markdown

Deployment failed for project frontend-templates with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/placeos?upgradeToPro=build-rate-limit

@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Refactors template state handling and UI feedback across the signage manager.

The PR appears safe to merge, though a timing-dependent link retry can still be missed.

Findings

  1. P2 Failed link cannot retry ▶

Summary

The signage manager now keeps template links and pending edits tied to each template’s live ID, and makes list loading, undo, and template-mapping flows clearer. It also aligns floating-layout previews with the player and includes a few focused display and lookup fixes.

  • Deep links can open templates outside the loaded pages, and drafts stay under their live IDs.
  • The list shows the server total, offers Retry after load errors, and keeps rows visible during reloads.
  • Undo asks for confirmation, while mapping and preview flows show loading or error feedback.
  • Floating layouts without saved positions start at 50% on both axes, matching the player.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Template route opens] --> B{ID in loaded list?}
  B -->|Yes| C[Select listed template]
  B -->|No| D[Fetch template by ID]
  D --> E{Group unchanged?}
  E -->|No| F[Discard response]
  E -->|Yes| G[Keep live ID and select template]
Loading

Reviews (2) · Last reviewed commit: "fix(signage-manager): open template link..."

Comment thread apps/signage-manager/src/app/templates/signage-template.service.ts
Comment on lines +436 to +437
this._fetched_id = id;
void this._selectFetchedTemplate(id);

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 Failed link cannot retry

_fetched_id is set before loadTemplate finishes. If the request fails, it returns null, but the ID remains marked as fetched. Retrying or reloading the list then cannot fetch the link again. Clear that marker on failure or give the linked template its own retry.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 3e43afb. When loadTemplate returns null, _fetched_id is cleared, so the next list reload or retry fetches the link again. A request that is still running is not sent twice. Test: "tries a failed link again when the list changes".

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Follow-up in f0dbfe1 for the timing case: if the list had already reloaded while the link fetch was pending, a later failure left nothing to re-run the route effect. The service now counts the user's list retries (templates_retries, bumped in reloadTemplates()), and the route effect reads it, so Retry fetches the failed link once more even when the list itself does not change. Nothing retries automatically, and a link still loading is fetched only once. Test: "tries a failed link again when the user retries the list".

Comment thread apps/signage-manager/src/app/templates/signage-template.service.ts
@greptile-apps

This comment has been minimized.

@MrYuion

MrYuion commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

Re the outside-diff findings, both fixed in 3e43afb:

  • Empty list blocks template links (templates.component.ts:381): the route effect now waits for a new templates_ready signal (list queried, no page loading) instead of for rows, so a link opens when the list is empty but not before the first page has loaded. Tests: "opens a linked template when the loaded list has no rows" and "waits for the first page before it fetches a linked template".
  • Old selection overrides new link (templates.component.ts:425): the branch that routed back to the current selection is removed. It existed only for draft-id links, and routing now always uses the live id. A link not in the list is fetched unless it is the current selection. Test: "fetches a linked template instead of returning to the selected one".

@greptile-apps greptile-apps 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.

Your organization has used all 50 credits included in the free plan this billing period. To keep receiving reviews, upgrade your plan.

Comment thread apps/signage-manager/src/app/templates/template-layout.util.ts Outdated
@vercel

vercel Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
frontend-templates Ignored Ignored Preview Oct 2, 2026 5:42am UTC

- Open a linked template past the first page.
- Keep templates under their live ID and hold pending drafts until they
  are approved, undone or deleted.
- Show a list error with Retry and the server total.
- Confirm before undoing changes.
- Show loading and errors when applying templates.
- Decode names in the approved template and mapping lists.
- Place floating layouts with no position at 50%, as the player does.
- Drop a deleted template from the list and leave its route.
…e it runs

- A template fetched for a link is dropped if the group changed while
  it loaded.
- A failed link fetch is tried again on the next list change.
- Links open once the first page has loaded, even when the list is
  empty, and a link to another template is fetched instead of routing
  back to the current selection.
- The undo confirmation cannot be dismissed while the draft is removed.
If a link fetch failed after the list had already reloaded, nothing
re-ran the route effect. The service counts list retries and the route
effect reads the count, so the next Retry fetches the link again.
A floating panel with no saved position now defaults to 0, 0, so it
fills the frame. The player makes the same change in #528.
@MrYuion
MrYuion force-pushed the fix/signage-manager-templates branch from 362a590 to 0163317 Compare October 2, 2026 05:49
@MrYuion
MrYuion merged commit 837a6b5 into develop Oct 2, 2026
1 of 2 checks passed
MrYuion added a commit that referenced this pull request Oct 2, 2026
A floating template item with no saved position now defaults to 0, 0,
so it fills the frame, matching the manager preview (#536).
@MrYuion
MrYuion deleted the fix/signage-manager-templates branch October 2, 2026 05:59
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