Skip to content

Conversation

@zouawen
Copy link
Contributor

@zouawen zouawen commented Oct 18, 2025

Description

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Checklist

ℹ️ Check all checkboxes - this will indicate that you have done everything in accordance with the rules in CONTRIBUTING.

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs:dev command.
  • Run the tests with pnpm test.
  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

  • New Features

    • Enhanced authentication layout with improved panel transitions and positioning indicators.
    • Added auto-focus functionality to lock screen password field for improved user experience.
    • Enabled split handle and split line options in layout playground component.
  • Bug Fixes

    • Fixed modal handler naming for consistency.
  • Style

    • Increased animation duration and adjusted keyframe transform values for smoother transitions.
    • Refined checkbox, input, and tabs component styling for better visual consistency.
  • Chores

    • Updated localization file structure.

@changeset-bot
Copy link

changeset-bot bot commented Oct 18, 2025

⚠️ No Changeset found

Latest commit: 38f91da

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 18, 2025

Walkthrough

This PR includes styling refinements across UI components, authentication panel layout restructuring with dynamic data-side attributes, lock screen modal autofocus integration via getFieldComponentRef, handler refactoring in the modal component, and updates to mock data parent-child references and playground examples.

Changes

Cohort / File(s) Change Summary
UI Animation & Styling
packages/@core/base/design/src/css/ui.css
Increased side-content animation duration from 0.2s to 0.3s; adjusted slide-down/up/left/right keyframe transform starting positions (±10px → ±50px).
Header Icon Updates
packages/@core/ui-kit/layout-ui/src/vben-layout.vue
Replaced Menu icon with conditional IconifyIcon rendering (ep:fold when sidebar shown, ep:expand when hidden); updated import source from Menu to IconifyIcon.
Modal Lifecycle Handlers
packages/@core/ui-kit/popup-ui/src/modal/modal.vue
Fixed handler typo handerOpenAutoFocus → handleOpenAutoFocus; added new handleOpened() handler dispatching onOpened via requestAnimationFrame; updated template bindings.
Component Style Refinements
packages/@core/ui-kit/shadcn-ui/src/ui/checkbox/Checkbox.vue,...input/Input.vue,...tabs/TabsList.vue
Added hover:border-primary to checkbox; updated input placeholder opacity to /50; changed TabsList border-radius from rounded-lg to rounded-md.
Authentication Layout Restructuring
packages/effects/layouts/src/authentication/authentication.vue,...form.vue
Added dynamic wrapper with key and conditional enter-x/-enter-x classes to authentication panels; introduced data-side attributes on panels; added dataSide prop to AuthenticationFormView; updated right panel width w-[34%] → w-2/5.
Lock Screen Focus Integration
packages/effects/layouts/src/widgets/lock-screen/lock-screen-modal.vue,lock-screen.vue
Integrated getFieldComponentRef from useVbenForm; added onOpened lifecycle to modal configuration with autofocus routine targeting lockScreenPassword field; added focus logic when showUnlockForm toggles.
Data & Configuration Updates
apps/backend-mock/utils/mock-data.ts,playground/src/locales/langs/zh-CN/system.json
Updated menu item parent references (pid 201 → 202) for SystemDeptCreate/Edit/Delete; reordered root-level title key in system.json.
Playground Example Props
playground/src/views/examples/layout/col-page.vue
Added splitHandle and splitLine props (both true by default); added flex items-center justify-center classes to collapsed state Show button.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Modal as Lock Screen Modal
    participant Form as useVbenForm
    participant Input as Password Input
    
    User->>Modal: Opens lock screen
    Modal->>Modal: Modal opens (onOpened triggered)
    Modal->>Form: getFieldComponentRef('lockScreenPassword')
    Form-->>Modal: Returns field component ref
    Modal->>Input: input.focus()
    Input-->>User: Focus acquired on password field
    
    Note over Modal,Input: Auto-focus enables passwordfield on modal open
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

The PR combines straightforward style tweaks (Tailwind utilities, animation adjustments) with moderate complexity refactors in authentication panel layout restructuring and lock screen modal integration. While changes span 13 files, they follow consistent patterns within cohorts, but require verification of animation behavior, modal lifecycle timing, and authentication state management.

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • anncwb
  • vince292007
  • mynetfan
  • jinmao88

Poem

🐰 Hop, hop, autofocus brings cheer,
Animations dance without fear,
Data-sides align with grace,
Icons swap and find their place,
Polish bright from top to toe,
Watch the sidebar ebb and flow!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description is largely incomplete and does not adequately fulfill the template requirements. The "Description" section is entirely empty with no explanation of what changes were made or why, despite the changeset containing multiple significant modifications across numerous components and files. Additionally, all type-of-change checkboxes (Bug fix, New feature, Breaking change, and Documentation update) and all checklist items are marked as checked simultaneously, which is implausible and suggests they were not actually verified by the author. The description provides no concrete details, issue links, or context that would help reviewers understand the scope and impact of these changes.
Title Check ❓ Inconclusive The PR title "chore: 新增和优化一些组件功能,详见提交信息" (which translates to "Add and optimize some component features, see commit messages for details") is vague and generic. While it is broadly related to the changeset—which does contain multiple component additions and optimizations—the title uses non-descriptive language ("一些组件功能" = "some component features") and relies on directing reviewers to commit messages rather than conveying specific information about the primary changes. The title fails to clearly summarize what was actually changed across the numerous files and components modified in this PR.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
Contributor

@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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/@core/ui-kit/popup-ui/src/modal/modal.vue (1)

183-187: Critical: drawer.vue has the same typo and needs fixing.

The rename in modal.vue is correct. However, verification found that packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue still has the old typo:

  • Line 138: Function is still named handerOpenAutoFocus (should be handleOpenAutoFocus)
  • Line 204: Template still references the old typo: @open-auto-focus="handerOpenAutoFocus"

Apply the same rename fix to drawer.vue to keep both files consistent.

🧹 Nitpick comments (8)
packages/@core/ui-kit/shadcn-ui/src/ui/checkbox/Checkbox.vue (1)

34-34: Avoid hover highlight on disabled checkboxes

hover:border-primary will still apply when disabled. Prevent misleading affordance.

Apply one of:

- '... border-border hover:border-primary peer h-4 w-4 shrink-0 rounded-sm border transition focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50'
+ '... border-border hover:border-primary peer h-4 w-4 shrink-0 rounded-sm border transition focus-visible:outline-none focus-visible:ring-1 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50'

Or neutralize hover explicitly:

- '... hover:border-primary ...'
+ '... hover:border-primary disabled:hover:border-border ...'
packages/@core/ui-kit/shadcn-ui/src/ui/input/Input.vue (1)

27-27: Verify placeholder contrast at 50% opacity

placeholder:text-muted-foreground/50 may drop below WCAG contrast in certain themes. Consider slightly stronger contrast (e.g., /60 or /70) or placeholder:opacity-70, and validate in light/dark and high-contrast modes.

packages/@core/base/design/src/css/ui.css (1)

2-2: Add reduced-motion fallback for larger entrance animations

With longer duration and 50px travel, respect users’ motion preferences.

Add a reduced-motion override:

+@media (prefers-reduced-motion: reduce) {
+  .side-content {
+    animation: none !important;
+  }
+  .breadcrumb-transition-enter-active {
+    transition: none !important;
+  }
+}

Optional perf nit:

-.side-content {
+.side-content {
   animation-duration: 0.3s;
   animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
+  will-change: transform, opacity;
 }

Also applies to: 38-47, 49-59, 61-71, 73-83

packages/@core/ui-kit/popup-ui/src/modal/modal.vue (1)

212-216: Guard onOpened to avoid races if closed before rAF fires.

If the modal is closed quickly, onOpened could run after close. Add an open-state check inside rAF.

-const handleOpened = () => {
-  requestAnimationFrame(() => {
-    props.modalApi?.onOpened();
-  });
-};
+const handleOpened = () => {
+  requestAnimationFrame(() => {
+    if (state?.value?.isOpen) {
+      props.modalApi?.onOpened();
+    }
+  });
+};
packages/effects/layouts/src/widgets/lock-screen/lock-screen.vue (1)

78-84: Harden focus routine (fallback + preventScroll) and consider reuse.

Use a fallback selector and prevent scroll; same pattern exists in lock-screen-modal.vue — consider extracting a tiny helper.

-  if (showUnlockForm.value) {
-    requestAnimationFrame(() => {
-      getFieldComponentRef('password')
-        ?.$el?.querySelector('[name="password"]')
-        ?.focus();
-    });
-  }
+  if (showUnlockForm.value) {
+    requestAnimationFrame(() => {
+      const root = getFieldComponentRef('password')?.$el as HTMLElement | undefined;
+      const input =
+        root?.querySelector<HTMLInputElement>('[name="password"]') ??
+        root?.querySelector<HTMLInputElement>('input');
+      input?.focus({ preventScroll: true });
+    });
+  }
packages/effects/layouts/src/widgets/lock-screen/lock-screen-modal.vue (2)

30-53: Form helpers LGTM; unify validation message key.

Schema and helpers look good. For consistency with lock-screen.vue, consider using authentication.passwordTip as the min rule message.

-          rules: z
-            .string()
-            .min(1, { message: $t('ui.widgets.lockScreen.placeholder') }),
+          rules: z
+            .string()
+            .min(1, { message: $t('authentication.passwordTip') }),

64-70: Improve autofocus robustness (fallback + preventScroll) and dedupe.

Same as lock-screen.vue: add input fallback and preventScroll; optionally extract a shared helper.

-  onOpened() {
-    requestAnimationFrame(() => {
-      getFieldComponentRef('lockScreenPassword')
-        ?.$el?.querySelector('[name="lockScreenPassword"]')
-        ?.focus();
-    });
-  },
+  onOpened() {
+    requestAnimationFrame(() => {
+      const root = getFieldComponentRef('lockScreenPassword')?.$el as HTMLElement | undefined;
+      const input =
+        root?.querySelector<HTMLInputElement>('[name="lockScreenPassword"]') ??
+        root?.querySelector<HTMLInputElement>('input');
+      input?.focus({ preventScroll: true });
+    });
+  },
packages/effects/layouts/src/authentication/authentication.vue (1)

90-96: Transition wrapper is fine; consider reduced-motion.

Optional: add motion-reduce classes to respect user preferences on transitions.

-  class="flex-col-center mr-20 h-full"
+  class="flex-col-center mr-20 h-full motion-reduce:transition-none motion-reduce:animate-none"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 03ce030 and 38f91da.

📒 Files selected for processing (13)
  • apps/backend-mock/utils/mock-data.ts (3 hunks)
  • packages/@core/base/design/src/css/ui.css (5 hunks)
  • packages/@core/ui-kit/layout-ui/src/vben-layout.vue (2 hunks)
  • packages/@core/ui-kit/popup-ui/src/modal/modal.vue (3 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/ui/checkbox/Checkbox.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/ui/input/Input.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/ui/tabs/TabsList.vue (1 hunks)
  • packages/effects/layouts/src/authentication/authentication.vue (4 hunks)
  • packages/effects/layouts/src/authentication/form.vue (2 hunks)
  • packages/effects/layouts/src/widgets/lock-screen/lock-screen-modal.vue (2 hunks)
  • packages/effects/layouts/src/widgets/lock-screen/lock-screen.vue (2 hunks)
  • playground/src/locales/langs/zh-CN/system.json (2 hunks)
  • playground/src/views/examples/layout/col-page.vue (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Check (windows-latest)
  • GitHub Check: post-update (ubuntu-latest)
  • GitHub Check: post-update (windows-latest)
🔇 Additional comments (12)
apps/backend-mock/utils/mock-data.ts (1)

277-303: LGTM! Correct parent-child reference fix.

The pid values for the three SystemDept child items (Create, Edit, Delete) have been correctly updated from 201 to 202, aligning them with their actual parent SystemDept (id: 202) rather than SystemMenu (id: 201). This fixes the data integrity issue in the menu hierarchy.

playground/src/views/examples/layout/col-page.vue (2)

25-26: LGTM! Appropriate demo defaults.

Setting splitHandle and splitLine to true by default is ideal for a playground example, as it immediately showcases these features to users exploring the component.


45-49: LGTM! Button styling improvement.

The restructured Button component with centering classes improves the visual presentation of the expand control when the left panel is collapsed.

playground/src/locales/langs/zh-CN/system.json (2)

54-66: Nested title fields remain unchanged and consistent.

The nested "title" fields within the dept, menu, and role sections (lines 12, 46, 55 respectively) are preserved, maintaining consistency across the locale structure.


1-2: Root-level title field is correctly used by frontend code.

Verification confirms the root-level "title": "系统管理" field is actively consumed in playground/src/router/routes/modules/system.ts (line 10) via the i18n call $t('system.title'). The change is functionally necessary and properly structured. The JSON syntax is correct with no semantic issues.

packages/@core/ui-kit/shadcn-ui/src/ui/tabs/TabsList.vue (1)

24-24: LGTM — radius alignment

The switch to rounded-md matches other controls (e.g., inputs). No behavior change.

packages/effects/layouts/src/authentication/form.vue (2)

6-8: New dataSide prop LGTM.

Typed union is clear and safe.


23-24: Code changes verified—no issues found.

CSS styling in packages/@core/base/design/src/css/ui.css properly targets .side-content with [data-side] attribute selectors for all expected values (top, bottom, left, right). The Vue binding in form.vue is correct, and animations will trigger appropriately based on the dataSide prop value.

packages/effects/layouts/src/authentication/authentication.vue (2)

53-53: Left panel data-side LGTM.

Consistent with new prop.


120-120: Center panel data-side="bottom" LGTM.

Matches the new layout semantics.

packages/@core/ui-kit/popup-ui/src/modal/modal.vue (1)

262-263: Event wiring verified as correct.

All concerns confirmed:

  • DialogContent emits "opened" (packages/@core/ui-kit/shadcn-ui/src/ui/dialog/DialogContent.vue:73)
  • modal.vue template binding @opened="handleOpened" is consistent with the handler
  • handleOpened handler is properly defined and invokes the callback chain
packages/effects/layouts/src/widgets/lock-screen/lock-screen.vue (1)

40-40: No issues found; getFieldComponentRef is properly exported and typed.

Verification confirms that getFieldComponentRef is:

  • Defined as a public method in the FormApi class with correct signature
  • Included in the ExtendedFormApi type via inheritance (ExtendedFormApi = FormApi & {...})
  • Properly returned from useVbenForm and available for destructuring
  • Already in active use across multiple components with no TS drift

The review comment's concerns have been addressed by the current implementation.

useLayoutHeaderStyle,
} from '@vben-core/composables';
import { Menu } from '@vben-core/icons';
import { IconifyIcon } from '@vben-core/icons';
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Icon state is bound to availability, not collapse; mobile handler only opens

  • The icon condition uses showSidebar (availability) instead of collapsed state, so it can display “fold” even when the sidebar is already collapsed, especially on mobile.
  • On mobile, handleHeaderToggle only opens (sidebarCollapse = false), so clicking again won’t close, while the “fold” icon suggests it would.

Fix by binding the icon to sidebarCollapse and truly toggling on mobile:

@@
-          <VbenIconButton
+          <VbenIconButton
             v-if="showHeaderToggleButton"
             class="my-0 mr-1 rounded-md"
             @click="handleHeaderToggle"
           >
-            <IconifyIcon v-if="showSidebar" icon="ep:fold" />
-            <IconifyIcon v-else icon="ep:expand" />
+            <IconifyIcon :icon="sidebarCollapse ? 'ep:expand' : 'ep:fold'" />
           </VbenIconButton>

And update the handler to actually toggle on mobile:

@@
 function handleHeaderToggle() {
-  if (props.isMobile) {
-    sidebarCollapse.value = false;
-  } else {
+  if (props.isMobile) {
+    sidebarCollapse.value = !sidebarCollapse.value;
+  } else {
     emit('toggleSidebar');
-  }
+  }
 }

Also applies to: 562-564

🤖 Prompt for AI Agents
In packages/@core/ui-kit/layout-ui/src/vben-layout.vue around line 13 and also
at lines 562-564, the icon binding and mobile header toggle are incorrect:
change the icon condition to use the collapsed state (sidebarCollapse) instead
of showSidebar so the icon reflects collapse/expand, and modify
handleHeaderToggle to truly toggle sidebarCollapse on mobile (invert the
boolean) instead of only setting sidebarCollapse = false; apply the same fix to
the other occurrence at lines 562-564 so both icon rendering and mobile toggle
behavior are consistent.

Comment on lines +136 to +137
class="min-h-full w-2/5 flex-1"
data-side="right"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Right panel width + data-side LGTM; verify breakpoints.

w-2/5 changes layout density; quickly validate on common breakpoints (sm/md/lg).


🏁 Script executed:

#!/bin/bash
# Grep for any conflicting width utilities around auth panels
rg -n -C2 -S $'AuthenticationFormView|w-2/5|w-1/2|w-1/3' --type=vue

Length of output: 27


I need to correct the shell script approach since the --type=vue flag isn't recognized. Let me search for the file and examine its content:




🏁 Script executed:

#!/bin/bash
# Find the authentication.vue file
fd -e vue authentication

# If found, examine the file content around lines 136-137
if fd -e vue authentication | grep -q .; then
  cat "packages/effects/layouts/src/authentication/authentication.vue" | head -150 | tail -30
fi

Length of output: 798


🏁 Script executed:

#!/bin/bash
# Broader search for width utilities in Vue files (Tailwind classes)
rg -n 'w-2/5|w-1/2|w-1/3|flex-1|sm:w-|md:w-|lg:w-' packages/effects/layouts/src/authentication/ || echo "Search completed with no matches or directory not found"

Length of output: 1222


Missing responsive breakpoint utilities on side panels.

The right panel at line 136 uses w-2/5 flex-1 without responsive variants. This fixed width applies across all breakpoints, causing layout density and usability issues on mobile/tablet screens (sm/md breakpoints).

Compare against the center form at line 119, which properly implements responsive widths: w-full md:w-2/3 lg:w-1/2 xl:w-[36%]. Similarly, the left panel at line 52 has the same issue.

Recommend applying responsive variants to both panels, e.g., w-full md:w-2/5 or a similar pattern aligned with the design system, so they adapt to smaller viewports.

🤖 Prompt for AI Agents
In packages/effects/layouts/src/authentication/authentication.vue around lines
136-137, the right panel uses fixed classes "w-2/5 flex-1" without responsive
variants causing poor mobile/tablet layouts; update the width classes to include
responsive breakpoints (for example use w-full md:w-2/5 or a design-aligned
pattern) so the panel collapses to full width on small screens while retaining
2/5 on medium+ screens; apply the same responsive adjustment to the left panel
(around line 52) to keep layout consistent.

@doraemonxxx
Copy link

Cool, can someone merge review and merge this?

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