trackslash
TRACK-86 P2

Add a Favorites heading and a Recents section of recently viewed issues to the sidebar

0
All issues

Description

Problem

The sidebar lists favorited projects (sidebar-favorites, shell_sidebar.html:92) under the Me and Projects links. The list has no heading, only a top border, so it isn't obvious what those items are.

There's also no quick way to get back to issues you were just looking at. Switching between a few issues means going back through each project's issue list every time.

Expected behavior

  • Favorites heading: add a small "Favorites" title above the favorited projects, in the same style as the other small section headings (uppercase, text-xs, slate).
  • Recents section: add a new section below Favorites, titled "Recents", that lists the issues you've viewed most recently so you can jump back between them.
    • Each item shows the issue key (e.g. TRACK-85) and its title, truncated to one line. The full title appears on hover.
    • The most recently viewed issue is at the top. An issue appears only once: viewing it again moves it to the top.
    • It includes issues from every project you can access, capped at a sensible number (e.g. 10).
    • Opening an issue updates Recents straight away, with no page reload. Use an out-of-band swap, as sidebar-favorites already does with .OOB.
    • The issue you're currently viewing is highlighted with aria-current="page", using the same active styling as a current favorite.
    • Items navigate like the other sidebar links: htmx into #main with hx-push-url.

Acceptance criteria

  • Recently viewed issues are stored per user on the server, like project favorites (internal/store/project_favorites.go), so Recents follow you across devices and sessions. This needs a migration.
  • A view is recorded when a signed-in user opens an issue page or panel. Signed-out visitors get no Recents section.
  • Recents never show issues the user can no longer see: deleted issues, or issues in projects they've lost access to. Filter these out when the list is read.
  • Stored history is trimmed so it doesn't grow without limit.
  • The Favorites heading is hidden when there are no favorites, and the Recents section is hidden when there are no recent issues.
  • Collapsed sidebar (TRACK-33, TRACK-40): the headings are hidden (wide-only). Recents are either hidden or shown in a compact form that still makes sense without text. Pick one and apply it consistently.
  • Works on mobile and in light and dark modes.
  • Tests cover:
    • recording a view
    • reordering and de-duplicating when an issue is viewed again
    • the item cap
    • filtering out issues that are deleted or no longer accessible
    • the out-of-band sidebar update when an issue is opened
    • both sections hidden when they're empty

Sub-issues

0

Linked issues

0

GitHub

0

No branches or pull requests linked.

Comments

1
Bradley

Fixed in https://github.com/badbundle/track-slash-app/pull/178 (merged as e1eba8f).

  • Favorites: now has a small uppercase heading, shown only when there are favorites.
  • Recents: a new section lists the ten issues you opened most recently, newest first, each as an issue key and a one-line title.
    • Views are stored per user in recent_issue_views (migration 0048). Opening an issue again moves it to the top, and history is trimmed to the 50 newest.
    • Deleted issues and anything you can no longer read are left out, using the same rules as ProjectPermissionsForUser.
    • Signed-out visitors have none.
    • htmx navigation refreshes the list out of band, and the full title shows in the app tooltip when it's cut off.
  • Highlight: on an issue page, its Recents entry is the one active destination. The collapsed sidebar hides Recents and highlights the favorited project instead.