Skip to content

fix: update overflow item selection state immediately on click#28

Open
paodb wants to merge 1 commit into
masterfrom
issue-27
Open

fix: update overflow item selection state immediately on click#28
paodb wants to merge 1 commit into
masterfrom
issue-27

Conversation

@paodb
Copy link
Copy Markdown
Member

@paodb paodb commented May 15, 2026

The cloned button's click handler treated theme as a binary on/off attribute and wiped it whenever any token was present, instead of toggling only the "primary" token. Now toggle only "primary" while preserving any other tokens, matching the server-side behavior of getThemeNames().set("primary", state).

Tested locally in both Vaadin 24 & Vaadin 25 profiles.

Close #27

Summary by CodeRabbit

  • Bug Fixes
    • Improved theme token handling in the days-of-week selector overflow button to correctly manage the primary theme token while preserving other theme tokens.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 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: 20d83fe2-da67-41b5-9257-4007890375cd

📥 Commits

Reviewing files that changed from the base of the PR and between ebd2785 and 21a797c.

📒 Files selected for processing (1)
  • src/main/resources/META-INF/resources/frontend/src/fc-days-of-week-selector.ts

Walkthrough

The DaysOfWeekSelector overflow button click handler is refined to toggle the primary theme token independently from other theme tokens. The handler now parses the theme attribute, selectively adds or removes primary, and cleans up the attribute when no tokens remain.

Changes

Theme Token Toggle Refinement

Layer / File(s) Summary
Overflow button click handler theme token toggle
src/main/resources/META-INF/resources/frontend/src/fc-days-of-week-selector.ts
The cloned overflow button's click event handler parses the theme attribute as a space-separated token list, toggles the primary token independently, and updates or removes the theme attribute based on whether any tokens remain.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • FlowingCode/DayOfWeekSelectorAddon#19: Both PRs adjust DayOfWeekSelector's theming for its overflow/context-menu UI—this PR refines which theme tokens are toggled on the cloned overflow button, while the retrieved PR adds a scoped theme attribute for the context menu and supporting styles.
  • FlowingCode/DayOfWeekSelectorAddon#14: This PR refines the same overflow button click handler in fc-days-of-week-selector.ts that was introduced by the "add overflow button when component is too narrow" PR, specifically changing how the cloned button's theme tokens are toggled.

Suggested reviewers

  • javier-godoy
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title describes updating overflow item selection state on click, which directly addresses the main issue of selection state not being visually updated for overflow items.
Linked Issues check ✅ Passed The PR fixes the core issue by updating the cloned button's click handler to properly toggle only the 'primary' theme token while preserving other tokens, aligning with server-side behavior and immediately reflecting the selected visual state.
Out of Scope Changes check ✅ Passed All changes are focused on fixing the overflow item selection state issue. The modifications to the DaysOfWeekSelector theme token handling are directly aligned with the linked issue's requirements.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-27

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.

@sonarqubecloud
Copy link
Copy Markdown

@paodb paodb requested review from javier-godoy and scardanzan May 15, 2026 20:10
@paodb paodb marked this pull request as ready for review May 15, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Do

Development

Successfully merging this pull request may close these issues.

Selection state not visually updated for items inside overflow

1 participant