Repository navigation
fix(web): widen max_tokens number input in LLM settings popover - #18265
Conversation
The Max_Tokens number input in the agent component's LLM settings popover used numberInputClassName="w-20" (80px), and its flex parent (flex items-center gap-4 justify-between) shrank it further via the default flex-shrink: 1, so 6-digit values like 128000 were truncated. Widen to w-24 (96px) and add shrink-0 so the input keeps its full width inside the flex row. Verified in browser: wrapper computes to exactly 96px and 128000 fits (scrollWidth 94 <= clientWidth 94).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe max-tokens input now uses ChangesMax-tokens input layout
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This localized change widens the Max_Tokens input and prevents flexbox from shrinking it, allowing large values to remain visible; no actionable merge-blocking risk remains. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
wangq8
left a comment
There was a problem hiding this comment.
Thanks for the fix. The root cause is clear: w-20 (80px) was being flex-shrunk below 80px in the flex items-center gap-4 justify-between row, truncating 6-digit values like 128000.
w-24(96px) plusshrink-0correctly prevents the flex parent from collapsing the input, andcn(tailwind-merge) letsw-24override the basew-16.- Verified in
SliderInputFormFieldthatnumberInputClassNameis merged last, so the override is effective. - No regressions expected — this only affects the max_tokens number input width in the LLM settings popover.
LGTM. (nit) Other SliderInputFormField usages relying on the default w-16/w-20 could hit the same truncation for 5–6 digit values, but that's out of scope here.
wangq8
left a comment
There was a problem hiding this comment.
LGTM. w-24 (96px) with shrink-0 correctly widens the input and prevents the flex parent from shrinking it back down, so 6-digit values like 128000 are fully visible. Small, targeted change with no regressions.
Problem
In the Agent component's LLM settings popover, the Max_Tokens number input is too narrow: its width is set via
numberInputClassName="w-20"(80px), and because the field row is a flex container (flex items-center gap-4 justify-between, ~254px wide) the defaultflex-shrink: 1shrinks the wrapper even further (measured ~53.86px). As a result, large values such as128000(the max) are visually truncated.Fix
Change the Max_Tokens field's
numberInputClassNamefromw-20tow-24 shrink-0inweb/src/components/llm-setting-items/next.tsx:w-24widens the input to 96px so 6-digit values fit;shrink-0prevents the flex parent from shrinking it back down (w-24alone still computed to ~53.86px).Verification
Verified in browser against a local instance (agent with model glm-4.6v-Flash):
128000is fully visible (scrollWidth 94 <= clientWidth 94);128000truncated in ~54px input128000fully visible in 96px input