Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ce58b85a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| if (!spinning) return children ?? null; | ||
|
|
||
| if (!children) { |
There was a problem hiding this comment.
Preserve zero-valued children while spinning
When children is 0, the falsy check selects standalone mode and drops the content while spinning is true, even though the same child reappears when spinning becomes false. This breaks counters and other numeric displays that legitimately render zero; distinguish absent children with children == null instead.
Useful? React with 👍 / 👎.
| onClick={handleClick} | ||
| onKeyDown={handleKeyDown} | ||
| {...rest} |
There was a problem hiding this comment.
Compose forwarded click handlers with the upload trigger
When a caller supplies the inherited native onClick or onKeyDown prop, this final spread replaces handleClick or handleKeyDown rather than augmenting it. A common analytics or telemetry handler therefore prevents the regular upload trigger from opening the file dialog; spread these props before the internal handlers or explicitly compose both callbacks.
Useful? React with 👍 / 👎.
| const filtered = filterFilesByAccept(rawFiles, accept); | ||
| const accepted = await resolveAcceptedFiles(filtered, beforeUpload); | ||
| const sliced = maxCount ? accepted.slice(0, maxCount) : accepted; |
There was a problem hiding this comment.
Enforce single-file mode for dropped files
When multiple is false or omitted, the native picker limits selection to one file, but a drag-and-drop operation can still pass multiple files through this pipeline because only maxCount is applied. Consequently a nominally single-file dragger calls onFiles and onChange for every dropped file; cap the accepted list at one unless multiple is enabled.
Useful? React with 👍 / 👎.
… Result, Spin, Tooltip and Upload imports
5ce58b8 to
6b73209
Compare
commit: |
Why
Downstream (lobe-chat) still imports these from
antd: Upload (21 files), Progress (15), Spin / Pagination / Result (11 each), Badge (10).Empty(78 files via@lobehub/ui) was a thin antd wrapper. This batch removes antd from all of them.What
New
@lobehub/ui/base-uicomponents (also re-exported from the root):Spinsize14/20/32,percentring,indicator, overlay viachildren,variant="neural"(≤6 SVG elements, 1 animated — replaces lobe-chat's 31-elementNeuralNetworkLoading)Progresstype="line|circle",variant="line|segments|inset",status,showInfo,format;role="progressbar"Badgestatus/text/colororcount/dot/overflowCount/offset/sizeResultstatus="success|error|info|warning",icon/title/subTitle/extraPaginationcurrent/pageSize,showTotal,showSizeChanger(base-uiSelect), clamp notifiesonChangeUpload/UploadDraggeraccept/multiple/directory/maxCount,beforeUpload(file, fileList)(antd-shaped),onFiles,onChange. No fileList / XHR / progress UIsrc/Emptyrewritten in place without antd, addsvariant="default\|dashed\|stack".Breaking / migration notes
EmptyPropsnow extendsComponentProps<'div'>instead ofFlexboxProps(gap/padding/horizontal/flexno longer accepted). lobe-chat only passesdescription/icon/title/className/style/onClick/type— verified clean.size="default"(antd) →size="middle"on Spin / Progress / Pagination. Badge keeps antd'sdefault|small.404/403/500, Progressdashboard/steps/gradient stroke, PaginationshowQuickJumper/simple, Upload file list & XHR,Upload.LIST_IGNORE. Each mdx has a "Migrating from antd" section.Verification
https://claude.ai/code/session_01SnPUiLfRXgaeBU3jSRZXHc