Skip to content

refactor: replace nested ternaries in LinkToggle and ThemePanel - #21

Merged
sauce-base merged 1 commit into
mainfrom
renanroble/sc-670-improve-laravel-playwright-module-and-tests
Oct 28, 2026
Merged

sauce-base merged 1 commit into
mainfrom
renanroble/sc-670-improve-laravel-playwright-module-and-tests

Conversation

@roble

@roble roble commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • LinkToggle.vue: the tooltip label uses early returns instead of a nested ternary.
  • ThemePanel.vue: the linked state of a colour group (all on, all off, mixed) is now allOn || (allOff ? false : null), in two places.

Same behaviour; it follows the frontend rule against nested ternaries.

Test plan

  • Themes E2E on Vue.
  • Type check and build.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Simplified how link labels and theme sync states are determined. Existing labels, tooltip behavior, and mixed-state indicators remain unchanged. No user-visible behavior changes are included.

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

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: 44e743cb-b05f-427b-8d60-6639ff393a76
Commits

Reviewing files that changed from the base of the PR and between 3107b2c and a689582.

Files selected for processing: 2
  • resources/js/vue/components/LinkToggle.vue
  • resources/js/vue/components/ThemePanel.vue

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

Walkthrough

The toggle label selection now uses explicit branches. The group and sidebar sync-state calculations use a revised expression with the same described outcomes.

Changes: Toggle and sync-state expressions

Layer / File(s) Summary
Update label and sync-state expressions
resources/js/vue/components/LinkToggle.vue, resources/js/vue/components/ThemePanel.vue
stateLabel uses explicit branches for its existing tooltip props and translation fallbacks. The group and sidebar sync-state calculations use `allOn

Priority: Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Refactor

Merge Risk: Minimal · up to a6895

No actionable merge-blocking issue remains; the refactor is ready to merge.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: replacing nested ternaries in LinkToggle and ThemePanel.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

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

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

@sauce-base
sauce-base merged commit fecdd6f into main Oct 28, 2026
7 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.

2 participants