Skip to content

Add tag clouds to workspace / nested workspace / project detail pages #2

Description

@netclectic

Summary

Tags are currently only visible on individual memory entries. Add a tag cloud to the workspace, nested-workspace, and project detail pages so users can see the tag landscape at each organizational level and drill into tag-filtered memory lists.

Scope

Per the tag-cloud scope decision, a workspace tag cloud aggregates tags from the entire workspace subtree: direct workspace memories + all projects + all nested workspaces (recursive).

Changes

Backend

  • New ITagCloudService / TagCloudService (auto-registered via [AutoRegisterInterfaces]), depending on NpgsqlDataSource — does not extend IStorage, so no test-fake churn.
    • GetWorkspaceSubtreeTagCountsAsync(WorkspaceId) — recursive CTE over workspaces.parent_id, unnest(tags), owner_type = 0 (workspace) / owner_type = 1 (project).
    • GetProjectTagCountsAsync(ProjectId) — direct project memories.
  • New model TagCount { string Tag; int Count }.
  • New endpoint GET /api/memory/tags/cloud?workspaceId=&projectId= (mutually exclusive → 400) returning [{tag, count}], sorted by count desc then tag.

Frontend

  • Tag-cloud card on WorkspaceDetail.cshtml and ProjectDetail.cshtml.
  • Tags rendered as clickable badges with font-size scaled by count (min ~0.8rem → max ~1.5rem); click navigates to /memories?workspaceId=X&tag=Y (or projectId).
  • Section hidden when empty.
  • Tag-cloud JS kept self-contained (loadTagCloud() + its own section div) so the diff stays separable from Add tag clouds to workspace / nested workspace / project detail pages #2.
  • Light + dark theme styles in site.css (per project convention, [data-theme="dark"]).

Files

  • New: src/Memorizer/Services/ITagCloudService.cs, Services/TagCloudService.cs, Models/TagCount.cs
  • Modified: src/Memorizer/Controllers/MemoryController.cs, Views/Home/WorkspaceDetail.cshtml, Views/Home/ProjectDetail.cshtml, wwwroot/css/site.css

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestuiWeb UI changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions