Skip to content

Commit d0147bc

Browse files
committed
frontend/antd: fixing 5.18.3 fallout
1 parent 6c6f889 commit d0147bc

File tree

17 files changed

+110
-154
lines changed

17 files changed

+110
-154
lines changed

src/packages/frontend/account/other-settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ export function OtherSettings(props: Readonly<Props>): JSX.Element {
409409
<Panel
410410
header={
411411
<>
412-
<AIAvatar size={22} /> AI Settings
412+
<AIAvatar size={18} /> AI Settings
413413
</>
414414
}
415415
>

src/packages/frontend/admin/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ export function AdminPage() {
8989
key: "llm-testing",
9090
label: (
9191
<div style={headerStyle}>
92-
<AIAvatar size={16} style={{ marginRight: "8px", top: "-5px" }} />{" "}
93-
Test LLM Integration
92+
<AIAvatar size={16} style={{ marginRight: "8px" }} /> Test LLM
93+
Integration
9494
</div>
9595
),
9696
children: <TestLLMAdmin />,

src/packages/frontend/chat/message.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -784,11 +784,7 @@ export default function Message(props: Readonly<Props>) {
784784
const style: CSS =
785785
mode === "standalone"
786786
? {
787-
marginTop:
788-
props.show_avatar ||
789-
(!props.is_prev_sender && is_viewers_message)
790-
? MARGIN_TOP_VIEWER
791-
: "5px",
787+
marginTop: MARGIN_TOP_VIEWER,
792788
marginLeft: "5px",
793789
marginRight: "5px",
794790
}

src/packages/frontend/codemirror/extensions/ai-formula.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ function AiGenFormula({ mode, text = "", project_id, cb }: Props) {
237237
return (
238238
<>
239239
<Title level={4}>
240-
<AIAvatar size={24} /> Generate LaTeX Formula
240+
<AIAvatar size={20} /> Generate LaTeX Formula
241241
</Title>
242242
{enabled ? (
243243
<>

src/packages/frontend/components/ai-avatar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export default function AIAvatar({
3232
height: size,
3333
display: "inline-block",
3434
position: "relative",
35-
...{ marginRight: "3px", ...style },
35+
top: "2px",
36+
...style,
3637
}}
3738
>
3839
<div
@@ -41,7 +42,6 @@ export default function AIAvatar({
4142
backgroundColor,
4243
color: "white",
4344
height: size,
44-
top: "5px",
4545
...innerStyle,
4646
}}
4747
>

src/packages/frontend/editors/stopwatch/stopwatch.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,25 @@
77
The stopwatch and timer component
88
*/
99

10-
import { CSSProperties, useEffect, useState } from "react";
11-
import { redux, useForceUpdate } from "@cocalc/frontend/app-framework";
12-
import { Icon } from "@cocalc/frontend/components/icon";
13-
import dayjs from "dayjs";
14-
import { Button, Row, Col, Modal, TimePicker, Tooltip } from "antd";
1510
import {
1611
DeleteTwoTone,
12+
EditTwoTone,
1713
PauseCircleTwoTone,
1814
PlayCircleTwoTone,
1915
StopTwoTone,
20-
EditTwoTone,
2116
} from "@ant-design/icons";
22-
import { TimerState } from "./actions";
23-
import StaticMarkdown from "@cocalc/frontend/editors/slate/static-markdown";
17+
import { redux, useForceUpdate } from "@cocalc/frontend/app-framework";
18+
import { Icon } from "@cocalc/frontend/components/icon";
19+
import { Button, Col, Modal, Row, TimePicker, Tooltip } from "antd";
20+
import type { Dayjs } from "dayjs";
21+
import dayjs from "dayjs";
22+
import { CSSProperties, useEffect, useState } from "react";
23+
2424
import MarkdownInput from "@cocalc/frontend/editors/markdown-input/multimode";
25-
import { webapp_client } from "@cocalc/frontend/webapp-client";
25+
import StaticMarkdown from "@cocalc/frontend/editors/slate/static-markdown";
2626
import { useFrameContext } from "@cocalc/frontend/frame-editors/frame-tree/frame-context";
27+
import { webapp_client } from "@cocalc/frontend/webapp-client";
28+
import { TimerState } from "./actions";
2729
import { TimeAmount } from "./time";
2830

2931
function assertNever(x: never): never {
@@ -114,14 +116,14 @@ export default function Stopwatch(props: StopwatchProps) {
114116
{!props.compact ? "Edit" : undefined}
115117
</Button>
116118
</Tooltip>
117-
{editingTime && (
119+
{editingTime ? (
118120
<TimePicker
119121
open
120122
defaultValue={getCountdownMoment(props.countdown)}
121123
onChange={(time) => {
122124
if (time != null) {
123125
setCountdown(
124-
time.second() + time.minute() * 60 + time.hour() * 60 * 60
126+
time.second() + time.minute() * 60 + time.hour() * 60 * 60,
125127
);
126128
// timeout so the setcountdown can fully propagate through flux; needed for whiteboard
127129
setTimeout(() => props.clickButton("reset"), 0);
@@ -134,7 +136,7 @@ export default function Stopwatch(props: StopwatchProps) {
134136
}
135137
}}
136138
/>
137-
)}
139+
) : undefined}
138140
</div>
139141
);
140142
}
@@ -397,7 +399,7 @@ export default function Stopwatch(props: StopwatchProps) {
397399
}
398400
}
399401

400-
export function getCountdownMoment(countdown: number | undefined) {
402+
export function getCountdownMoment(countdown: number | undefined): Dayjs {
401403
let amount = Math.round(countdown ?? 0);
402404
const m = dayjs();
403405
m.second(amount % 60);

src/packages/frontend/frame-editors/llm/help-me-fix.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ A generic button for helping a user fix problems using chatgpt.
33
If chatgpt is disabled or not available it renders as null.
44
*/
55

6-
import { Alert, Button } from "antd";
6+
import { Alert, Button, Space } from "antd";
77
import type { BaseButtonProps } from "antd/lib/button/button";
88
import { CSSProperties, useState } from "react";
99
import useAsyncEffect from "use-async-effect";
@@ -151,12 +151,10 @@ export default function HelpMeFix({
151151
}}
152152
>
153153
<Button size={size} style={style} disabled={gettingHelp}>
154-
<AIAvatar
155-
size={16}
156-
style={{ marginRight: "5px" }}
157-
innerStyle={{ top: "2.5px" }}
158-
/>
159-
Help me fix this...
154+
<Space>
155+
<AIAvatar size={16} />
156+
Help me fix this...
157+
</Space>
160158
</Button>
161159
</PopconfirmKeyboard>
162160
{errorGettingHelp && (

src/packages/frontend/frame-editors/llm/title-bar-button.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,6 @@ export default function LanguageModelTitleBarButton({
410410
<Text type="secondary">{description}</Text>
411411
</>
412412
),
413-
type: preset.tag == tag ? "primary" : undefined,
414413
onClick: () => {
415414
setPreset(preset);
416415
track(TAG_TMPL, { project_id, template: label });
@@ -637,9 +636,9 @@ export default function LanguageModelTitleBarButton({
637636
>
638637
<span ref={buttonRef}>
639638
<AIAvatar
640-
size={18}
639+
size={16}
641640
iconColor={COLORS.AI_ASSISTANT_TXT}
642-
style={{ top: "-2px", marginRight: "1px" }}
641+
innerStyle={{ top: "2px" }}
643642
/>
644643
{noLabel ? (
645644
""

src/packages/frontend/jupyter/insert-cell/index.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,14 @@ export function InsertCell({
152152
title="Create code based on your description (alt+click line)"
153153
handleButtonClick={handleButtonClick}
154154
>
155-
<AIAvatar
156-
backgroundColor={"transparent"}
157-
size={12}
158-
style={{ marginRight: "5px" }}
159-
innerStyle={{ color: "default", top: "-2.5px" }}
160-
/>{" "}
161-
Generate...
155+
<Space>
156+
<AIAvatar
157+
backgroundColor={"transparent"}
158+
size={14}
159+
innerStyle={{ color: "default", top: "-2px" }}
160+
/>
161+
Generate...
162+
</Space>
162163
</TinyButton>
163164
)}
164165
</Space>

src/packages/frontend/jupyter/llm/cell-tool.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ export function LLMCellTool({
424424
icon={
425425
<AIAvatar
426426
size={14}
427-
style={{ position: "relative", top: "-4px", left: "4px" }}
427+
style={{ top: "1px" }}
428428
iconColor={is_current ? COLORS.AI_ASSISTANT_FONT : undefined}
429429
/>
430430
}

0 commit comments

Comments
 (0)