Skip to content

Derik/bug/4506#4596

Closed
HackGenesis wants to merge 10 commits intoshesha-io:mainfrom
HackGenesis:derik/bug/4506
Closed

Derik/bug/4506#4596
HackGenesis wants to merge 10 commits intoshesha-io:mainfrom
HackGenesis:derik/bug/4506

Conversation

@HackGenesis
Copy link
Copy Markdown
Contributor

@HackGenesis HackGenesis commented Mar 12, 2026

#4506

Summary by CodeRabbit

  • New Features

    • Added configurable menu overflow options (dropdown, menu, scroll) and improved designer dimension preservation.
  • Bug Fixes

    • Improved menu rendering consistency across responsive states and themes.
    • Ensured overflow visibility to prevent clipping and improve horizontal scrolling.
    • Fixed submenu and icon color behavior when sub-menu styling is applied.
  • Style

    • Refined spacing, padding, borders and color rules for consistent visuals.
    • Removed per-item menu shadow styling and related shadow controls.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 234222c5-1101-4859-9607-fc0d4aeda579

📥 Commits

Reviewing files that changed from the base of the PR and between 2cf3b35 and bc29d17.

📒 Files selected for processing (1)
  • shesha-reactjs/src/designer-components/horizontalMenu/index.tsx

Walkthrough

Removes per-item menu shadow support; adds a menuOverflow setting and preserveDimensionsInDesigner flag; broad refactor of menu styling (overflow, padding, color inheritance, styleOnSubMenu/isScrolling); adds overflow: visible to app configurator styles; updates migrations and models to drop menuItemShadow.

Changes

Cohort / File(s) Summary
Menu Styling Refactor
shesha-reactjs/src/components/menu/styles.ts, shesha-reactjs/src/components/menu/useHorizontalMenuDropdownStyles.ts
Extensive CSS / generated-CSS changes: enforce overflow: visible, conditional isScrolling handling, styleOnSubMenu/styleOnHover/styleOnSelected propagation, icon/arrow color inheritance changes, removal of customItemStyle generation, widespread use of !important.
Horizontal Menu — component, settings, utils
shesha-reactjs/src/designer-components/horizontalMenu/index.tsx, shesha-reactjs/src/designer-components/horizontalMenu/settings.ts, shesha-reactjs/src/designer-components/horizontalMenu/utils.ts
Removed menuItemShadow prop/UI/logic; added preserveDimensionsInDesigner: true; introduced menuOverflow setting and default; updated defaultStyles typing and migration behavior.
Migrations & Models
shesha-reactjs/src/designer-components/_common-migrations/migrateStyles.ts, shesha-reactjs/src/providers/form/models.ts
Dropped menuItemShadow from migrated style output and removed menuItemShadow?: IShadowValue from IStyleType.
App Configurator Styling
shesha-reactjs/src/components/appConfigurator/styles/styles.ts
Added overflow: visible to .sha-configurable-component and minor whitespace/format adjustments.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Derik/task/3459 #4449: Reverts/removes prior menuItemShadow changes and adjusts menuOverflow/overflow handling in the same files.
  • fix styling and custom styles #4482: Modifies menu styling and submenu/icon color/hover generation in the same components.
  • James/en/3459 #4048: Touches menu styling paths and introduces related style propagation (styleOnHover/styleOnSelected) affecting the same CSS generation.

Suggested reviewers

  • James-Baloyi
  • czwe-01

Poem

🐰 I hopped through code where shadows used to play,
I nudged the edges, let the overflow stay,
Menus now breathe wide, settings find their place,
A tiny flag keeps shapes from losing grace,
Carrot crumbs of changes — neat and snug they lay 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Derik/bug/4506' is a branch name that references a bug number but does not clearly describe what the actual changes are. The changeset involves menu styling refactoring and shadow property removal, which is not evident from the title alone. Use a descriptive title that summarizes the main change, such as 'Remove menuItemShadow styling and refactor menu overflow handling' or 'Refactor menu component styling and migration logic'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

Migrating from UI to YAML configuration.

Use the @coderabbitai configuration command in a PR comment to get a dump of all your UI settings in YAML format. You can then edit this YAML file and upload it to the root of your repository to configure CodeRabbit programmatically.

Copy link
Copy Markdown
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)
shesha-reactjs/src/designer-components/horizontalMenu/utils.ts (1)

3-29: ⚠️ Potential issue | 🟡 Minor

Replace as any cast with an explicit type that includes menuOverflow.

The defaultStyles() function returns an object with menuOverflow: 'dropdown', but IStyleType doesn't declare this property. The as any cast at line 29 suppresses the type error instead of properly modeling the shape. Since menuOverflow is actively used by IMenuListProps and spread into component configuration during migration, define a proper return type:

type HorizontalMenuDefaultStyles = IStyleType & {
  menuOverflow: 'dropdown' | 'menu' | 'scroll';
};

export const defaultStyles = (): HorizontalMenuDefaultStyles => {
  return {
    background: { type: 'color' },
    font: { weight: '400', size: 14, color: '#000', type: 'Segoe UI' },
    border: {
      border: {
        all: { width: '0px', style: 'solid' },
        top: { width: '0px', style: 'solid' },
        bottom: { width: '0px', style: 'solid' },
        left: { width: '0px', style: 'solid' },
        right: { width: '0px', style: 'solid' },
      },
      radius: { all: 8, topLeft: 8, topRight: 8, bottomLeft: 8, bottomRight: 8 },
      borderType: 'all',
      radiusType: 'all',
    },
    shadow: {
      color: '#000000',
      offsetX: 0,
      offsetY: 0,
      blurRadius: 0,
      spreadRadius: 0,
    },
    overflow: 'dropdown',
    dimensions: { width: '500px', height: '55px', minHeight: '0px', maxHeight: 'auto', minWidth: '0px', maxWidth: 'auto' },
    menuOverflow: 'dropdown',
  };
};
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shesha-reactjs/src/designer-components/horizontalMenu/utils.ts` around lines
3 - 29, Replace the unsafe "as any" cast in defaultStyles by declaring an
explicit return type that extends IStyleType with the menuOverflow property
(e.g., create type HorizontalMenuDefaultStyles = IStyleType & { menuOverflow:
'dropdown' | 'menu' | 'scroll' }) and change the signature export const
defaultStyles = (): HorizontalMenuDefaultStyles => { ... } so the returned
object (including menuOverflow: 'dropdown') is properly typed for use by
IMenuListProps and downstream consumers.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@shesha-reactjs/src/components/menu/styles.ts`:
- Around line 114-117: The code is using the truthiness of itemStyle to reduce
vertical padding (padding?.y - 1) which incorrectly shrinks items whenever any
custom style exists; instead, determine any needed compensation from the actual
computed border widths (e.g., check itemStyle.borderWidth /
itemStyle.borderTopWidth / borderBottomWidth or a provided border value) rather
than itemStyle being truthy, and apply padding calculation using padding?.y
minus the numeric border compensation only when a numeric border width is
present; update the padding expressions that reference itemStyle and padding
(the templates using itemStyle ? `padding: ${padding?.y ? `${Math.max(0,
padding.y - 1)}px` : '0'}` : ...) to compute compensation from actual border
width, and make the same change in the other locations noted (the similar
branches around lines 151-154, 733-742, 787-790).

In `@shesha-reactjs/src/designer-components/horizontalMenu/index.tsx`:
- Line 58: The component is overwriting authored container layout by forcing
overflow and changing height to minHeight; revert the overrides so
containerStyle is preserved (do not set overflow unconditionally or convert
height -> minHeight in the HorizontalMenu component), and instead address border
spacing on the internal menu elements: update the menu wrapper/style object used
by the horizontal menu (e.g., the inner menu element or className referenced in
this file) to use boxSizing: 'border-box' and add the needed padding/margin so
borders don't clip; keep preserveDimensionsInDesigner intact and ensure you read
and apply any overflow/height values from containerStyle rather than replacing
them.

---

Outside diff comments:
In `@shesha-reactjs/src/designer-components/horizontalMenu/utils.ts`:
- Around line 3-29: Replace the unsafe "as any" cast in defaultStyles by
declaring an explicit return type that extends IStyleType with the menuOverflow
property (e.g., create type HorizontalMenuDefaultStyles = IStyleType & {
menuOverflow: 'dropdown' | 'menu' | 'scroll' }) and change the signature export
const defaultStyles = (): HorizontalMenuDefaultStyles => { ... } so the returned
object (including menuOverflow: 'dropdown') is properly typed for use by
IMenuListProps and downstream consumers.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8a9cb711-cbf1-43a0-b486-80580354c3e1

📥 Commits

Reviewing files that changed from the base of the PR and between a2bc408 and df7630d.

📒 Files selected for processing (8)
  • shesha-reactjs/src/components/appConfigurator/styles/styles.ts
  • shesha-reactjs/src/components/menu/styles.ts
  • shesha-reactjs/src/components/menu/useHorizontalMenuDropdownStyles.ts
  • shesha-reactjs/src/designer-components/_common-migrations/migrateStyles.ts
  • shesha-reactjs/src/designer-components/horizontalMenu/index.tsx
  • shesha-reactjs/src/designer-components/horizontalMenu/settings.ts
  • shesha-reactjs/src/designer-components/horizontalMenu/utils.ts
  • shesha-reactjs/src/providers/form/models.ts
💤 Files with no reviewable changes (2)
  • shesha-reactjs/src/providers/form/models.ts
  • shesha-reactjs/src/designer-components/_common-migrations/migrateStyles.ts

Comment on lines +114 to +117
${itemStyle
? `padding: ${padding?.y ? `${Math.max(0, padding.y - 1)}px` : '0'} ${padding?.x ? `${padding.x}px` : '3px'} !important;`
: `padding: ${padding?.y ? `${padding.y}px` : '0'} ${padding?.x ? `${padding.x}px` : '3px'} !important;`
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Don't use itemStyle presence as a proxy for border width.

These branches shrink the vertical padding whenever itemStyle is set, even if the custom style only changes color or background. That makes menu items jump by 2px as soon as any item-level styling is applied. If you need border compensation, derive it from the actual border widths instead of from a generic truthy check.

Also applies to: 151-154, 733-742, 787-790

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shesha-reactjs/src/components/menu/styles.ts` around lines 114 - 117, The
code is using the truthiness of itemStyle to reduce vertical padding (padding?.y
- 1) which incorrectly shrinks items whenever any custom style exists; instead,
determine any needed compensation from the actual computed border widths (e.g.,
check itemStyle.borderWidth / itemStyle.borderTopWidth / borderBottomWidth or a
provided border value) rather than itemStyle being truthy, and apply padding
calculation using padding?.y minus the numeric border compensation only when a
numeric border width is present; update the padding expressions that reference
itemStyle and padding (the templates using itemStyle ? `padding: ${padding?.y ?
`${Math.max(0, padding.y - 1)}px` : '0'}` : ...) to compute compensation from
actual border width, and make the same change in the other locations noted (the
similar branches around lines 151-154, 733-742, 787-790).

Copy link
Copy Markdown
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 (2)
shesha-reactjs/src/components/menu/styles.ts (1)

31-31: ⚠️ Potential issue | 🟠 Major

Remove any from the union type.

The any in IGlobalMenuProps | GlobalTheme | any completely undermines the other types in the union, effectively making GlobalMenuType equivalent to any. This defeats the purpose of the type definition and violates coding guidelines.

🛠️ Proposed fix
-type GlobalMenuType = IGlobalMenuProps | GlobalTheme | any;
+type GlobalMenuType = IGlobalMenuProps & { theme?: GlobalTheme['theme'] };

Or if the any was added to handle cases where props might be undefined:

-type GlobalMenuType = IGlobalMenuProps | GlobalTheme | any;
+type GlobalMenuType = Partial<IGlobalMenuProps> & { theme?: { prefixCls?: string } };

As per coding guidelines: **/*.{ts,tsx}: Eliminate the any type; use unknown type instead for values with unknown types.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shesha-reactjs/src/components/menu/styles.ts` at line 31, GlobalMenuType
currently uses a union with any which nullifies the other types; update the type
to remove any and use a safer alternative such as unknown or a more specific
union (e.g., IGlobalMenuProps | GlobalTheme | undefined) depending on intent.
Locate the GlobalMenuType alias and replace "| any" with "| unknown" if you need
a catch-all, or with "| undefined" (or add optional fields) if the goal was to
allow missing props; ensure downstream code narrows/guards unknown before use
(e.g., type checks or type predicates) to satisfy the linter and coding
guidelines.
shesha-reactjs/src/components/menu/useHorizontalMenuDropdownStyles.ts (1)

24-24: ⚠️ Potential issue | 🟡 Minor

Remove unused itemStyle parameter.

The itemStyle parameter is destructured and included in the dependency array but never used in the CSS generation. Remove it from the interface, destructuring, and dependency array at line 240.

Note: The parent component (index.tsx) converts itemStyle to a CSS string and passes it to this hook, but since it's not applied here, either this removal is intentional (with CSS applied elsewhere in styles.ts) or it should be applied to the dropdown item styles.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shesha-reactjs/src/components/menu/useHorizontalMenuDropdownStyles.ts` at
line 24, The hook useHorizontalMenuDropdownStyles currently destructures and
lists itemStyle in its props/interface and includes it in the effect/memo
dependency array but never uses it to generate CSS; remove itemStyle from the
hook's interface/type, remove it from the destructuring in
useHorizontalMenuDropdownStyles, and remove it from the dependency array where
CSS is memoized/generated (so dependencies match used values). If the parent
expects itemStyle to be applied here instead, instead apply that CSS string to
the dropdown item generation in the same hook (e.g., merge/apply itemStyle into
the item CSS creation) and then keep it in the interface and dependencies.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@shesha-reactjs/src/components/menu/styles.ts`:
- Around line 520-554: Extract the duplicated drawer CSS generation into a
single helper that takes the GlobalMenuType props (e.g.,
buildDrawerMenuStyles(p: GlobalMenuType) or generateDrawerMenuCss) and returns
the shared CSS block for the .horizontal-menu-drawer-${p => p?.menuId} selector
(including uses of p.theme.prefixCls, p.padding, p.colors, p.itemStyle and
.anticon/.menu-submenu-arrow handling); replace the near-identical blocks in
GlobalMenuStyles and ScopedMenuStyles with calls to that helper and add the
helper import/exports so both files reuse it, ensuring the helper preserves the
exact padding, height, line-height, color, background and itemStyle logic.

In `@shesha-reactjs/src/designer-components/horizontalMenu/utils.ts`:
- Line 1: The function defaultStyles currently returns "any"; create a proper
return type by defining interface IMenuDefaultStyles extends IStyleType with
menuOverflow?: 'dropdown' | 'menu' | 'scroll', then change the return type of
defaultStyles to IMenuDefaultStyles and remove any "as any" assertions; for
truly unknown values use unknown instead of any where applicable and ensure all
properties in the returned object match the IMenuDefaultStyles shape (reference
defaultStyles and IStyleType to locate fields).

---

Outside diff comments:
In `@shesha-reactjs/src/components/menu/styles.ts`:
- Line 31: GlobalMenuType currently uses a union with any which nullifies the
other types; update the type to remove any and use a safer alternative such as
unknown or a more specific union (e.g., IGlobalMenuProps | GlobalTheme |
undefined) depending on intent. Locate the GlobalMenuType alias and replace "|
any" with "| unknown" if you need a catch-all, or with "| undefined" (or add
optional fields) if the goal was to allow missing props; ensure downstream code
narrows/guards unknown before use (e.g., type checks or type predicates) to
satisfy the linter and coding guidelines.

In `@shesha-reactjs/src/components/menu/useHorizontalMenuDropdownStyles.ts`:
- Line 24: The hook useHorizontalMenuDropdownStyles currently destructures and
lists itemStyle in its props/interface and includes it in the effect/memo
dependency array but never uses it to generate CSS; remove itemStyle from the
hook's interface/type, remove it from the destructuring in
useHorizontalMenuDropdownStyles, and remove it from the dependency array where
CSS is memoized/generated (so dependencies match used values). If the parent
expects itemStyle to be applied here instead, instead apply that CSS string to
the dropdown item generation in the same hook (e.g., merge/apply itemStyle into
the item CSS creation) and then keep it in the interface and dependencies.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ab0275ed-c452-48b8-ae4e-5d8321a37d55

📥 Commits

Reviewing files that changed from the base of the PR and between df7630d and 0dedb4e.

📒 Files selected for processing (3)
  • shesha-reactjs/src/components/menu/styles.ts
  • shesha-reactjs/src/components/menu/useHorizontalMenuDropdownStyles.ts
  • shesha-reactjs/src/designer-components/horizontalMenu/utils.ts

Comment on lines +520 to +554
/* Top-level drawer menu items - apply itemStyle */
.horizontal-menu-drawer-${(p: GlobalMenuType) => p?.menuId} > .${(p: GlobalMenuType) => p?.theme.prefixCls}-drawer-body > .${(p: GlobalMenuType) => p?.theme.prefixCls}-menu.${(p: GlobalMenuType) => p?.theme.prefixCls}-menu-inline > .${(p: GlobalMenuType) => p?.theme.prefixCls}-menu-item {
padding: ${(p: GlobalMenuType) => p?.padding?.y ? `${p.padding.y}px` : '0'} ${(p: GlobalMenuType) => p?.padding?.x ? `${p.padding.x}px` : '3px'} !important;
height: 40px !important;
line-height: 40px !important;
color: ${(p: GlobalMenuType) => p?.colors?.itemColor || BLACK_CLR};
${(p: GlobalMenuType) => p?.colors?.itemBackground ? `background: ${p.colors.itemBackground};` : ''}
${(p: GlobalMenuType) => p?.itemStyle || ''}

.anticon {
color: ${(p: GlobalMenuType) => p?.itemStyle ? 'inherit' : 'currentColor'};
}
}

/* Drawer submenu items - use subItem colors */
/* Top-level drawer submenu titles - apply itemStyle */
.horizontal-menu-drawer-${(p: GlobalMenuType) => p?.menuId}
> .${(p: GlobalMenuType) => p?.theme.prefixCls}-drawer-body
> .${(p: GlobalMenuType) => p?.theme.prefixCls}-menu.${(p: GlobalMenuType) => p?.theme.prefixCls}-menu-inline
> .${(p: GlobalMenuType) => p?.theme.prefixCls}-menu-submenu
> .${(p: GlobalMenuType) => p?.theme.prefixCls}-menu-submenu-title {
padding: ${(p: GlobalMenuType) => p?.padding?.y ? `${p.padding.y}px` : '0'} ${(p: GlobalMenuType) => p?.padding?.x ? `${p.padding.x}px` : '3px'} !important;
height: 40px !important;
line-height: 40px !important;
color: ${(p: GlobalMenuType) => p?.colors?.itemColor || BLACK_CLR};
${(p: GlobalMenuType) => p?.colors?.itemBackground ? `background: ${p.colors.itemBackground};` : ''}
${(p: GlobalMenuType) => p?.itemStyle || ''}

.anticon {
color: ${(p: GlobalMenuType) => p?.itemStyle ? 'inherit' : 'currentColor'};
}

.${(p: GlobalMenuType) => p?.theme.prefixCls}-menu-submenu-arrow {
color: ${(p: GlobalMenuType) => p?.itemStyle ? 'inherit' : (p?.colors?.itemColor || BLACK_CLR)};
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Significant duplication between GlobalMenuStyles and ScopedMenuStyles.

The drawer menu styling blocks (lines 520-554 in GlobalMenuStyles and lines 970-1004 in ScopedMenuStyles) are nearly identical. Consider extracting the common CSS generation logic into a shared helper function to reduce duplication and maintenance burden.

Also applies to: 970-1004

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shesha-reactjs/src/components/menu/styles.ts` around lines 520 - 554, Extract
the duplicated drawer CSS generation into a single helper that takes the
GlobalMenuType props (e.g., buildDrawerMenuStyles(p: GlobalMenuType) or
generateDrawerMenuCss) and returns the shared CSS block for the
.horizontal-menu-drawer-${p => p?.menuId} selector (including uses of
p.theme.prefixCls, p.padding, p.colors, p.itemStyle and
.anticon/.menu-submenu-arrow handling); replace the near-identical blocks in
GlobalMenuStyles and ScopedMenuStyles with calls to that helper and add the
helper import/exports so both files reuse it, ensuring the helper preserves the
exact padding, height, line-height, color, background and itemStyle logic.

Copy link
Copy Markdown
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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@shesha-reactjs/src/designer-components/horizontalMenu/index.tsx`:
- Around line 188-196: The migrator currently prefers prev.menuOverflow even
when it's invalid, potentially ignoring a valid legacy prev.overflow; update the
function passed to .add<IMenuListProps>(1, (prev) => { ... }) to validate both
prev.menuOverflow and prev.overflow and only fallback to 'dropdown' if neither
is a valid string value ('dropdown' | 'menu' | 'scroll') — i.e. compute a
helper-valid check and set menuOverflow to valid(prev.menuOverflow) ?
prev.menuOverflow : valid(prev.overflow) ? prev.overflow : 'dropdown'; also
replace any use of the any type for unknown incoming values with unknown and
perform explicit type checks for strings.

In `@shesha-reactjs/src/designer-components/horizontalMenu/utils.ts`:
- Around line 3-5: Create a single exported union type (e.g., MenuOverflowValue
= 'dropdown' | 'menu' | 'scroll') and replace the inline union in
IMenuDefaultStyles with that type; update all other files that currently
duplicate the union to import and use MenuOverflowValue (reference
IMenuDefaultStyles to find where to swap the union and look for other
occurrences to import the shared MenuOverflowValue).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 112d785c-ee09-4308-a2bf-f6750a71d7f7

📥 Commits

Reviewing files that changed from the base of the PR and between 0dedb4e and 2cf3b35.

📒 Files selected for processing (3)
  • shesha-reactjs/src/designer-components/horizontalMenu/index.tsx
  • shesha-reactjs/src/designer-components/horizontalMenu/settings.ts
  • shesha-reactjs/src/designer-components/horizontalMenu/utils.ts

Comment on lines +3 to +5
interface IMenuDefaultStyles extends IStyleType {
menuOverflow?: 'dropdown' | 'menu' | 'scroll';
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider exporting a shared MenuOverflowValue type to avoid drift.

The same 'dropdown' | 'menu' | 'scroll' union now appears in multiple files. Centralizing it will prevent future mismatch between settings/options/migrator paths.

♻️ Suggested refactor
+export type MenuOverflowValue = 'dropdown' | 'menu' | 'scroll';
+
 interface IMenuDefaultStyles extends IStyleType {
-  menuOverflow?: 'dropdown' | 'menu' | 'scroll';
+  menuOverflow?: MenuOverflowValue;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
interface IMenuDefaultStyles extends IStyleType {
menuOverflow?: 'dropdown' | 'menu' | 'scroll';
}
export type MenuOverflowValue = 'dropdown' | 'menu' | 'scroll';
interface IMenuDefaultStyles extends IStyleType {
menuOverflow?: MenuOverflowValue;
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shesha-reactjs/src/designer-components/horizontalMenu/utils.ts` around lines
3 - 5, Create a single exported union type (e.g., MenuOverflowValue = 'dropdown'
| 'menu' | 'scroll') and replace the inline union in IMenuDefaultStyles with
that type; update all other files that currently duplicate the union to import
and use MenuOverflowValue (reference IMenuDefaultStyles to find where to swap
the union and look for other occurrences to import the shared
MenuOverflowValue).

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.

1 participant