Skip to content

Commit a240b1c

Browse files
committed
some chat clean up; mainly removing buttons floating in no man's land
1 parent 4221d0b commit a240b1c

File tree

19 files changed

+97
-238
lines changed

19 files changed

+97
-238
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ export function OtherSettings(props: Readonly<Props>): React.JSX.Element {
576576
<LabeledRow
577577
label={intl.formatMessage({
578578
id: "account.other-settings.llm.default_llm",
579-
defaultMessage: "Default AI Language Model",
579+
defaultMessage: "Default AI Model",
580580
})}
581581
>
582582
<LLMSelector model={model} setModel={setModel} />

src/packages/frontend/chat/actions.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -780,9 +780,12 @@ export class ChatActions extends Actions<ChatState> {
780780
// submit question to the given language model
781781
const id = uuid();
782782
this.chatStreams.add(id);
783-
setTimeout(() => {
784-
this.chatStreams.delete(id);
785-
}, 3 * 60 * 1000);
783+
setTimeout(
784+
() => {
785+
this.chatStreams.delete(id);
786+
},
787+
3 * 60 * 1000,
788+
);
786789

787790
// construct the LLM history for the given thread
788791
const history = reply_to ? this.getLLMHistory(reply_to) : undefined;

src/packages/frontend/chat/chat-log.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export function ChatLog({
218218
<>
219219
{visibleHashtags.size > 0 && (
220220
<HashtagBar
221-
style={{ margin: "3px 0" }}
221+
style={{ margin: "5px 15px 0 15px" }}
222222
actions={{
223223
set_hashtag_state: (tag, state) => {
224224
actions.setHashtagState(tag, state);

src/packages/frontend/chat/chatroom.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Button, Divider, Input, Select, Space, Tooltip } from "antd";
77
import { debounce } from "lodash";
88
import { FormattedMessage } from "react-intl";
99

10-
import { ButtonGroup, Col, Row, Well } from "@cocalc/frontend/antd-bootstrap";
10+
import { Col, Row, Well } from "@cocalc/frontend/antd-bootstrap";
1111
import {
1212
React,
1313
redux,
@@ -23,13 +23,11 @@ import { hoursToTimeIntervalHuman } from "@cocalc/util/misc";
2323
import { EditorComponentProps } from "../frame-editors/frame-tree/types";
2424
import { ChatLog } from "./chat-log";
2525
import Filter from "./filter";
26-
import { FoldAllThreads } from "./fold-threads";
2726
import ChatInput from "./input";
2827
import { LLMCostEstimationChat } from "./llm-cost-estimation";
2928
import type { ChatState } from "./store";
3029
import { SubmitMentionsFn } from "./types";
3130
import { INPUT_HEIGHT, markChatAsReadIfUnseen } from "./utils";
32-
import VideoChatButton from "./video/launch-button";
3331

3432
const FILTER_RECENT_NONE = {
3533
value: 0,
@@ -142,11 +140,6 @@ export function ChatRoom({
142140
);
143141
}
144142

145-
function render_video_chat_button() {
146-
if (project_id == null || path == null) return;
147-
return <VideoChatButton actions={actions} />;
148-
}
149-
150143
function isValidFilterRecentCustom(): boolean {
151144
const v = parseFloat(filterRecentHCustom);
152145
return isFinite(v) && v >= 0;
@@ -238,7 +231,7 @@ export function ChatRoom({
238231
return null;
239232
}
240233
return (
241-
<Space style={{ width: "100%", marginTop: "3px" }} wrap>
234+
<Space style={{ marginTop: "5px", marginLeft: "15px" }} wrap>
242235
<Filter
243236
actions={actions}
244237
search={search}
@@ -251,10 +244,6 @@ export function ChatRoom({
251244
}}
252245
/>
253246
{renderFilterRecent()}
254-
<ButtonGroup style={{ marginLeft: "5px" }}>
255-
{render_video_chat_button()}
256-
</ButtonGroup>
257-
<FoldAllThreads actions={actions} shortLabel={false} />
258247
</Space>
259248
);
260249
}

src/packages/frontend/chat/fold-threads.tsx

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/packages/frontend/chat/llm-msg-summarize.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Button, Collapse, Switch } from "antd";
77

88
import { useLanguageModelSetting } from "@cocalc/frontend/account/useLanguageModelSetting";
99
import { useAsyncEffect, useState } from "@cocalc/frontend/app-framework";
10-
import { Icon, Paragraph, RawPrompt, Tip } from "@cocalc/frontend/components";
10+
import { Paragraph, RawPrompt, Tip } from "@cocalc/frontend/components";
1111
import AIAvatar from "@cocalc/frontend/components/ai-avatar";
1212
import PopconfirmKeyboard from "@cocalc/frontend/components/popconfirm-keyboard";
1313
import LLMSelector, {
@@ -56,7 +56,7 @@ export function SummarizeThread({
5656
return (
5757
<PopconfirmKeyboard
5858
onVisibilityChange={setVisible}
59-
icon={<AIAvatar size={16} />}
59+
icon={<AIAvatar size={16} style={{ marginRight: "15px" }} />}
6060
title={<>Summarize this thread</>}
6161
description={() => (
6262
<div style={{ maxWidth: "500px" }}>
@@ -116,7 +116,8 @@ export function SummarizeThread({
116116
title={"Summarize this thread using a language model."}
117117
>
118118
<Button type="text" style={{ color: COLORS.GRAY_M }}>
119-
<Icon name="vertical-align-middle" /> Summarize…
119+
<AIAvatar size={16} style={{ top: 0 }} />
120+
Summarize…
120121
</Button>
121122
</Tip>
122123
</PopconfirmKeyboard>

src/packages/frontend/chat/message.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export default function Message({
236236
const [autoFocusEdit, setAutoFocusEdit] = useState<boolean>(false);
237237

238238
const replyMessageRef = useRef<string>("");
239-
const replyMentionsRef = useRef<SubmitMentionsFn|undefined>(undefined);
239+
const replyMentionsRef = useRef<SubmitMentionsFn | undefined>(undefined);
240240

241241
const is_viewers_message = sender_is_viewer(account_id, message);
242242
const verb = show_history ? "Hide" : "Show";
@@ -507,7 +507,7 @@ export default function Message({
507507

508508
const feedback = message.getIn(["feedback", account_id]);
509509
const otherFeedback =
510-
isLLMThread && msgWrittenByLLM ? 0 : message.get("feedback")?.size ?? 0;
510+
isLLMThread && msgWrittenByLLM ? 0 : (message.get("feedback")?.size ?? 0);
511511
const showOtherFeedback = otherFeedback > 0;
512512

513513
return (
@@ -942,7 +942,7 @@ export default function Message({
942942
)
943943
}
944944
>
945-
<Icon name="to-top-outlined" /> Fold…
945+
<Icon name="vertical-align-middle" /> Fold…
946946
</Button>
947947
</Tip>
948948
)}
@@ -973,7 +973,7 @@ export default function Message({
973973
type="link"
974974
block
975975
style={{ color: "darkblue", textAlign: "center" }}
976-
icon={<Icon name="to-top-outlined" rotate="180" />}
976+
icon={<Icon name="expand-arrows" />}
977977
>
978978
{label}
979979
</Button>
@@ -1002,13 +1002,7 @@ export default function Message({
10021002
textAlign: "center",
10031003
};
10041004

1005-
const iconName = is_folded
1006-
? mode === "standalone"
1007-
? reverseRowOrdering
1008-
? "right-circle-o"
1009-
: "left-circle-o"
1010-
: "right-circle-o"
1011-
: "down-circle-o";
1005+
const iconName = is_folded ? "expand" : "vertical-align-middle";
10121006

10131007
const button = (
10141008
<Button

src/packages/frontend/chat/side-chat.tsx

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Button, Flex, Space, Tooltip } from "antd";
22
import { useCallback, useEffect, useRef, useState } from "react";
3-
43
import {
54
CSS,
65
redux,
@@ -17,12 +16,10 @@ import { COLORS } from "@cocalc/util/theme";
1716
import type { ChatActions } from "./actions";
1817
import { ChatLog } from "./chat-log";
1918
import Filter from "./filter";
20-
import { FoldAllThreads } from "./fold-threads";
2119
import ChatInput from "./input";
2220
import { LLMCostEstimationChat } from "./llm-cost-estimation";
2321
import { SubmitMentionsFn } from "./types";
2422
import { INPUT_HEIGHT, markChatAsReadIfUnseen } from "./utils";
25-
import VideoChatButton from "./video/launch-button";
2623

2724
interface Props {
2825
project_id: string;
@@ -121,24 +118,6 @@ export default function SideChat({
121118
borderBottom: "1px solid lightgrey",
122119
}}
123120
>
124-
<Space.Compact
125-
style={{
126-
float: "right",
127-
marginTop: "-5px",
128-
}}
129-
>
130-
<VideoChatButton actions={actions} />
131-
<Tooltip title="Show TimeTravel change history of this side chat.">
132-
<Button
133-
onClick={() => {
134-
actions.showTimeTravelInNewTab();
135-
}}
136-
>
137-
<Icon name="history" />
138-
</Button>
139-
</Tooltip>
140-
<FoldAllThreads actions={actions} shortLabel={true} />
141-
</Space.Compact>
142121
<CollabList
143122
addCollab={addCollab}
144123
project={project}

src/packages/frontend/chat/video/launch-button.tsx

Lines changed: 0 additions & 134 deletions
This file was deleted.

src/packages/frontend/editors/markdown-input/complete.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export function Complete({
217217
label: (
218218
<div style={{ ...style, display: "flex", alignItems: "center" }}>
219219
<AIAvatar size={22} />{" "}
220-
<span style={{ marginLeft: "5px" }}>More AI Language Models</span>
220+
<span style={{ marginLeft: "5px" }}>More AI Models</span>
221221
</div>
222222
),
223223
style,

0 commit comments

Comments
 (0)