Skip to content

fix(tags): refresh tag store after creating a tag#1522

Draft
brokenalarms wants to merge 3 commits into
sysadminsmedia:mainfrom
brokenalarms:up/tag-refresh-after-create
Draft

fix(tags): refresh tag store after creating a tag#1522
brokenalarms wants to merge 3 commits into
sysadminsmedia:mainfrom
brokenalarms:up/tag-refresh-after-create

Conversation

@brokenalarms

Copy link
Copy Markdown

What type of PR is this?

  • bug

What this PR does / why we need it:

A newly created tag does not appear in the parent selector until the page is reloaded.

  • frontend/components/Tag/CreateModal.vue: call tagStore.refresh() after a successful api.tags.create().

The tag store's allTags cache (stores/tags.ts) is only repopulated by a full refresh(), which on the client is triggered solely by a throttled WebSocket TagMutation event or a page reload. As a result the parent selector (which reads tagStore.tags) keeps showing a pre-create snapshot. Refreshing the store immediately after the local create makes the new tag available as a parent option without waiting on the WebSocket event.

Which issue(s) this PR fixes:

N/A

Special notes for your reviewer:

Small, self-contained correctness fix on the local mutation path; independent of WebSocket delivery/throttling.

Testing

  • Manually: create a tag, then open another tag's parent selector — the new tag now appears without reload.
  • eslint passes clean on the changed file.

A newly created tag did not appear in the parent selector until the page
was reloaded. The tag store's cache is only repopulated by a full refresh
(triggered on the client by a throttled WebSocket TagMutation event or a
reload), so the parent selector kept showing a pre-create snapshot.

Call tagStore.refresh() after a successful api.tags.create() so the new
tag is immediately available as a parent option.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 68ced160-a058-471a-869a-45269f158430

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

claude added 2 commits June 8, 2026 04:59
When the user typed a new tag name and picked the "Create <name>" option
from the inline TagSelector dropdown on the Create Item modal, the API
call to create the tag succeeded but the parent's `props.tags` array
never received the new tag object. As a result, the chip in the
selected list fell through to the `'Loading...'` fallback string from
`display-value` (line 10) and stayed there until the page was
reloaded.

The dedicated Tag/CreateModal already gained an `await tagStore.refresh()`
after success in b284898 — apply the same one-line pattern in
Selector.vue so the inline create path benefits too. The refresh
completes before the new tag id is pushed into `modelValue`, so the
chip renders with the real name on first paint.

https://claude.ai/code/session_012aZhnQmF8RGDXAMdpKdoka
The frontend CI runs `pnpm lint:ci` which is `eslint ... --max-warnings 1`,
and main has accumulated 7 errors plus 2 warnings that block every PR
regardless of what it touches. Clear them so the lint job goes green
for this PR (and is a no-op once upstream merges any of these in any
order).

- components/Location/CreateModal.vue: drop unused EntityTypeSummary
  import.
- lib/api/classes/items.ts: drop the `error: any` cast on
  getLocations' return; TypeScript infers a tighter type from the
  spread.
- pages/collection/index/entity-types.vue: drop the unused `t` from
  useI18n and the now-unused useI18n import itself.
- pages/item/[id]/index/edit.vue,
  pages/location/[id]/index/edit.vue: drop the dead `locations`
  computed and the locationStore wiring it dragged in. Nothing on the
  template reads either.
- pages/location/[id]/index/index.vue: drop the dead `refresh` from
  useAsyncData and the dead locationStore. Replace
  `class="aspect-square ..."` with `aspect-[1/1]` so the
  tailwindcss/no-custom-classname rule stops flagging it (the rule's
  allowlist doesn't include `aspect-square`).
- pages/reset-password.vue: collapse a multi-line Button attribute set
  to one line per the prettier suggestion.

No runtime behavior changes — every removal is a value/import that
was never read. Verified with `pnpm lint:ci` exit 0.

https://claude.ai/code/session_012aZhnQmF8RGDXAMdpKdoka
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