Skip to content

fix: update lastUpdated date handling and replace buttons with links …#2796

Merged
adityaoberai merged 7 commits intomainfrom
feat-ci-assets-blog
Mar 11, 2026
Merged

fix: update lastUpdated date handling and replace buttons with links …#2796
adityaoberai merged 7 commits intomainfrom
feat-ci-assets-blog

Conversation

@eldadfux
Copy link
Member

@eldadfux eldadfux commented Mar 11, 2026

New blog post

Summary by CodeRabbit

  • New Features

    • Added a new blog post about managing website assets, cold-start costs, CI/build impact, and storage strategies.
  • Bug Fixes

    • Improved post "last updated" handling by falling back to the original post date when no update exists.
    • Category navigation switched to standard links for predictable, router-driven browsing instead of in-page button handlers.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cb390204-51c2-4098-8fc4-2baf3b7fe0a5

📥 Commits

Reviewing files that changed from the base of the PR and between 05222bd and aeb7df9.

⛔ Files ignored due to path filters (1)
  • static/images/blog/managing-website-assets-repo-cold-start/cover.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • .optimize-cache.json
  • src/routes/blog/[[page]]/+page.svelte
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/routes/blog/[[page]]/+page.svelte

Walkthrough

This PR changes the blog listing UI to import base from $app/paths and replace in-place button/onClick category filtering with anchor links that navigate to base + '/blog' or base + '/blog?category=NAME'. It updates blog content generation to set lastUpdated using new Date(frontmatter.lastUpdated ?? frontmatter.date). Adds a new static blog post at src/routes/blog/post/managing-website-assets-repo-cold-start/+page.markdoc with full frontmatter and article content, and adds a cache entry for the post cover image in .optimize-cache.json.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions updating lastUpdated date handling and replacing buttons with links, which directly align with the main changes in the changeset (updating lastUpdated fallback logic and converting button elements to anchor tags for navigation).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-ci-assets-blog

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/routes/blog/`[[page]]/+page.svelte:
- Around line 329-348: The selectedCategory value is stale after client-side
anchor navigation; change the class:is-selected bindings on the "Latest" anchor
and the category anchors to derive selection from the reactive page URL (e.g.
use page.url.searchParams.get('category') or its fallback 'Latest') instead of
the local selectedCategory variable so the highlight updates on navigation, and
keep selectedCategory writable only for the "Clear search" handler by leaving
its write logic in place but not relying on it for the class bindings (update
references in the anchors that use class:is-selected and any code that reads
category selection).

In `@src/routes/blog/post/managing-website-assets-repo-cold-start/`+page.markdoc:
- Around line 5-7: Update the frontmatter keys in the post: change the date
value in the `date` (and `lastUpdated`) field from "2025-03-11" to "2026-03-11",
and replace the `cover` value from
"/images/blog/announcing-cname-flattening/cover.png" to the correct image path
"/images/blog/managing-website-assets-repo-cold-start/cover.png" so the post
uses the correct date and its dedicated cover image.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6983b480-a325-4a57-b086-4b51a8a5257a

📥 Commits

Reviewing files that changed from the base of the PR and between f31aecb and 312175e.

📒 Files selected for processing (3)
  • src/routes/blog/[[page]]/+page.svelte
  • src/routes/blog/content.ts
  • src/routes/blog/post/managing-website-assets-repo-cold-start/+page.markdoc

Comment on lines 329 to 348
<li class="flex items-center">
<button
<a
href={base + '/blog'}
class="web-interactive-tag web-caption-400 cursor-pointer"
class:is-selected={selectedCategory === 'Latest'}
onclick={() => {
selectedCategory = 'Latest';
handleSearch();
}}
>
Latest
</button>
</a>
</li>

{#each categories as category (category.name)}
<li class="flex items-center">
<button
<a
href={base + '/blog?category=' + encodeURIComponent(category.name)}
class="web-interactive-tag web-caption-400 cursor-pointer"
class:is-selected={selectedCategory === category.name}
onclick={() => {
selectedCategory = category.name;
handleSearch();
}}
>
{category.name}
</button>
</a>
</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

selectedCategory won't update after anchor-based navigation, breaking the visual highlight.

The selectedCategory state (line 43) is initialized once from URL params via $state. When users click these new anchor links, SvelteKit performs client-side navigation without re-running the component script—so selectedCategory remains stale while the URL changes. The is-selected class bindings on lines 333 and 344 will show the wrong category as selected.

Consider deriving the selected state directly from the reactive page.url:

🐛 Proposed fix
-let selectedCategory = $state(page.url.searchParams.get('category') ?? 'Latest');
+let selectedCategory = $derived(page.url.searchParams.get('category') ?? 'Latest');

If selectedCategory must remain writable for the "Clear search" handler (line 412), use page.url.searchParams directly in the class bindings instead:

 <a
     href={base + '/blog'}
     class="web-interactive-tag web-caption-400 cursor-pointer"
-    class:is-selected={selectedCategory === 'Latest'}
+    class:is-selected={!page.url.searchParams.get('category')}
 >
 <a
     href={base + '/blog?category=' + encodeURIComponent(category.name)}
     class="web-interactive-tag web-caption-400 cursor-pointer"
-    class:is-selected={selectedCategory === category.name}
+    class:is-selected={page.url.searchParams.get('category') === category.name}
 >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<li class="flex items-center">
<button
<a
href={base + '/blog'}
class="web-interactive-tag web-caption-400 cursor-pointer"
class:is-selected={selectedCategory === 'Latest'}
onclick={() => {
selectedCategory = 'Latest';
handleSearch();
}}
>
Latest
</button>
</a>
</li>
{#each categories as category (category.name)}
<li class="flex items-center">
<button
<a
href={base + '/blog?category=' + encodeURIComponent(category.name)}
class="web-interactive-tag web-caption-400 cursor-pointer"
class:is-selected={selectedCategory === category.name}
onclick={() => {
selectedCategory = category.name;
handleSearch();
}}
>
{category.name}
</button>
</a>
</li>
<li class="flex items-center">
<a
href={base + '/blog'}
class="web-interactive-tag web-caption-400 cursor-pointer"
class:is-selected={!page.url.searchParams.get('category')}
>
Latest
</a>
</li>
{`#each` categories as category (category.name)}
<li class="flex items-center">
<a
href={base + '/blog?category=' + encodeURIComponent(category.name)}
class="web-interactive-tag web-caption-400 cursor-pointer"
class:is-selected={page.url.searchParams.get('category') === category.name}
>
{category.name}
</a>
</li>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/routes/blog/`[[page]]/+page.svelte around lines 329 - 348, The
selectedCategory value is stale after client-side anchor navigation; change the
class:is-selected bindings on the "Latest" anchor and the category anchors to
derive selection from the reactive page URL (e.g. use
page.url.searchParams.get('category') or its fallback 'Latest') instead of the
local selectedCategory variable so the highlight updates on navigation, and keep
selectedCategory writable only for the "Clear search" handler by leaving its
write logic in place but not relying on it for the class bindings (update
references in the anchors that use class:is-selected and any code that reads
category selection).

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/routes/blog/post/managing-website-assets-repo-cold-start/`+page.markdoc:
- Line 4: The description and body contain hyphenated fragments where em dashes
or rewording are intended (examples: "bite-and", "others-especially", "repo-a",
"regions-for example", "not-and"); open the "+page.markdoc" content and replace
those broken compounds with proper punctuation or phrasing (use — em dashes or
commas/parentheses as appropriate) across the noted ranges (lines around 15, 19,
27, 35–37, 49, 62–70) so that phrases read naturally (e.g., "bite — and",
"others — especially", "repo a" -> "a repo", "regions, for example", "not, and"
or restructure the sentence) while preserving intended meaning and tone.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 24940723-5e0b-408a-ae8c-32bc3aaa16f4

📥 Commits

Reviewing files that changed from the base of the PR and between 312175e and 0f906b7.

⛔ Files ignored due to path filters (1)
  • static/images/blog/managing-website-assets-repo-cold-start/cover.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • src/routes/blog/post/managing-website-assets-repo-cold-start/+page.markdoc

Copy link
Member

@adityaoberai adityaoberai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eldadfux mostly all minor edits, there's one important point that needs more attention (around the point of setting a base URL in the environment)

@adityaoberai
Copy link
Member

Also, @eldadfux, we need to run the optimize and format scripts. Those tests are failing.

eldadfux and others added 2 commits March 11, 2026 13:54
Co-authored-by: Aditya Oberai <adityaoberai1@gmail.com>
Co-authored-by: Aditya Oberai <adityaoberai1@gmail.com>
@adityaoberai adityaoberai merged commit c53c020 into main Mar 11, 2026
6 checks passed
@adityaoberai adityaoberai deleted the feat-ci-assets-blog branch March 11, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants