Skip to content

feat: stories for VoteButton and ItemCard - #24

Merged
roble merged 2 commits into
mainfrom
dev-2026-11-27
Nov 27, 2026
Merged

roble merged 2 commits into
mainfrom
dev-2026-11-27

Conversation

@roble

@roble roble commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Release from dev. Expected: v3.7.0 (from v3.6.0). Merge with a merge commit.

Release after core v3.2.0 and auth (CI installs auth at its released version).

Changes

  • feat: stories for VoteButton and ItemCard

Checks

Pint passes. Night run 2026-11-26 (fresh installs, Vue and React, PHPUnit and Playwright): no new failures.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Voting callbacks are now optional, allowing item and vote buttons to be used without a vote handler.
  • Tests
    • Added interactive examples covering item cards and vote buttons, including voted, pending, status, and comments-disabled states.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

This change makes React ItemCard and VoteButton vote callbacks optional. It adds React and Vue Storybook stories for both components, covering default voting, status, comments, voted state, and pending state.

Changes: Vote components

Layer / File(s) Summary
Optional vote callbacks
resources/js/react/components/ItemCard.tsx, resources/js/react/components/VoteButton.tsx
Both components accept an optional vote callback and skip invoking it when no handler is provided.
ItemCard story coverage
resources/js/react/components/ItemCard.stories.tsx, resources/js/vue/components/ItemCard.stories.ts
Stories check voting, status visibility, comments visibility, and voted state.
VoteButton story coverage
resources/js/react/components/VoteButton.stories.tsx, resources/js/vue/components/VoteButton.stories.ts
Stories check voting, voted state, and whether the pending button is disabled.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Other

Merge Risk: Minimal · up to 72404

This change adds Storybook stories for the vote components and makes the React vote callbacks optional. No concrete production risk was found, and existing callers that pass a handler keep working.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat: stories for VoteButton and ItemCard" names the main change. The PR adds Storybook stories for VoteButton and ItemCard in both React and Vue, and makes onVote optional in both componen…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "feat: stories for VoteButton and ItemCard" names the main change. The PR adds Storybook stories for VoteButton and ItemCard in both React and Vue, and makes onVote optional in both components. The title omits the onVote optional change and the Vue/React split, which is acceptable because the title covers the primary change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ae73fae-b90e-4d20-b24f-f40998b4e2ad
Commits

Reviewing files that changed from the base of the PR and between 397c5ed and 724048b.

Files selected for processing: 6

  • resources/js/react/components/ItemCard.stories.tsx
  • resources/js/react/components/ItemCard.tsx
  • resources/js/react/components/VoteButton.stories.tsx
  • resources/js/react/components/VoteButton.tsx
  • resources/js/vue/components/ItemCard.stories.ts
  • resources/js/vue/components/VoteButton.stories.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
67.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@roble

roble commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

SonarCloud verdict: the only failing condition is new-code duplication. Reliability, security, maintainability and hotspots all pass. The duplicates are the Vue and React stories, which mirror each other on purpose: each stack has its own file, and an app installs only one stack. Not a defect. (Not a required check.)

🤖 Generated with Claude Code

@roble
roble merged commit 92c0a78 into main Nov 27, 2026
16 of 17 checks passed
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.

1 participant