Skip to content

fix: use unique temp_ prefix for unregistered tags to avoid duplicate each keys (#3509)#3510

Merged
KATO-Hiro merged 1 commit intostagingfrom
#3509
May 9, 2026
Merged

fix: use unique temp_ prefix for unregistered tags to avoid duplicate each keys (#3509)#3510
KATO-Hiro merged 1 commit intostagingfrom
#3509

Conversation

@KATO-Hiro
Copy link
Copy Markdown
Collaborator

@KATO-Hiro KATO-Hiro commented May 9, 2026

close #3509

Summary by CodeRabbit

リリースノート

  • バグ修正
    • インポートされたタグのUIハンドリングを改善しました。データベースに未保存の一時的なタグは「未登録」と表示され、編集リンクは表示されなくなります。これにより、新規タグと既存タグの区別がより明確になりました。

スコープの対象外

  • タグ機能の根本的な再設計

… each keys

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 9, 2026

📝 Walkthrough

Walkthrough

タグの一時的ID(データベース未登録)の命名規則を 'undefined' から temp_${tagName} に変更し、UIコンポーネントでこの規則を認識して、一時タグには編集リンクではなく「未登録」を表示するよう修正しました。

Changes

一時タグID規則と UI表示の統一

Layer / File(s) Summary
データ形状・生成ロジック
src/routes/(admin)/tasks/[task_id]/+page.server.ts
インポート時の一時タグ生成で、idtemp_${importTags[i]} の形式に変更(DB未登録マーク)。
UI条件分岐
src/lib/components/TagListForEdit.svelte
編集リンク表示判定を tag.id !== 'undefined' から !tag.id.startsWith('temp_') に変更。一時タグには「未登録」を表示。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

📝 undefined さらば、temp_ 前衛
一時タグは「未登録」の衣を纏い
編集画面、輝きを取り戻しぬ ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive リンクされた Issue #3509 は詳細な再現手順が記載されておらず、変更がグレード編集画面の表示問題を解決するかどうかの判断が困難です。 Issue #3509 に具体的な再現手順と期待される動作を追加し、提案された修正がその要件を満たすことを確認してください。
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR タイトルは「temp_」接頭辞で一時タグを一意識別し、重複キーを回避する修正を明確に説明しており、変更内容と一致しています。
Out of Scope Changes check ✅ Passed 変更は temp_ 接頭辞の導入に限定され、タグレンダリングロジックの条件更新に関連しており、スコープ内です。
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch #3509

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/routes/`(admin)/tasks/[task_id]/+page.server.ts:
- Line 34: Create a single shared constant for the "temp_" prefix and use it
everywhere: add a new exported constant named TEMP_TAG_PREFIX (e.g., in
src/lib/constants/tags.ts), then replace the hardcoded string `temp_` in
src/routes/(admin)/tasks/[task_id]/+page.server.ts (where id is built as
`temp_${importTags[i]}`) and in src/lib/components/TagListForEdit.svelte with
imports of TEMP_TAG_PREFIX; update any code that constructs or checks tag IDs to
reference TEMP_TAG_PREFIX to remove the duplicated magic string.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 63ff8b28-9727-486c-a839-7bcca676b3ee

📥 Commits

Reviewing files that changed from the base of the PR and between baf4952 and 9e788df.

📒 Files selected for processing (2)
  • src/lib/components/TagListForEdit.svelte
  • src/routes/(admin)/tasks/[task_id]/+page.server.ts

Comment thread src/routes/(admin)/tasks/[task_id]/+page.server.ts
Copy link
Copy Markdown
Collaborator Author

@KATO-Hiro KATO-Hiro left a comment

Choose a reason for hiding this comment

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

LGTM

@KATO-Hiro KATO-Hiro merged commit 332b031 into staging May 9, 2026
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #3509 branch May 9, 2026 15:07
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.

[Bug] ABC250Fのグレード編集画面が表示されないので修正しましょう

1 participant