Skip to content

revert: revert mobile first from sync #2980

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

Merged
merged 3 commits into from
Feb 27, 2025
Merged

revert: revert mobile first from sync #2980

merged 3 commits into from
Feb 27, 2025

Conversation

gimmyhehe
Copy link
Member

@gimmyhehe gimmyhehe commented Feb 27, 2025

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • Style
    • Refined mobile layouts across components with updated spacing and line heights.
    • Enhanced form labels and inline elements for clearer, more responsive display.
    • Improved numeric field styling for consistent presentation on small screens.
    • Streamlined radio button visuals by simplifying class rules for a cleaner user interface.
    • Adjusted checkbox and input text spacing for better alignment on small screens.

Copy link

coderabbitai bot commented Feb 27, 2025

Walkthrough

The changes update CSS class bindings and styling in several Vue component files. In the form-item and numeric mobile-first files, class names are adjusted based on the state.isDisplayOnly property to refine spacing and line heights. In the radio token file, redundant styling properties have been removed from CSS class definitions. Additionally, the bottom margin in the form-item prefix class has been increased. No changes have been made to the control flow or to any public API declarations.

Changes

Files Change Summary
packages/vue/src/form-item/src/mobile-first.vue
packages/vue/src/numeric/src/mobile-first.vue
packages/vue/src/checkbox/src/mobile-first.vue
packages/vue/src/input/src/mobile-first.vue
Updated CSS class bindings for display-only components. In form-item, added leading-5 to labels, adjusted span max-height from theme(spacing.12) to theme(spacing.10), and added top-px. In numeric, replaced sm:leading-5.5 with sm:leading-normal. In checkbox, changed leading-5.5 to leading-5.
packages/vue/src/radio/src/token.ts Refined CSS class definitions for radio components by replacing/removing properties such as align-middle and cursor-default, streamlining the styling.
packages/theme-saas/src/form-item/index.less Increased the margin-bottom property of the form item prefix class from mb-4 to mb-5.

Possibly related PRs

Suggested labels

chore

Suggested reviewers

  • zzcr

Poem

I’m a rabbit, swift and light,
Hopping over changes left and right.
CSS classes pruned with care,
Spacing fixed with flair.
From mobile-first to radio bright,
I celebrate code that’s just right!
🐰✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/vue/src/form-item/src/mobile-first.vue

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-vue".

(The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-vue@latest --save-dev

The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

packages/vue/src/checkbox/src/mobile-first.vue

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-vue".

(The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-vue@latest --save-dev

The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

packages/vue/src/input/src/mobile-first.vue

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-vue".

(The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-vue@latest --save-dev

The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • 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 generate docstrings to generate docstrings for this 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

Walkthrough

This pull request reverts changes related to the mobile-first approach in the Vue components. It primarily adjusts class definitions and styling attributes to remove mobile-first specific styles, ensuring consistency across different display modes.

Changes

File Summary
packages/vue/src/form-item/src/mobile-first.vue Adjusted class definitions to remove mobile-first specific styles, ensuring consistent styling across different display modes.
packages/vue/src/numeric/src/mobile-first.vue Modified class attributes to revert mobile-first styling, ensuring uniform text appearance.
packages/vue/src/radio/src/token.ts Updated class definitions to remove mobile-first specific styles, aligning with the reverted approach.

@@ -26,15 +26,15 @@
v-if="slots.label || label"
:class="
m(
'py-3 sm:py-0 sm:min-h-[theme(spacing.5)] relative align-bottom float-left text-sm pr-3 sm:pr-4 box-border',
'py-3 sm:py-0 sm:min-h-[theme(spacing.5)] relative align-bottom float-left text-sm pr-3 sm:pr-4 box-border leading-5',

Choose a reason for hiding this comment

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

Ensure that the removal of mobile-first specific styles does not affect the layout and functionality across different screen sizes. Test thoroughly on various devices.

@@ -103,7 +103,7 @@
<div
data-tag="numeric-display-only"
v-if="state.isDisplayOnly"
class="sm:leading-5.5 text-color-text-primary"
class="sm:leading-normal text-color-text-primary"

Choose a reason for hiding this comment

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

Verify that the change from sm:leading-5.5 to sm:leading-normal maintains the intended visual hierarchy and readability.

Copy link

[e2e-test-warn]
The component to be tested is missing.

The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug".

Please make sure you've read our contributing guide

@@ -1,5 +1,6 @@
export const classes = {
'radio-default': 'radio inline-flex items-center leading-4 cursor-pointer sm:flex-row py-px sm:py-0 h-fit',
'radio-default':

Choose a reason for hiding this comment

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

Check that the alignment change in radio-default class does not disrupt the layout in different contexts, especially in forms and interactive elements.

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

🧹 Nitpick comments (2)
packages/theme-saas/src/form-item/index.less (2)

71-74: Adjusted Label Line Height in Medium Variant.
Line 72 introduces @apply ~'leading-5.5'; for the &--medium &__label block. This refined line height value appears to fine-tune text alignment but should be double-checked for visual consistency with other heading and label styles across components.


151-153: Margin-Top Adjustment for Switch Component in Mini Variant.
In the mini variant (lines 151–153), the switch element now gets @apply ~'mt-0.5';. This reduced top margin should be carefully reviewed to confirm it maintains consistency with the design of other mini components while ensuring proper visual separation.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0e444e8 and 1adfb72.

📒 Files selected for processing (4)
  • packages/theme-saas/src/form-item/index.less (1 hunks)
  • packages/vue/src/checkbox/src/mobile-first.vue (1 hunks)
  • packages/vue/src/form-item/src/mobile-first.vue (6 hunks)
  • packages/vue/src/input/src/mobile-first.vue (2 hunks)
✅ Files skipped from review due to trivial changes (2)
  • packages/vue/src/input/src/mobile-first.vue
  • packages/vue/src/checkbox/src/mobile-first.vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/vue/src/form-item/src/mobile-first.vue
🔇 Additional comments (4)
packages/theme-saas/src/form-item/index.less (4)

4-17: Prefix Variable Definitions Consistency.
All prefix variables (e.g., @form-item-prefix-cls, @autocomplete-prefix-cls, etc.) are defined using the literal string notation (~'...') which is appropriate for Less when you need to output a literal value. Please confirm that the global variable @css-prefix is defined elsewhere in the project to ensure these expressions resolve correctly.


20-23: Increased Bottom Margin for Form Item Prefix.
Line 21 now applies mb-5 instead of the previous mb-4. This change increases the bottom margin for elements using the form item prefix class, which may affect the vertical spacing in layouts. Please verify that this adjustment aligns with the overall design guidelines and related mobile/desktop styling, especially given the context of reverting mobile-first changes.


103-106: Adjusted Margin-Top for Switch Component in Content Block.
Line 104 applies @apply ~'mt-1.5'; to the switch component within the general content section. Ensure that this margin-top value creates harmonious spacing relative to surrounding elements and matches the intended design specifications.


242-248: Changed Margin-Left for Inline Error Display.
Line 247 uses @apply ~'ml-2.5'; for the inline error styling. Please verify that this increased left margin provides adequate spacing from adjacent elements without disrupting the overall layout of inline error messages.

@zzcr zzcr merged commit 147b9f3 into dev Feb 27, 2025
10 checks passed
@kagol kagol deleted the cgm/revert-sync-form branch April 14, 2025 12:26
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