ff-707 (gh-480) — unified display of entry published dates - #536
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
site/src/components/EntriesList.vue now has an unused computedAsync import after removing timeField, which is likely to fail lint/build checks.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR implements a unified “published date” model end-to-end (backend → API → frontend), introducing explicit entry date fields (effectivePublishedAt, firstSeenAt, sourcePublishedAt) and using backend-provided fallbackUsed to drive the “loaded older news” notification. It also replaces the old per-order “time field” display logic with a dedicated EntryDate UI component.
Changes:
- Replace
publishedAtwith three explicit date fields and propagate them through API entities, JSON parsing, and UI rendering. - Return
{ entries, fallbackUsed }from “last entries” endpoints and wire thefallbackUsedflag into the old-news notification. - Introduce
EntryDatecomponent and removeReverseTimeColumn/timeFieldplumbing; update tests accordingly.
File summaries
| File | Description |
|---|---|
| site/src/views/PublicCollectionView.vue | Passes entryIds + fallbackUsed to the old-news notification; removes time-field usage. |
| site/src/views/NewsView.vue | Same as above; updates rule heuristic to iterate entryIds. |
| site/src/values/Icon.vue | Removes chevrons icons no longer used by entry read/unread control. |
| site/src/stores/entries.ts | Changes loaded-entries report shape to include fallbackUsed and entryIds. |
| site/src/main.ts | Registers new EntryDate component and removes BodyListReverseTimeColumn. |
| site/src/logic/utils.ts | Extends timeSince to support "short" and "long" styles using Intl.RelativeTimeFormat. |
| site/src/logic/types.ts | Introduces new entry date fields and adds RawEntriesLoadResponse/EntriesLoadResult + JSON translation helper. |
| site/src/logic/tests/utils.test.ts | Adds coverage for timeSince short/long formatting with fake timers. |
| site/src/logic/tests/types.test.ts | Updates entry JSON tests for date fields; adds tests for entries-load result translation. |
| site/src/logic/enums.ts | Removes timeField; updates Published ordering to effectivePublishedAt. |
| site/src/logic/api.ts | Updates last-entries API functions to return EntriesLoadResult and parse fallbackUsed. |
| site/src/components/notifications/LoadedOldNews.vue | Switches logic to rely on fallbackUsed from backend. |
| site/src/components/EntryForList.vue | Replaces reverse-time column with EntryDate; updates read/unread toggle UI. |
| site/src/components/EntryDate.vue | New component to display relative time and tooltip with all three dates. |
| site/src/components/EntriesList.vue | Adds list header row and removes timeField prop passing. |
| site/src/components/body_list/ReverseTimeColumn.vue | Removes obsolete component (replaced by EntryDate). |
| site/src/components/body_list/References.vue | Adds slot to allow injecting metadata after references. |
| site/src/components/body_list/EntryBody.vue | Renders references block when metadata slot is provided; forwards metadata slot. |
| ffun/ffun/library/tests/test_entities.py | Renames/updates tests to effective_published_at. |
| ffun/ffun/library/tests/test_domain.py | Updates fallback-loading domain tests for new result object. |
| ffun/ffun/library/entities.py | Adds EntriesLoadResult; renames published-at processing property to effective_published_at. |
| ffun/ffun/library/domain.py | Returns EntriesLoadResult including fallback_used. |
| ffun/ffun/cli/commands/profile.py | Adds fallbackUsed to profile response payload. |
| ffun/ffun/api/spa/tests/test_entities.py | Adds test ensuring API Entry maps the three date fields correctly. |
| ffun/ffun/api/spa/http_handlers.py | Threads fallback_used into fallbackUsed response field for last-entries endpoints. |
| ffun/ffun/api/spa/entities.py | Updates API Entry fields and last-entries response schemas to include fallbackUsed. |
| changes/unreleased.md | Records the user-visible change in unreleased notes. |
Review details
- Files reviewed: 27/27 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const properties = defineProps<{ | ||
| loading: boolean; | ||
| entriesIds: Array<t.EntryId>; | ||
| timeField: string; | ||
| showFromStart: number; | ||
| showPerPage: number; | ||
| showScore: boolean; |
No description provided.