Skip to content

Commit 1352bcf

Browse files
committed
fix #1591 -- font size for side chat
- the menu items are there, but they literally didn't work. Fixed.
1 parent 6ffebd8 commit 1352bcf

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ interface Props {
4040
mode: Mode;
4141
scrollToBottomRef?: MutableRefObject<(force?: boolean) => void>;
4242
setLastVisible?: (x: Date | null) => void;
43+
fontSize?: number;
4344
}
4445

4546
export function ChatLog({
@@ -48,10 +49,11 @@ export function ChatLog({
4849
scrollToBottomRef,
4950
mode,
5051
setLastVisible,
52+
fontSize,
5153
}: Props) {
5254
const actions: ChatActions = useActions(project_id, path);
5355
const messages = useRedux(["messages"], project_id, path) as ChatMessages;
54-
const fontSize = useRedux(["font_size"], project_id, path);
56+
const font_size = useRedux(["font_size"], project_id, path);
5557
const scrollToBottom = useRedux(["scrollToBottom"], project_id, path);
5658
const llm_cost_reply: [number, number] = useRedux(
5759
["llm_cost_reply"],
@@ -176,7 +178,7 @@ export function ChatLog({
176178
user_map,
177179
project_id,
178180
path,
179-
fontSize,
181+
fontSize: fontSize ?? font_size,
180182
selectedHashtags,
181183
actions,
182184
llm_cost_reply,

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,15 @@ interface Props {
2525
project_id: string;
2626
path: string;
2727
style?: CSSProperties;
28+
fontSize?: number;
2829
}
2930

30-
export default function SideChat({ project_id, path, style }: Props) {
31+
export default function SideChat({
32+
project_id,
33+
path,
34+
style,
35+
fontSize,
36+
}: Props) {
3137
const actions: ChatActions = useActions(project_id, path);
3238
const messages = useRedux(["messages"], project_id, path);
3339
const [lastVisible, setLastVisible] = useState<Date | null>(null);
@@ -161,6 +167,7 @@ export default function SideChat({ project_id, path, style }: Props) {
161167
}}
162168
>
163169
<ChatLog
170+
fontSize={fontSize}
164171
project_id={project_id}
165172
path={path}
166173
scrollToBottomRef={scrollToBottomRef}

src/packages/frontend/frame-editors/generic/chat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function Chat({ font_size }: Props) {
4444
if (!initialized) {
4545
return null;
4646
}
47-
return <SideChat project_id={project_id} path={path} />;
47+
return <SideChat project_id={project_id} path={path} fontSize={font_size} />;
4848
}
4949

5050
export const chat: EditorDescription = {

0 commit comments

Comments
 (0)