Skip to content

fix(assets): name store-app assets from their chosen setting, not the manifest name#3115

Merged
vpetersson merged 2 commits into
masterfrom
fix/rss-reader-asset-name
Jul 6, 2026
Merged

fix(assets): name store-app assets from their chosen setting, not the manifest name#3115
vpetersson merged 2 commits into
masterfrom
fix/rss-reader-asset-name

Conversation

@vpetersson

Copy link
Copy Markdown
Contributor

Issues Fixed

Adding multiple RSS Reader apps produced several assets all named "RSS Reader" instead of being named after the chosen feed. (Regression surface from the signage app store added in #3114.)

Description

Store apps like the RSS Reader are one generic app configured per install via a labelled select (the feed). The install form seeded the asset name once from the static manifest name ("RSS Reader") and never updated it, so every install got the identical name.

  • Derive the default asset name from the chosen option's label (e.g. the feed's title NPR — Top Stories) — the first select with x-enumLabels, in manifest order, so it's generic rather than RSS-specific. Apps without such a setting keep the manifest name.
  • The name tracks config changes until the operator types their own; an @input flag then stops the derivation so a custom name is never clobbered. Reset on re-select / back.

Two source files change; the built JS bundle is gitignored and rebuilt at image-build time.

Verification: tsc --noEmit clean, production bundle builds, and the real appsTab() component was driven through the add-app flow against the live RSS manifest (default = feed title, tracks feed changes, preserves a custom name after edit, resets on re-select).

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

🤖 Generated with Claude Code

… manifest name

Store apps like the RSS Reader are one generic app configured per
install via a labelled select (the feed). The install form seeded the
asset name once from the static manifest name ("RSS Reader") and never
updated it, so adding several RSS Reader feeds produced multiple assets
all named "RSS Reader".

Derive the default name from the chosen option's label (e.g. the feed's
title "NPR — Top Stories") — the first select with x-enumLabels, in
manifest order, so it is generic rather than RSS-specific. The name
tracks config changes until the operator types their own, at which point
an @input flag stops the derivation so a custom name is never clobbered.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vpetersson vpetersson requested a review from a team as a code owner July 6, 2026 09:22
@vpetersson vpetersson self-assigned this Jul 6, 2026
@vpetersson vpetersson requested a review from Copilot July 6, 2026 09:22

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

Pull request overview

Fixes a regression in the “Add Asset → Apps” flow where multiple installs of a generic store app (e.g., RSS Reader) would all be named after the static manifest name, by deriving the default asset name from the chosen labeled select option and preventing subsequent config edits from clobbering an operator-edited name.

Changes:

  • Add suggestedName() to derive a default asset name from the first select setting that provides x-enumLabels, falling back to the manifest name.
  • Track an operator edit via nameEdited and stop auto-deriving the asset name once the name field is manually changed.
  • Wire the name input to set nameEdited on user input.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/anthias_server/app/templates/_asset_modal.html Marks the app name field as operator-edited on input to prevent later auto-derivation clobbering it.
src/anthias_server/app/static/src/apps.ts Implements derived default naming from config, adds nameEdited state, and updates naming behavior on selection/config changes.

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

Comment thread src/anthias_server/app/static/src/apps.ts Outdated
Comment thread src/anthias_server/app/static/src/apps.ts Outdated
Comment thread src/anthias_server/app/static/src/apps.ts Outdated
Address PR review feedback on the store-app asset-name fix:

- Extract selectOptionLabel() so the manifest-form select renderer and
  the asset-name derivation resolve an option's text the same way. A
  chosen option with a missing x-enumLabels entry now names the asset
  after the raw value the operator sees, instead of silently reverting
  to the manifest name.
- Move the derivation into apps/suggested-name.ts (DOM-free) and add
  unit tests: default/updated select value, manifest-name fallback,
  first-labelled-select ordering, missing-label consistency, and a
  stray non-option value.
- Wire the package.json test script to `bun test` now that real .test.ts
  files exist, and correct the stale assetName comment (it binds the
  visible Name input, not a hidden one).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vpetersson vpetersson requested a review from Copilot July 6, 2026 16:35
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@vpetersson vpetersson merged commit ebb9741 into master Jul 6, 2026
9 checks passed
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.

2 participants