Add a "date added" sort wherever it makes sense #46
Open
opened 2026-08-18 05:57:03 +00:00 by logan
·
2 comments
No Branch/Tag Specified
main
perf/279-284-scoped-library-payloads
batch/274-276-slskd
batch/258-272
fix/263-slskd-transfer-lifecycle
fix/271-slskd-search-recall
fix/270-slskd-candidate-shape
build/265-go-1.26
feat/264-explore-cards
fix/258-artifact-blob-cursor
docs/256-claude-md-split
batch/248-249
fix/248-artist-metadata-sweep
fix/247-cover-art-orphans
fix/249-unbounded-growth
fix/246-incremental-scan-phantoms
fix/183-phantom-across-retire
fix/243-model-fallback
feat/31-play-all-shuffle-all
fix/240-loop-operational-fixes
docs/220-skill-check-scope
fix/231-setter-rollback
fix/197-duplicate-column-label
fix/175-wizard-follows-the-library
fix/146-stub-etxtbsy
docs/225-fixtures-wav-tags
feat/238-merge-leg-refresh-watch
feat/236-autonomous-backlog-loop
test/217-fixture-names-in-queue-selection
fix/216-riff-parse-allocation
fix/170-queue-header-action-names
fix/210-nav-sheet-scroll-affordance
docs/50-readme-landing-page
feat/65-art-prefetch-ahead
feat/71-more-as-a-bottom-sheet
feat/54-native-touch-feel
feat/67-entity-links-into-menus
test/196-visual-tier-gates
fix/138-ui-test-storage-leak
fix/104-wav-tags-read
fix/207-sheet-scroll-affordance
fix/204-ui-visual-update-filter
pi-agent-backlog-automation
63-touch-model-phase-2
63-android-touch-model
186-touch-targets-settings
186-touch-targets-page-header
187-seek-bar-hit-area
189-190-explore-correctness
135-android-underrun-instrumentation
51-android-small-screens
fix/171-phone-queue-scrim
fix/137-touch-only-affordances
fix/154-nested-css-check
feat/58-mini-player-progress-line
fix/66-album-page-scrolls-as-one
60-context-menu-action-sheet
64-android-system-volume
59-slim-the-mini-player
55-queue-as-a-screen
feat/57-drop-the-android-top-bar
feat/62-jobs-as-a-notification
fix/53-seek-bar-never-moves
fix/159-android-task-app-id
fix/52-android-activity-recreation-restarts-the-process
fix/150-expand-button-under-the-art
feat/42-inline-volume-and-centred-transport
fix/156-queue-selection-fixture-order
fix/151-fuse-the-scroll-guard-and-the-write
fix/43-queue-panel-selection
fix/143-top-bar-fits-its-window
feat/27-jobs-into-settings
feat/25-configurable-sidebar-tabs
feat/6-global-back-forward
fix/72-active-view-broadcast
fix/69-page-header-action-overflow
fix/quick-wins-batch
fix/118-in-library-clear
fix/61-mini-player-plain-text
fix/68-hover-affordances-pointer
fix/119-dev-headless-port
fix/130-issue-claim-user
fix/131-codegen-check-scope
feat/28-autotag-match-on-album
feat/17-demote-version-selector
feat/38-ownership-visibility
ci/115-manual-release
feat/34-icon-language
feat/7-full-tracklist-toggle
fix/16-tagwriter-totals
fix/unclaim-ca-certs
fix/unclaim-shell
ci/unclaim-on-close
docs/closing-keyword
docs/retire-stale-planning-docs
docs/issue-driven-workflow
integration/small-fixes
fix/small-issue-batch
fix/queue-toggle-state
fix/drag-count-badge
fix/album-card-year
fix/album-tracklist-heading
fix/seek-bar-clock-width
fix/explore-art-scanner-requests
chore/workflow-guardrails
v0.8.0
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.1
v0.3.0
v0.2.3
v0.2.2
v0.2.1
v0.2.0
v0.1.0
v0.0.1
v0.0.0
Labels
Clear labels
Area/Design
Area/Downloads
Area/Explore
Area/Library-UI
Area/Metadata
Area/Packaging
Area/Player
Area/Queue
Area/Settings
Area/Shell-Nav
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Platform/Android
Platform/Desktop
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
In Progress
Somebody is actively working on this right now
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: yonlu/yellowjacket#46
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Report
There should be a "date added" sort option on the views where it is relevant.
Findings
<page-header>'ssortOptionsper host, so this is one option added to several hosts rather than one change.audio_filescarries a created/added timestamp and that album/artist rollups can derive one (an album's date added = the earliest/latest of its files — pick one and write it down).library.Artistcarries no counts or dates, so it needs the query extending either way.Direction
Add it to Tracks, Albums, Artists and Genres, plus the playlist views where a track's "added to playlist" date is a different thing worth distinguishing in the label. Default direction should be newest-first, since "what did I just add" is the reason anyone wants it.
⟦loop⟧ claim for #46, paired with #32 per #73 Phase 5 ("do together, both need the same backend columns").
Branch
feat/46-32-date-added-and-artist-sort. Approach: add a created/added timestamp toaudio_filesplus album/artist rollups, widen the albums/artists queries to return it, add the date-added sort option to Tracks/Albums/Artists/Genres (newest-first default, since "what did I just add" is the use), and add #32's artist sort keys in the same pass. Plan follows as a comment; no push until the implementation leg.⟦loop⟧ Implementation plan for #46 + #32 — one pass on
feat/46-32-date-added-and-artist-sort, per #73 Phase 5 and the scope agreed on #32 (2026-08-21).Change, one sentence. Add an import timestamp to
audio_files, widen the album/artist/genre/track projections with it plus the count/duration/play rollups, and give every library view real comparator-based sort options oncover-grid's existingSortOption & { comparator }model — date-added (newest-first) everywhere (#46) and the Artists view's missing keys (#32).Backend (schema change → follow
references/schema-change.md)sql/schemas/audio_files.sql: newadded_at DATETIME NOT NULL, no default — a missed insert path should fail loudly, not silently get epoch. One edit +make generate.audio_filesisKind: Owned, so staleshape drops+rescans existing DBs — the designed path; no datamap change (the MIXED KIND note already covers the authored neighbours).sql/queries/audio_files.sql:CreateAudioFilesetsadded_atat insert only. No update path may touch it — a rescan must not reset date-added; checkUpdateAudioFileTags/UpdateAudioFileStatstay silent on it.track_metadataview +library.Track.AddedAt(string viatrackFromRow, mirroringLastPlayed).GetAlbumArtists(artists.sql),GetAlbums(albums.sql),GetAllGenresWithCounts(genres.sql): EXISTS/DISTINCT → JOINaudio_files+ GROUP BY, gaining track/album counts, duration (ms int64), play count, last played, added-at. The library filter must apply inside the aggregates.GetPlaylistTracksWithMetadata(playlists.sql): addtm.added_at— the join already exists.home.sqlHomeRecentlyAddedAlbums:MAX(af.id)→MAX(af.added_at); semantics agree by construction.MAXover the entity's files (matches theMAX(af.id)stand-in — completing an album re-surfaces it as recent); last played =MAX; artist play count =SUM("who do I listen to most").backend/tracklist:AllColumnIDs+DefaultColumnsgaindateAdded(default-visible, so the sort exists out of the box).database/testhelper.go:TestTrackgets a settableAddedAt.Frontend
page-header:SortOptiongains optionaldefaultDirection, emitted on field change — that is "newest-first by default".cover-grid-types.ts: extendALBUM_SORT_OPTIONS(+date added, track count, duration, play count, last played).artists-view:ARTIST_SORT_OPTIONSbecomes a comparator array on the same model; addsortFieldtorecomputeArtistCaches' memo key and keep the per-render arrow functions —card-grid-repaint.test.tsis the guard.genres-view: inline ternary → comparator array.track-list/columns.ts:dateAddedcolumn (renderer + comparator,configurable: true); both column lists must agree (#197's two-list trap;settings-column-list.test.tssweeps). Not inPHONE_COLUMN_IDS.playlist-details: a sort control in its header row (select + direction, page-header's pattern) — "Date added" (library) and "Added to playlist" keyed onplaylist.Track.ID, which is already over the IPC and is insertion order. Order-only, no displayable date — see risk 7. This is the largest single frontend piece: the view has no sort at all today, which is materially more than #46's one-line report suggests.Verification tiers — all of these
make generate, thengo test ./backend/database/ ./backend/datamap/andmake test(3 build passes) — schema + query change.make bindingsthenmake ui-test— new bound struct fields (incl. a ≥2-library Go test proving the aggregates respect the library filter).npx tsc --noEmitfromfrontend/— nothing else runs it over the test tree.make e2e(SEED=default) — a spec per surface, staging distinctadded_atvia/__test/sqlfirst: the seed's single scan gives every file the same timestamp, so an un-staged order assertion only tests the name tie-break.make perfbefore/after on the bulk seed — the widened projections ride every hot list query; "cheap" is a claim until measured (view-first-open, scroll).make lint,make bindings-check,make css-check,make commit-check.make sandbox-seed NAME=default, bulk too if used): staleshape dropsaudio_filesin old seeds and their playlists empty out (audio_file_id→ NULL) — e2e against a stale seed fails in ways that read as regressions. CI builds its own seed.make ui-visual— no baseline covers the changed surfaces (track-list has none; page-header's own shots are option-agnostic), so expected not required; instead read a PNG of each re-sorted view in the real app (make dev-headless SEED=default+ screenshot) — a component test passing is not the app rendering.Deliberately out of scope. Album-completeness key (#184), recency-weighted stats (#185), tag-status key (rejected — duplicates autotag in the hot projection), Release Year option (marginal per the scope note), smart-playlist sort (rule-evaluated; "added" is meaningless there), queue sort, phone column-set changes, the sort-state one-module extraction (#138 closed via the
setup.tsclear — four more localStorage keys are safe on that fix), any migration mechanism for authored tables.Risks I actually see
audio_filesand the authored columns on it ride along (documented MIXED KIND cost). Pre-1.0 accepted; the seed rebuild in tier 7 is mandatory, not hygiene.dateAddedmust land in Go'sAllColumnIDsand TS'sCOLUMN_DEFSin the same commit.card-grid-repaint.test.tsgoes red, the change broke it, not the test.playlist_tracks, which isAuthored— staleshape never repairs authored tables, so an existing database would fail every new query withno such columnand the only manual fix destroys the user's playlists. Not taken; the id-ordering sort is the honest 90%. File a follow-up if a displayed date is wanted.