feat: add thoughts page with timeline-style moments - #13
Merged
Merged
Conversation
Reviewer's GuideImplements a new localized /thoughts timeline page backed by a dedicated content collection, wires it into site navigation, seeds sample content, and adds basic E2E smoke coverage for key locales. Sequence diagram for the new /thoughts timeline page renderingsequenceDiagram
actor User
participant AppHeader
participant Router
participant ThoughtsPage
participant ContentCollection_thoughts
participant ContentRenderer
User->>AppHeader: click navItems to localePath(/thoughts)
AppHeader->>Router: navigate /thoughts
Router->>ThoughtsPage: mount thoughts/index.vue
ThoughtsPage->>ThoughtsPage: useSeoMeta
ThoughtsPage->>ContentCollection_thoughts: queryCollection(thoughts).where(draft,=,false).order(date,DESC).all
ContentCollection_thoughts-->>ThoughtsPage: moments
ThoughtsPage->>ThoughtsPage: formatDate(moment.date)
ThoughtsPage->>ContentRenderer: render moment
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The
ogUrlinuseSeoMetais hard-coded to/thoughts, which will generate a non-localized canonical URL for non-EN locales; consider deriving it from the current route (e.g.,config.public.siteUrl + route.path) or a locale-aware helper instead. - The
datefield in thethoughtscollection is a free-formz.string()and later passed tonew Date(dateStr); tightening this to an ISO-like constraint (or coercing toDatein the schema) would make the parsing informatDatemore robust and avoid surprising timezone/format issues.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `ogUrl` in `useSeoMeta` is hard-coded to `/thoughts`, which will generate a non-localized canonical URL for non-EN locales; consider deriving it from the current route (e.g., `config.public.siteUrl + route.path`) or a locale-aware helper instead.
- The `date` field in the `thoughts` collection is a free-form `z.string()` and later passed to `new Date(dateStr)`; tightening this to an ISO-like constraint (or coercing to `Date` in the schema) would make the parsing in `formatDate` more robust and avoid surprising timezone/format issues.
## Individual Comments
### Comment 1
<location path="app/pages/thoughts/index.vue" line_range="35" />
<code_context>
+ }),
+)
+
+function formatDate(dateStr: string) {
+ const date = new Date(dateStr)
+ return dateStr.includes('T')
</code_context>
<issue_to_address>
**issue:** Guard against invalid `dateStr` values to avoid `Invalid Date` rendering.
`new Date(dateStr)` can return an invalid date for malformed or unexpected input, which may render as a confusing string or "Invalid Date". Add a validity check (e.g., `isNaN(date.getTime())`) and fall back to the raw `dateStr` when invalid to keep the UI robust and easier to debug.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
BobbyLin23
added a commit
that referenced
this pull request
Aug 18, 2026
* feat: implement Notion publishing integration with GitHub * feat: add oauth login and comments on posts Let visitors sign in with GitHub or Google and leave comments on blog and weekly posts, stored in sqlite/D1. Co-authored-by: Cursor <cursoragent@cursor.com> * feat: add thoughts page with timeline-style moments (#13) * fix: fix the tailwind issues * fix: fix login modal's loading issues * feat: add rich text editor for comments * chore: improve e2e test * fix: update some issues from sourcery * fix: fix e2e actions --------- Co-authored-by: BobbyLin7 <bobbylin23@163.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
/thoughtspage — a timeline.so-style "moments" feed of short, timestamped posts. New content collectionthoughts(content/thoughts/*.md), a vertical timeline UI with entrance animations, i18n for all 6 locales, a nav entry, and E2E smoke coverage.Changes
content.config.ts— newthoughtscollection:type: 'page',source: 'thoughts/*.md', schemadate/title/tags?/draft.app/pages/thoughts/index.vue— single stream page: grouped vertical timeline with a rail line + amber dots, per-moment card (timestamp + markdown body viaContentRenderer), staggeredSafeMotionentrances, empty state,useSeoMeta. Date renders with time-of-day when the frontmatter date includes one.app/components/AppHeader.vue— "Thoughts" nav item (between Weekly and About).i18n/locales/*.json—nav.thoughts+thoughts.title/description/emptyin en, zh, zh-TW, es, ja, fr.content/thoughts/— 3 placeholder sample moments.tests/e2e/site.spec.ts— smoke routes for/en/thoughtsand/zh/thoughts.Scope notes
Verification
pnpm lint— 0 errors.pnpm fmt:check— all touched files formatted (remaining warnings are pre-existing files unrelated to this PR).pnpm test:e2e— 27/27 passed, including the new thoughts smoke tests.Summary by Sourcery
Introduce a localized timeline feed for sharing short, timestamped thoughts.
New Features:
/thoughtspage that presents published short posts in a timestamped timeline.thoughtscontent collection with dated, titled, optionally tagged and draftable entries.Enhancements:
Tests:
Chores: