Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TINY-11619: fix input and size input css inside toolbar #10021

Merged
merged 1 commit into from
Dec 1, 2024

Conversation

ztomaszyk
Copy link
Contributor

@ztomaszyk ztomaszyk commented Nov 28, 2024

Related Ticket: TINY-11619

Description of Changes:
Fix input and size input css inside toolbar for skin: 'small'

Pre-checks:

  • Changelog entry added
  • Tests have been added (if applicable)
  • Branch prefixed with feature/, hotfix/ or spike/

Review:

  • Milestone set
  • Docs ticket created (if applicable)

GitHub issues (if applicable):

Summary by CodeRabbit

  • New Features

    • Enhanced styling for icon buttons within context form groups for better visual differentiation.
    • Improved toolbar text field appearance to align with toolbar button height, ensuring consistent design.
  • Chores

    • Introduced new variables for toolbar button margin and padding to streamline styling and improve maintainability.

@ztomaszyk ztomaszyk added this to the 7.6.0 milestone Nov 28, 2024
@ztomaszyk ztomaszyk requested review from a team, spocke, lorenzo-pomili, hamza0867 and HAFRMO and removed request for a team November 28, 2024 16:22
@ztomaszyk ztomaszyk requested review from noxuhax and a team as code owners November 28, 2024 16:22
Copy link

coderabbitai bot commented Nov 28, 2024

Walkthrough

The changes in this pull request introduce new CSS variables and rules for styling toolbar buttons and text fields within a context form group. Specifically, it adds styles for icon buttons, ensuring they have appropriate margin and padding, and aligns the height of text fields with toolbar buttons. These adjustments aim to enhance the consistency and maintainability of the styles across the components.

Changes

File Path Change Summary
modules/oxide/src/less/theme/components/... Added CSS rules for .tox-context-form__group and updated styles for .tox-button--icon.
modules/oxide/src/less/theme/components/... Introduced variable @toolbar-textfield-height for consistent text field height with toolbar.
modules/oxide/src/less/theme/components/... Added variables @toolbar-button-margin and @toolbar-button-padding for streamlined button styles.

Assessment against linked issues

Objective Addressed Explanation
Using skin: 'small' does not affect inputs and constrain proportion button height (TINY-11619)

Suggested reviewers

  • TheSpyder
  • noxuhax
  • hamza0867
  • ltrouton
  • HAFRMO
  • lorenzo-pomili
  • spocke

🐇 In the meadow, buttons shine,
With margins set and styles divine.
Text fields tall, aligned just right,
A toolbar's charm, a lovely sight!
With every click, our joy will grow,
In this small skin, let the beauty flow! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 6bcca03 and 8d3f08b.

📒 Files selected for processing (3)
  • modules/oxide/src/less/theme/components/button/button-icon.less (1 hunks)
  • modules/oxide/src/less/theme/components/form/textfield.less (2 hunks)
  • modules/oxide/src/less/theme/components/toolbar-button/toolbar-button.less (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • modules/oxide/src/less/theme/components/button/button-icon.less
  • modules/oxide/src/less/theme/components/form/textfield.less
  • modules/oxide/src/less/theme/components/toolbar-button/toolbar-button.less

🪧 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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

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

🧹 Outside diff range and nitpick comments (2)
modules/oxide/src/less/theme/components/button/button-icon.less (1)

19-19: Track this technical debt for future refactoring

The TODO comment indicates that this is a temporary solution mixing dialog and toolbar components. This should be tracked to ensure the size input is properly refactored into a separate component.

Would you like me to create a GitHub issue to track this technical debt and the planned refactoring work?

modules/oxide/src/less/theme/components/toolbar-button/toolbar-button.less (1)

22-23: Document the purpose of the +1px margin adjustment.

While extracting these values into variables improves maintainability, please add a comment explaining why we need the additional 1px in @toolbar-button-margin. This will help future maintainers understand the reasoning behind this specific adjustment.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 38fdcb2 and 6bcca03.

📒 Files selected for processing (3)
  • modules/oxide/src/less/theme/components/button/button-icon.less (1 hunks)
  • modules/oxide/src/less/theme/components/form/textfield.less (2 hunks)
  • modules/oxide/src/less/theme/components/toolbar-button/toolbar-button.less (2 hunks)
🔇 Additional comments (4)
modules/oxide/src/less/theme/components/button/button-icon.less (1)

20-26: LGTM! Verify toolbar variables are properly defined

The CSS implementation looks good and aligns with the PR objectives. The use of @toolbar-button-margin and @toolbar-button-padding variables promotes consistency.

Let's verify these variables are properly defined:

✅ Verification successful

Variables are properly defined in toolbar-button.less

Both variables @toolbar-button-margin and @toolbar-button-padding are defined in modules/oxide/src/less/theme/components/toolbar-button/toolbar-button.less:

  • @toolbar-button-margin: (@toolbar-button-spacing-y + 1px) @toolbar-button-spacing-x @toolbar-button-spacing-y 0
  • @toolbar-button-padding: 0
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the toolbar button variables are defined in the expected locations
# Expected: Find definitions of @toolbar-button-margin and @toolbar-button-padding

# Search for toolbar button variable definitions
rg -t less "@toolbar-button-(margin|padding)\s*:" modules/oxide/src/less/

Length of output: 366

modules/oxide/src/less/theme/components/form/textfield.less (2)

28-29: LGTM! Good variable naming and reuse.

The new variable promotes consistency by reusing the toolbar button height for text fields.


69-70: LGTM! Verify impact on other skins.

The changes correctly address the height issues by removing the minimum height constraint and setting an explicit height. This should fix the 'small' skin issues mentioned in TINY-11619.

Let's verify if these changes affect other skins:

✅ Verification successful

Let me gather more information about the skins and theme structure to ensure a thorough verification.


Let me check the specific skin implementations to ensure there are no overrides.


Changes are safe across all skins and themes

The toolbar textfield height changes are safe because:

  1. The height is derived from @toolbar-button-height which is properly defined in both the default theme and skins
  2. The tinymce-5 skin defines it as 34px while the default theme sets it to 28px
  3. No skin overrides the textfield-specific styles or the height variable
  4. The removal of min-height doesn't conflict with any skin-specific styles
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for other skin-specific styles that might conflict with these changes

# Search for skin-specific styles affecting toolbar text fields
rg -l "tox-toolbar-textfield" modules/oxide/src/less/theme/skins/

# Search for other height-related styles for toolbar text fields
rg "height.*toolbar.*textfield|toolbar.*textfield.*height" modules/oxide/src/less/theme/

Length of output: 442


Script:

#!/bin/bash
# Let's check the overall theme and skins structure
fd -t d "skins|theme" modules/oxide/src

# Check for any textfield-related styles across the codebase
rg -l "tox-toolbar-textfield" modules/oxide/src

# Check the variable definition and its usage
rg "@toolbar-button-height" modules/oxide/src

Length of output: 1418


Script:

#!/bin/bash
# Check skin-specific styles
rg -l "textfield|toolbar" modules/oxide/src/less/skins/

# Get content of any skin files that might affect toolbar or textfield styles
fd . modules/oxide/src/less/skins/ -e less --exec cat {}

Length of output: 22628

modules/oxide/src/less/theme/components/toolbar-button/toolbar-button.less (1)

72-72: Verify the changes with the 'small' skin.

The changes look good and improve maintainability. However, since the PR's main objective is to fix input styling with the 'small' skin, we should verify that these changes achieve the desired effect.

Let's verify if there are any skin-specific overrides that might affect these changes:

Also applies to: 74-74

✅ Verification successful

The margin changes are safe and do not affect the 'small' skin

After analyzing the toolbar-button.less file, I can confirm that:

  1. There are no skin-specific styles that override these values
  2. The margin is controlled by variables that are independent of skin types
  3. The only size variations are handled through specific classes (.tox-tbtn--md and .tox-tbtn--lg) which don't affect the base margin
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any skin-specific styles that might override these values
rg -l "small.*skin|skin.*small" --type less

Length of output: 45


Script:

#!/bin/bash
# Let's try a broader search for skin-related styles and toolbar button styles
rg -g "*.less" "\.tox-tbtn.*skin|skin.*\.tox-tbtn" -l

# Also search for any small-related styles in toolbar button
rg -g "*.less" "\.tox-tbtn.*small|small.*\.tox-tbtn" -l

# Let's also check the specific file for any skin or size-related modifiers
cat "modules/oxide/src/less/theme/components/toolbar-button/toolbar-button.less"

Length of output: 8403

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.

3 participants