-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
docs(dumi): fix CodePreviewer live demo module resolution #1830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -287,16 +287,17 @@ const useStyle = createStyles(({ token, css }) => { | |||||||||||||||||||
| } | ||||||||||||||||||||
| `, | ||||||||||||||||||||
| chatList: css` | ||||||||||||||||||||
| flex: 1; | ||||||||||||||||||||
| overflow-y: auto; | ||||||||||||||||||||
| display: flex; | ||||||||||||||||||||
| height: calc(100% - 120px); | ||||||||||||||||||||
| flex-direction: column; | ||||||||||||||||||||
| align-items: center; | ||||||||||||||||||||
| width: 100%; | ||||||||||||||||||||
| `, | ||||||||||||||||||||
| placeholder: css` | ||||||||||||||||||||
| padding-top: 32px; | ||||||||||||||||||||
| width: 100%; | ||||||||||||||||||||
| padding-inline: ${token.paddingLG}px; | ||||||||||||||||||||
| padding: ${token.paddingLG}px; | ||||||||||||||||||||
| box-sizing: border-box; | ||||||||||||||||||||
|
Comment on lines
298
to
301
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 298 的 💡 建议修改 placeholder: css`
- padding-top: 32px;
width: 100%;
- padding: ${token.paddingLG}px;
+ padding: ${token.paddingLG}px;
+ padding-top: 32px;
box-sizing: border-box;
`,📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. demo code短平快,保障样式没问题即可
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
🧠 Learnings used |
||||||||||||||||||||
| `, | ||||||||||||||||||||
| // sender 样式 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -204,15 +204,17 @@ const useCopilotStyle = createStyles(({ token, css }) => { | |
| `, | ||
| // chatList 样式 | ||
| chatList: css` | ||
| flex:1; | ||
| overflow-y: auto; | ||
| padding-inline: 16px; | ||
| margin-block-start: ${token.margin}px; | ||
| display: flex; | ||
| height: calc(100% - 194px); | ||
| flex-direction: column; | ||
| `, | ||
| chatWelcome: css` | ||
| margin-inline: ${token.margin}px; | ||
| padding: 12px 16px; | ||
| border-radius: 2px 12px 12px 12px; | ||
| border-radius: 12px; | ||
| background: ${token.colorBgTextHover}; | ||
| margin-bottom: ${token.margin}px; | ||
| `, | ||
|
|
@@ -433,7 +435,6 @@ const Copilot = (props: CopilotProps) => { | |
| /** 消息列表 */ | ||
| <Bubble.List | ||
| ref={listRef} | ||
| style={{ paddingInline: 16 }} | ||
| items={messages?.map((i) => ({ | ||
| ...i.message, | ||
| key: i.id, | ||
|
|
@@ -457,9 +458,6 @@ const Copilot = (props: CopilotProps) => { | |
| title={locale.iCanHelp} | ||
| items={MOCK_QUESTIONS.map((i) => ({ key: i, description: i }))} | ||
| onItemClick={(info) => handleUserSubmit(info?.data?.description as string)} | ||
| style={{ | ||
| marginInline: 16, | ||
| }} | ||
|
Comment on lines
460
to
-462
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing this inline |
||
| styles={{ | ||
| title: { fontSize: 14 }, | ||
| }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,20 +87,23 @@ const useStyle = createStyles(({ token, css }) => { | |
| box-sizing: border-box; | ||
| display: flex; | ||
| flex-direction: column; | ||
| padding-block: ${token.paddingLG}px; | ||
| padding-inline: ${token.paddingLG}px; | ||
| gap: 16px; | ||
| .ant-bubble-content-updating { | ||
| background-image: linear-gradient(90deg, #ff6b23 0%, #af3cb8 31%, #53b6ff 89%); | ||
| background-size: 100% 2px; | ||
| background-repeat: no-repeat; | ||
| background-position: bottom; | ||
| } | ||
| `, | ||
| chatList: css` | ||
| flex: 1; | ||
| overflow-y: auto; | ||
| margin-block-start: ${token.margin}px; | ||
| `, | ||
| chatSender: css` | ||
| padding: ${token.paddingXS}px; | ||
| `, | ||
|
Comment on lines
+102
to
+104
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| startPage: css` | ||
| display: flex; | ||
| width: 100%; | ||
| max-width: 840px; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| height: 100%; | ||
|
|
@@ -111,14 +114,6 @@ const useStyle = createStyles(({ token, css }) => { | |
| margin-block-end: 38px; | ||
| font-weight: 600; | ||
| `, | ||
| chatList: css` | ||
| display: flex; | ||
| align-items: center; | ||
| width: 100%; | ||
| height: 100%; | ||
| flex-direction: column; | ||
| justify-content: space-between; | ||
| `, | ||
| }; | ||
| }); | ||
|
|
||
|
|
@@ -385,7 +380,6 @@ const App = () => { | |
| styles={{ | ||
| root: { | ||
| maxWidth: 940, | ||
| height: 'calc(100% - 160px)', | ||
| marginBlockEnd: 24, | ||
| }, | ||
| }} | ||
|
|
@@ -399,56 +393,51 @@ const App = () => { | |
| role={getRole(className)} | ||
| /> | ||
| )} | ||
| <div | ||
| style={{ width: '100%', maxWidth: 840 }} | ||
| className={clsx({ [styles.startPage]: messages.length === 0 })} | ||
| > | ||
| {messages.length === 0 && ( | ||
| <div className={styles.agentName}>{locale.agentName}</div> | ||
| )} | ||
| <Sender | ||
| suffix={false} | ||
| ref={senderRef} | ||
| key={curConversation} | ||
| slotConfig={slotConfig} | ||
| loading={isRequesting} | ||
| onSubmit={(val) => { | ||
| if (!val) return; | ||
| onRequest({ | ||
| messages: [{ role: 'user', content: val }], | ||
| thinking: { | ||
| type: 'disabled', | ||
| }, | ||
| }); | ||
| listRef.current?.scrollTo({ top: 'bottom' }); | ||
| setActiveConversation(curConversation); | ||
| senderRef.current?.clear?.(); | ||
| }} | ||
| onCancel={() => { | ||
| abort(); | ||
| }} | ||
| placeholder={locale.placeholder} | ||
| footer={(actionNode) => { | ||
| return ( | ||
| <Flex justify="space-between" align="center"> | ||
| <Flex gap="small" align="center"> | ||
| <Sender.Switch | ||
| value={deepThink} | ||
| onChange={(checked: boolean) => { | ||
| setDeepThink(checked); | ||
| }} | ||
| icon={<OpenAIOutlined />} | ||
| > | ||
| {locale.deepThink} | ||
| </Sender.Switch> | ||
| </Flex> | ||
| <Flex align="center">{actionNode}</Flex> | ||
| </div> | ||
| <div className={clsx(styles.chatSender, { [styles.startPage]: messages.length === 0 })}> | ||
| {messages.length === 0 && <div className={styles.agentName}>{locale.agentName}</div>} | ||
| <Sender | ||
| suffix={false} | ||
| ref={senderRef} | ||
| key={curConversation} | ||
| slotConfig={slotConfig} | ||
| loading={isRequesting} | ||
| onSubmit={(val) => { | ||
| if (!val) return; | ||
| onRequest({ | ||
| messages: [{ role: 'user', content: val }], | ||
| thinking: { | ||
| type: 'disabled', | ||
| }, | ||
| }); | ||
| listRef.current?.scrollTo({ top: 'bottom' }); | ||
| setActiveConversation(curConversation); | ||
| senderRef.current?.clear?.(); | ||
| }} | ||
| onCancel={() => { | ||
| abort(); | ||
| }} | ||
| placeholder={locale.placeholder} | ||
| footer={(actionNode) => { | ||
| return ( | ||
| <Flex justify="space-between" align="center"> | ||
| <Flex gap="small" align="center"> | ||
| <Sender.Switch | ||
| value={deepThink} | ||
| onChange={(checked: boolean) => { | ||
| setDeepThink(checked); | ||
| }} | ||
| icon={<OpenAIOutlined />} | ||
| > | ||
| {locale.deepThink} | ||
| </Sender.Switch> | ||
| </Flex> | ||
| ); | ||
| }} | ||
| autoSize={{ minRows: 3, maxRows: 6 }} | ||
| /> | ||
| </div> | ||
| <Flex align="center">{actionNode}</Flex> | ||
| </Flex> | ||
| ); | ||
| }} | ||
| autoSize={{ minRows: 3, maxRows: 6 }} | ||
| /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: ant-design/x
Length of output: 295
🏁 Script executed:
Repository: ant-design/x
Length of output: 801
隐藏代码控件缺少键盘触发,存在可访问性缺口。
第 530-533 行使用了可聚焦的
div(tabIndex={0}+role="button"),但缺少onKeyDown处理器,键盘用户无法通过 Enter/Space 键触发点击。建议改用原生<button>元素。建议修改
📝 Committable suggestion
🤖 Prompt for AI Agents