Skip to content

feat: Tag input shows already existing tags (closes #521)#522

Merged
linkdotnet merged 1 commit into
masterfrom
feat/smart-tags
Jun 26, 2026
Merged

feat: Tag input shows already existing tags (closes #521)#522
linkdotnet merged 1 commit into
masterfrom
feat/smart-tags

Conversation

@linkdotnet

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 26, 2026 07:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a richer tag editing experience in the blog post editor by introducing a TagInput component that can render existing tags as pills and show selectable suggestions, backed by a tag-usage query service with explicit cache invalidation.

Changes:

  • Introduces TagInput component + styling to display existing tags as removable pills and offer suggestion selection/keyboard navigation.
  • Extends ITagQueryService/TagQueryService with ClearTagCacheAsync() and triggers tag-cache invalidation on blog post create/update/restore and on blog post deletion.
  • Adds/updates unit + integration tests to cover suggestion rendering and cache invalidation behavior.

Reviewed changes

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

Show a summary per file
File Description
tests/LinkDotNet.Blog.UnitTests/Web/Features/Services/Tags/TagQueryServiceTests.cs Adds coverage for clearing the tag usage cache.
tests/LinkDotNet.Blog.UnitTests/Web/Features/Admin/BlogPostEditor/Components/TagInputTests.cs New bUnit tests for tag pill rendering, suggestion selection, normalization, and keyboard behavior.
tests/LinkDotNet.Blog.UnitTests/Web/Features/Admin/BlogPostEditor/Components/CreateNewBlogPostTests.cs Updates tests for new tag input mechanics and tag suggestion/cache behaviors.
tests/LinkDotNet.Blog.IntegrationTests/Web/Shared/Admin/BlogPostAdminActionsTests.cs Verifies tag cache is cleared when a blog post is deleted.
tests/LinkDotNet.Blog.IntegrationTests/Web/Features/Admin/BlogPostEditor/UpdateBlogPostPageTests.cs Injects ITagQueryService to satisfy new editor dependency.
tests/LinkDotNet.Blog.IntegrationTests/Web/Features/Admin/BlogPostEditor/CreateNewBlogPostPageTests.cs Injects ITagQueryService and updates tag input interaction.
src/LinkDotNet.Blog.Web/wwwroot/css/basic.css Adds CSS for the new tag input and suggestion dropdown.
src/LinkDotNet.Blog.Web/Features/ShowBlogPost/Components/BlogPostAdminActions.razor Clears tag cache after deleting a post.
src/LinkDotNet.Blog.Web/Features/Services/Tags/TagQueryService.cs Adds ClearTagCacheAsync() and tweaks cache key visibility.
src/LinkDotNet.Blog.Web/Features/Services/Tags/ITagQueryService.cs Adds ClearTagCacheAsync() to the contract.
src/LinkDotNet.Blog.Web/Features/Admin/BlogPostEditor/Components/TagInput.razor New tag input component with pills + suggestion UI.
src/LinkDotNet.Blog.Web/Features/Admin/BlogPostEditor/Components/CreateNewBlogPost.razor Replaces raw text tags input with TagInput + loads suggestions and invalidates tag cache on changes.

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

Comment thread src/LinkDotNet.Blog.Web/Features/Services/Tags/TagQueryService.cs Outdated
Comment on lines +35 to +39
<button type="button"
class="list-group-item list-group-item-action @(selectedIndex == index ? "active" : "")"
@onmousedown="() => SelectSuggestionAsync(suggestion)"
@onclick="() => SelectSuggestionAsync(suggestion)"
@onmouseenter="() => selectedIndex = index">
Comment on lines +30 to +34
@if (isOpen && GetFilteredSuggestions().Count > 0)
{
<div class="list-group position-absolute w-100 shadow mt-1 tag-input-suggestions">
@foreach (var (suggestion, index) in GetFilteredSuggestions().Select((tag, i) => (tag, i)))
{
@linkdotnet linkdotnet merged commit a031699 into master Jun 26, 2026
3 checks passed
@linkdotnet linkdotnet deleted the feat/smart-tags branch June 26, 2026 14:58
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