Skip to content

Conversation

@flang
Copy link

@flang flang commented Aug 19, 2025

Buttons spacing may be customized using --fc-days-of-week-selector-button-space css variable

Close #15

image

Summary by CodeRabbit

  • Style

    • Days-of-week selector buttons now use configurable spacing (CSS variable) and a consistent horizontal layout with gaps.
    • Context-menu items display horizontally with improved alignment for a cleaner appearance.
  • Bug Fixes

    • Overflow detection updated to account for inter-button spacing, preventing unintended wrapping.
    • Overflow badge shows only when items are actually hidden.

@flang flang requested a review from paodb August 19, 2025 20:41
@coderabbitai
Copy link

coderabbitai bot commented Aug 19, 2025

Walkthrough

CSS sets context menu list items to inline-flex and introduces a configurable gap. TypeScript reads the container gap from computed styles, measures width from the container element, adds gap into per-button width calculations, and adjusts context-menu horizontal offset.

Changes

Cohort / File(s) Summary
Context menu items layout
src/main/resources/META-INF/frontend/styles/fc-days-of-week-selector-styles.css
vaadin-context-menu-overlay vaadin-context-menu-list-box::part(items) now uses display:inline-flex and gap: var(--fc-days-of-week-selector-button-space, var(--lumo-space-m)); existing padding retained.
Selector container & overflow logic
src/main/resources/META-INF/resources/frontend/src/fc-days-of-week-selector.ts
Added container [part="container"] gap styling and negative left margin on nested vaadin-context-menu; overflow detection now measures containerWidth from this._container, derives containerGap from computed style, includes containerGap when computing button widths, and adjusts overflow boundary logic accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Assessment against linked issues

Objective Addressed Explanation
Fix spacing between buttons (#15)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Added negative left margin to context menu inside container (src/main/resources/META-INF/resources/frontend/src/fc-days-of-week-selector.ts) Context-menu horizontal offset/alignment is not specified in issue #15, which only requests fixing spacing between buttons. This change appears unrelated to that objective.

Possibly related PRs

Suggested reviewers

  • paodb
  • javier-godoy

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 82a7c98 and 79f4974.

📒 Files selected for processing (2)
  • src/main/resources/META-INF/frontend/styles/fc-days-of-week-selector-styles.css (1 hunks)
  • src/main/resources/META-INF/resources/frontend/src/fc-days-of-week-selector.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/resources/META-INF/frontend/styles/fc-days-of-week-selector-styles.css
  • src/main/resources/META-INF/resources/frontend/src/fc-days-of-week-selector.ts
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-15

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 1

🧹 Nitpick comments (1)
src/main/resources/META-INF/resources/frontend/src/fc-days-of-week-selector.ts (1)

98-101: Use logical margin and match the actual gap variable

The negative margin should match the computed gap to neutralize the inter-item gap before the overflow button, and it should respect RTL via logical properties.

Apply this diff:

-            [part="container"] vaadin-context-menu {
-                margin-left: calc(var(--lumo-space-s) * -1);
-            }
+            [part="container"] vaadin-context-menu {
+                /* Cancel the inter-item gap before the overflow button, in LTR/RTL */
+                margin-inline-start: calc(var(--fc-days-of-week-selector-button-space, var(--lumo-space-m)) * -1);
+            }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d2c32bb and 82a7c98.

📒 Files selected for processing (2)
  • src/main/resources/META-INF/frontend/styles/fc-days-of-week-selector-styles.css (1 hunks)
  • src/main/resources/META-INF/resources/frontend/src/fc-days-of-week-selector.ts (3 hunks)
🔇 Additional comments (2)
src/main/resources/META-INF/frontend/styles/fc-days-of-week-selector-styles.css (1)

60-62: Gap customization via CSS variable looks good

Using a single CSS custom property with a sane fallback is the right approach here. inline-flex is appropriate for laying items horizontally within the overlay’s list-box.

src/main/resources/META-INF/resources/frontend/src/fc-days-of-week-selector.ts (1)

67-68: Exposing container gap via CSS var is spot-on

Good call aligning the container’s gap with the same CSS variable used in the overlay, keeping spacing consistent and themeable.

Buttons spacing may be customized using --fc-days-of-week-selector-button-space css variable

Close #15
Copy link
Member

@paodb paodb left a comment

Choose a reason for hiding this comment

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

LGTM

@paodb paodb merged commit a613243 into master Aug 20, 2025
3 checks passed
@paodb paodb deleted the issue-15 branch August 20, 2025 14:33
@paodb paodb moved this from To Do to Pending release in Flowing Code Addons Aug 25, 2025
@paodb paodb moved this from Pending release to Done in Flowing Code Addons Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Fix spacing between buttons

3 participants