Skip to content

feat: add tag collection shortcut from post tags#103

Open
AlejandroAkbal wants to merge 1 commit intomainfrom
auto-triage/24-feature-press-tag-to-allow-adding-to-tag-group
Open

feat: add tag collection shortcut from post tags#103
AlejandroAkbal wants to merge 1 commit intomainfrom
auto-triage/24-feature-press-tag-to-allow-adding-to-tag-group

Conversation

@AlejandroAkbal
Copy link
Member

@AlejandroAkbal AlejandroAkbal commented Mar 14, 2026

Summary

  • add an "Add to tag collection" action to the post tag context menu so premium users can save a tag directly from a post
  • reuse the existing tag collections state, create collections on demand, and avoid duplicate tag entries
  • preserve the current premium upsell flow for non-premium users

Validation

  • pnpm exec vitest run test/pages/posts.test.ts (fails: missing existing @nuxt/test-utils dependency in repo test setup)
  • pnpm exec nuxi typecheck (fails with many pre-existing repo type errors and missing-module issues unrelated to this change)

Feedback

Summary by CodeRabbit

Release Notes

  • New Features
    • Tags can now be organized into custom collections
    • New "Add to tag collection" action available in tag menus
    • Built-in duplicate detection prevents adding the same tag multiple times
    • Premium-only feature includes intuitive naming and collection management
    • Toast notifications confirm successful updates

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 14, 2026

Walkthrough

The PostTag component now includes premium-gated tag collection functionality. A new addTagToCollection function creates or updates tag collections with name prompts, duplicate validation, and toast notifications. New UI menu options enable users to add tags to collections, with premium-only restriction.

Changes

Cohort / File(s) Summary
Tag Collection Management
components/pages/posts/post/PostTag.vue
Added imports for TagCollection and useTagCollections composable. Introduced addTagToCollection(tag) function implementing premium gating, collection name prompts, duplicate validation, and state updates with toast notifications. Added "Add to tag collection" menu option and premium-gated UI block for managing collections.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a tag collection shortcut accessible from post tags.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch auto-triage/24-feature-press-tag-to-allow-adding-to-tag-group
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch auto-triage/24-feature-press-tag-to-allow-adding-to-tag-group
📝 Coding Plan
  • Generate coding plan for human review comments

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
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 the current code and only fix it if needed.

Inline comments:
In `@components/pages/posts/post/PostTag.vue`:
- Around line 89-93: Replace the native prompt() call in PostTag.vue with the
app's custom modal flow: remove the prompt() usage around const name =
prompt('Enter a tag collection name')?.trim(), instead open the modal component
(e.g., TagCollectionModal or the existing useModal hook), await the modal
result, trim and validate the returned name, and keep the early-return behavior
if the user cancels or provides an empty value; update the code paths that use
the name so they read from the modal result rather than prompt().
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 036b821c-8b2f-4754-b6bb-9b18d27be0eb

📥 Commits

Reviewing files that changed from the base of the PR and between 5cc34fe and a561d4c.

📒 Files selected for processing (1)
  • components/pages/posts/post/PostTag.vue

Comment on lines +89 to +93
const name = prompt('Enter a tag collection name')?.trim()

if (!name) {
return
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider using a custom modal instead of prompt().

The native prompt() dialog is functional but provides a basic UX that doesn't match the app's styling. Consider using a modal component for better consistency with the rest of the UI.

This is a low-priority enhancement since the current implementation works correctly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/pages/posts/post/PostTag.vue` around lines 89 - 93, Replace the
native prompt() call in PostTag.vue with the app's custom modal flow: remove the
prompt() usage around const name = prompt('Enter a tag collection
name')?.trim(), instead open the modal component (e.g., TagCollectionModal or
the existing useModal hook), await the modal result, trim and validate the
returned name, and keep the early-return behavior if the user cancels or
provides an empty value; update the code paths that use the name so they read
from the modal result rather than prompt().

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