Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/theme/src/nav-menu/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,12 @@

> span,
> a {
display: inline-block;
width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
Comment on lines +299 to +303

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Avoid fixed-width truncation for submenu labels

Line 300 hardcodes width: 100px, which causes premature clipping even when space is available and can reduce label readability/discoverability. Prefer container-relative sizing so ellipsis appears only on actual overflow.

Proposed CSS adjustment
-              display: inline-block;
-              width: 100px;
+              display: block;
+              width: 100%;
+              min-width: 0;
               overflow: hidden;
               text-overflow: ellipsis;
               white-space: nowrap;
📝 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
display: inline-block;
width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: block;
width: 100%;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/theme/src/nav-menu/index.less` around lines 299 - 303, The submenu
label rule currently forces a fixed width (width: 100px) causing premature
truncation; replace the fixed width with a container-relative constraint such as
max-width: 100% (or width: auto) and ensure the element can shrink inside
flex/containers by keeping overflow: hidden; text-overflow: ellipsis;
white-space: nowrap; (so the rule on the same selector that contains display:
inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
uses max-width: 100% or width: auto instead of width: 100px, and if this element
lives inside a flex container ensure parent/this selector allows shrinking,
e.g., min-width: 0).

color: var(--tv-NavMenu-popmenu-text-color-normal);
white-space: normal;
word-break: break-all;
text-decoration: none;
font-size: var(--tv-NavMenu-popmenu-text-font-size);
Expand Down
Loading