Skip to content

Conversation

@gocanto
Copy link
Contributor

@gocanto gocanto commented Nov 13, 2025

Summary

  • expose a dedicated data-testid on the post tag collection to aid verification
  • extend the post page skeleton with tag chip placeholders so the layout remains consistent while loading
  • expand the post page test to assert the tag container renders alongside individual tag chips

Testing

  • make format
  • npm test (fails: vitest not found in the environment)

Codex Task

Summary by CodeRabbit

  • New Features

    • Posts show tags under the title; clicking a tag starts a site search and focuses the search input
    • New tag-driven posts listing page and route with improved tag-based messaging
    • Side navigation and widget now show social links
    • Back-to-top control supports two display variants; recommendation items receive a refreshed horizontal layout
    • Post skeleton gains a breadcrumb-like nav placeholder
  • Tests

    • Added/expanded tests for tag UI, tag pages, social links, and tag utilities
  • Chores

    • Project config updates (Node/runtime, ignore list, path alias)

@coderabbitai
Copy link

coderabbitai bot commented Nov 13, 2025

Caution

Review failed

The pull request is closed.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds tag rendering and click behavior to PostPage, a TagPosts listing page and Tags utility, a Social service with social-link wiring, related tests, minor UI skeleton/layout changes, alias/tsconfig updates for @support, and CI/node-version and .gitignore updates.

Changes

Cohort / File(s) Summary
Post page & Tag interaction
src/pages/PostPage.vue, tests/pages/PostPage.test.ts
Render post tags as RouterLink, add handleTagClick to set global search term and programmatically populate/focus search input, import Tags and RouterLink, adjust cover image fallback; tests updated to stub RouterLink, include tags, and assert rendering and click behavior.
Tag listing page & Tags support
src/pages/TagPostsPage.vue, src/support/tags.ts, tests/pages/TagPostsPage.test.ts, tests/support/tags.test.ts
New TagPosts page (route-driven fetch, loading/error/skeleton logic, summary messaging); new Tags utility with normalize/format/route/summary helpers; tests for page behavior and Tags utilities.
Social service & social UI
src/support/social.ts, src/partials/WidgetSocialPartial.vue, src/partials/SideNavPartial.vue, tests/support/social.test.ts, tests/partials/SideNavPartial.test.ts
New Social class (fetch + buildNavLinks), widgets and side nav switched to use Social service and render built nav links; tests added for Social behavior and SideNav social rendering.
Partial components & skeletons
src/partials/PostPageSkeletonPartial.vue, src/partials/ResumePageSkeletonPartial.vue, src/partials/ArticleItemPartial.vue, src/partials/BackToTopLink.vue, src/partials/RecommendationPartial.vue
Added breadcrumb-like skeleton in post skeleton, renamed emitted param in resume skeleton, converted router-linkRouterLink in article partial, added variant prop and click behavior to BackToTopLink, and reworked RecommendationPartial layout.
Router / aliases / TS config
src/router.ts, aliases.ts, tsconfig.json
Add /tags/:tag route named TagPosts and name root route Home; add @support alias and @support/* tsconfig path mapping.
Tests & test infra
tests/... (multiple files)
New/updated tests for PostPage, TagPostsPage, Social, Tags, and SideNav; Pinia setup added to SideNav tests; Router/RouterLink stubs and apiStore mocks updated.
CI / env / misc
.github/workflows/*.yml, .nvmrc, .gitignore, src/pages/ResumePage.vue
Downgrade CI Node version to 22.12.0, update .nvmrc, add coverage/ to .gitignore, and rename a local const to _resumeSectionMinHeights.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant PostPage
  participant TagsUtil
  participant ApiStore
  participant SearchInput

  Note over PostPage: Tag click interaction (new)
  User->>PostPage: click tag link
  PostPage->>TagsUtil: formatLabel(tagName)
  PostPage->>ApiStore: setSearchTerm(formattedLabel)
  PostPage->>SearchInput: dispatch "input" event and focus
  SearchInput-->>User: focused with value
Loading
sequenceDiagram
  participant Router
  participant TagPostsPage
  participant ApiStore
  participant ArticleItemPartial

  Note over TagPostsPage: Tag-based fetch flow (new)
  Router->>TagPostsPage: route param change (tag)
  TagPostsPage->>TagPostsPage: bump requestId (cancel stale)
  TagPostsPage->>ApiStore: getPosts({ tag })
  ApiStore-->>TagPostsPage: posts or error
  alt success
    TagPostsPage->>ArticleItemPartial: render posts
  else error
    TagPostsPage-->>TagPostsPage: set hasError
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

  • Areas to focus:
    • DOM interaction in PostPage.handleTagClick (dispatching input event and focusing a possibly-missing input).
    • requestId/stale-request handling in TagPostsPage to avoid race conditions.
    • Social.buildNavLinks mapping and allowed-platform filtering (icons/labels).
    • Tests that stub Router/RouterLink and Pinia—ensure stubs align with runtime behavior.

Possibly related PRs

Suggested labels

codex

Poem

🐇 I hopped through tags and left a trail,
Little hash-pills riding the gale.
I fetched some socials, built links with care,
Tests tidy my whiskers — I comb my fur fair.
Click a tag, I nudge the search — hop, focus, prevail! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'feat: Enhance UX' is vague and generic, using non-descriptive language that doesn't convey meaningful information about the changeset. Use a more specific title that describes the main change, such as 'feat: Add tag navigation and display on post page' or 'feat: Implement post tags display with tag-based filtering'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee784f6 and 0aa9202.

📒 Files selected for processing (3)
  • src/partials/BackToTopLink.vue (1 hunks)
  • src/partials/RecommendationPartial.vue (1 hunks)
  • src/support/tags.ts (1 hunks)

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.

@gocanto gocanto marked this pull request as draft November 13, 2025 03:15
@gemini-code-assist
Copy link

Summary of Changes

Hello @gocanto, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user experience on the post page by introducing a dedicated section for displaying post tags. It ensures a smoother visual experience during data loading by adding tag placeholders to the skeleton screen and improves the overall robustness of the application by adding specific data attributes for testing and comprehensive unit tests for tag rendering.

Highlights

  • Post Tags Display: Implemented the display of post tags on the PostPage, including styling for individual tag chips and conditional rendering based on tag availability.
  • Accessibility and Testability: Added data-testid="post-tags" to the tag collection container and data-testid="post-tag" to individual tag chips, enhancing testability and aiding verification.
  • Skeleton Loader Enhancement: Extended the PostPageSkeletonPartial with placeholder elements for post tags, ensuring a consistent layout during content loading.
  • Unit Test Coverage: Expanded the PostPage.test.ts to include assertions for the rendering of post tags, verifying the presence of the tag container and individual tag chips with their correct names.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request enhances the display of post tags by adding them to the post page, including a skeleton loader for a better loading experience, and adding tests for the new functionality. The changes are well-implemented. I have two main suggestions for improvement. First, in PostPage.vue, the tags should be interactive links to improve user navigation, rather than static text. Second, the tests in PostPage.test.ts could be made more robust by adding a case to verify that the tags container is not rendered when a post has no tags. These changes will improve usability and test coverage.

@gocanto gocanto added testing and removed codex labels Nov 13, 2025
@gocanto gocanto changed the title Enhance post tags display feat: Enhance post tags display Nov 13, 2025
@gocanto gocanto changed the title feat: Enhance post tags display feat: Enhance UX Nov 13, 2025
@gocanto gocanto marked this pull request as ready for review November 13, 2025 08:00
Copy link

@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: 0

♻️ Duplicate comments (1)
tests/pages/PostPage.test.ts (1)

135-162: Add regression test for posts without tags. Line 135 exercises the happy path, but the v-if="post.tags?.length" guard still isn't covered. The earlier review comment flagged this gap and it's still outstanding—please add a no-tag scenario so we catch regressions when the array is empty.

+	it('does not render the tag container when a post has no tags', async () => {
+		getPost.mockResolvedValueOnce({ ...post, tags: [] });
+		const wrapper = mountComponent();
+		await flushPromises();
+		expect(wrapper.find('[data-testid="post-tags"]').exists()).toBe(false);
+	});
🧹 Nitpick comments (3)
src/partials/ResumePageSkeletonPartial.vue (1)

91-91: Stylistic change unrelated to PR objectives.

The parameter rename from event to _event in the defineEmits type signature follows the convention of prefixing unused identifiers with an underscore. However, this change is unrelated to the stated PR objectives (tag rendering, post page skeleton enhancements, and test assertions). Consider whether incidental style changes should be included in feature-focused PRs or batched separately.

src/pages/ResumePage.vue (1)

101-101: Consider removing unused variable entirely.

The variable _resumeSectionMinHeights is not referenced anywhere in this file. While prefixing with an underscore indicates it's intentionally unused, consider removing the line entirely to reduce code clutter. If the method call is needed for side effects, add a comment explaining why.

Additionally, this change is unrelated to the stated PR objectives (tag rendering and post page enhancements). Consider whether such cleanup should be in a separate PR.

src/support/tags.ts (1)

41-61: Consider minor optimization: check for empty tag first.

The method correctly handles all state scenarios with appropriate messaging. However, formatLabel is called at Line 42 before checking if the tag is empty at Line 43, which means the formatted label is computed but unused when there's no tag.

Apply this diff to optimize:

 static summaryFor(tag: string, state: TagSummaryState): string {
-	const label = this.formatLabel(tag);
 	if (!tag) {
 		return 'Select a tag to explore related posts.';
 	}
 
+	const label = this.formatLabel(tag);
+
 	if (state.isLoading) {
 		return `Loading posts for ${label}…`;
 	}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9dc6377 and ee784f6.

📒 Files selected for processing (24)
  • .github/workflows/format-check.yml (1 hunks)
  • .github/workflows/format.yml (1 hunks)
  • .github/workflows/test.yml (1 hunks)
  • .gitignore (1 hunks)
  • .nvmrc (1 hunks)
  • aliases.ts (1 hunks)
  • src/pages/PostPage.vue (7 hunks)
  • src/pages/ResumePage.vue (1 hunks)
  • src/pages/TagPostsPage.vue (1 hunks)
  • src/partials/ArticleItemPartial.vue (3 hunks)
  • src/partials/PostPageSkeletonPartial.vue (1 hunks)
  • src/partials/ResumePageSkeletonPartial.vue (1 hunks)
  • src/partials/SideNavPartial.vue (4 hunks)
  • src/partials/WidgetSocialPartial.vue (2 hunks)
  • src/router.ts (1 hunks)
  • src/support/social.ts (1 hunks)
  • src/support/tags.ts (1 hunks)
  • tests/pages/PostPage.test.ts (5 hunks)
  • tests/pages/TagPostsPage.test.ts (1 hunks)
  • tests/partials/SideNavPartial.test.ts (4 hunks)
  • tests/support/lazy-loading.test.ts (1 hunks)
  • tests/support/social.test.ts (1 hunks)
  • tests/support/tags.test.ts (1 hunks)
  • tsconfig.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/format.yml
🧰 Additional context used
🧬 Code graph analysis (6)
tests/pages/TagPostsPage.test.ts (2)
src/stores/api/store.ts (1)
  • getPosts (114-122)
src/stores/api/http-error.ts (1)
  • debugError (29-36)
tests/pages/PostPage.test.ts (1)
src/stores/api/store.ts (2)
  • getPost (123-131)
  • setSearchTerm (34-36)
tests/support/social.test.ts (1)
src/support/social.ts (1)
  • Social (18-80)
src/support/social.ts (2)
src/stores/api/store.ts (1)
  • useApiStore (28-133)
src/stores/api/http-error.ts (1)
  • debugError (29-36)
tests/support/tags.test.ts (1)
src/support/tags.ts (2)
  • TagSummaryState (3-7)
  • Tags (9-62)
tests/partials/SideNavPartial.test.ts (2)
src/stores/api/store.ts (1)
  • getSocial (87-95)
src/stores/api/client.ts (1)
  • ApiResponse (24-27)
🔇 Additional comments (20)
.gitignore (1)

12-12: Sensible addition to ignore generated test coverage artifacts.

Adding coverage/ aligns with the PR's testing focus and follows the established pattern of excluding build/generated directories. This prevents test coverage reports from being committed to version control.

.github/workflows/format-check.yml (1)

23-23: Clarify the Node version downgrade rationale.

The version has been downgraded from 22.18.0 to 22.12.0. This change is consistent across workflows and .nvmrc, but the PR description doesn't mention the rationale. Confirm whether this downgrade is intentional (e.g., to resolve dependency conflicts) or unintended.

.nvmrc (1)

1-1: Version downgrade requires justification.

The local development Node version has been downgraded to match the workflow changes. Confirm whether this addresses a specific compatibility concern or is a deliberate stability choice.

.github/workflows/test.yml (1)

15-15: Verify version downgrade doesn't introduce compatibility issues with test dependencies.

Node version has been downgraded to 22.12.0. The PR objectives note that "npm test currently fails because vitest is not found in the environment." Confirm whether this version change is intended to resolve that issue or if the problem persists independently of the Node version.

tests/support/lazy-loading.test.ts (1)

175-175: LGTM! Good cleanup for unused variable.

The underscore prefix clearly indicates this variable is intentionally unused in this test case, which is appropriate since this test focuses on href changes and observer reinitialization rather than idle callback behavior.

src/partials/PostPageSkeletonPartial.vue (1)

22-36: LGTM! Navigation skeleton enhances loading UX.

The new navigation skeleton provides visual continuity during page load, matching the breadcrumb/tag pattern referenced in the PR objectives. The styling is consistent with existing skeleton elements.

aliases.ts (1)

21-21: LGTM! Alias addition follows established patterns.

The new @support alias enables clean imports from the src/support directory, consistent with the existing alias structure.

src/support/tags.ts (3)

12-23: LGTM! Robust parameter normalization.

The method handles various input types appropriately, including arrays (taking the first element) and non-string types (returning empty string). The trimming ensures clean values.


25-32: LGTM! Clean label formatting logic.

The method properly handles null/undefined/empty inputs with a default fallback and consistently formats non-empty tags with uppercase and # prefix.


34-39: LGTM! Route construction is type-safe.

The method correctly constructs a route object targeting the TagPosts route (defined in src/router.ts), maintaining type safety with RouteLocationRaw.

tsconfig.json (1)

29-30: LGTM! Path alias configuration is correct.

The new @support/* path mapping enables TypeScript resolution for the support utilities and aligns with the alias defined in aliases.ts.

src/partials/ArticleItemPartial.vue (1)

4-58: LGTM! Consistent migration to RouterLink component.

The file correctly migrates from router-link to the PascalCase RouterLink component with the appropriate import added at Line 66. All instances are updated consistently.

src/router.ts (2)

25-25: LGTM! Named route improves navigation consistency.

Adding the Home name to the root route enables programmatic navigation using route names, consistent with other routes in the application.


33-37: LGTM! TagPosts route correctly configured.

The new route properly captures the tag parameter and aligns with the Tags.routeFor method in src/support/tags.ts (which references the 'TagPosts' route name).

tests/support/social.test.ts (2)

29-65: LGTM! Comprehensive test coverage for Social.fetch.

The tests properly verify API success, empty data fallback, and error handling scenarios. The mock setup with vi.hoisted and beforeEach reset is well-structured.


67-97: LGTM! buildNavLinks tests verify filtering and defaults.

The tests correctly validate platform filtering with an allowlist and default behavior. Including an unknown platform ('facebook') effectively tests the filtering logic.

tests/support/tags.test.ts (4)

10-27: LGTM! Comprehensive normalizeParam tests.

The tests cover string trimming, array handling (both string and non-string elements), and unsupported types, ensuring robust input handling.


29-38: LGTM! formatLabel tests cover edge cases and formatting.

The tests verify both the default label fallback for empty/null inputs and the correct uppercase formatting with # prefix.


40-47: LGTM! routeFor test verifies route structure.

The test correctly validates the generated route object. The single test case is sufficient given the method's simplicity.


49-95: LGTM! Comprehensive summaryFor tests cover all states.

The tests thoroughly validate all scenarios: missing tag, loading, error, empty results, and post counts (including singular/plural handling). This ensures consistent user messaging across all states.

@gocanto gocanto merged commit c3821c5 into main Nov 13, 2025
4 of 5 checks passed
@gocanto gocanto deleted the feat/fix-post-tags-not-displaying-2025-11-13 branch November 13, 2025 08:20
This was referenced Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants