Skip to content

Commit

Permalink
ui(chat): hoist width up to where the side bar is called
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcMcIntosh committed Dec 27, 2023
1 parent 4e1d37d commit 9a108d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
10 changes: 6 additions & 4 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[ ] use lsp handlers for chat (keys and config)
[-] no need for logins it's passed when the lsp starts

[ ] check cors issues with lsp
[x] check cors issues with lsp
[ ] clean events

[?] How should it handle going offline?
Expand All @@ -24,6 +24,8 @@
[?] user markdown input?
[x] enable dark mode

[ ] use grid layout for chat and sidebar?

### PRIORITY

[?] set lsp url
Expand All @@ -34,11 +36,11 @@
[x] disable inputs while streaming
[x] stop stream button
[ ] build the app (also think about how it'll be configured)
[ ] content for when chat is empty
[x] content for when chat is empty
[x] fix the text area placement (empty chat content might help with this)
[ ] make it look nice
[x] make it look nice
[x] handle being offline
[ ] handle long requests
[x] handle long requests

[x] scroll lags a bit

Expand Down
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function App() {
<Flex>
<HistorySideBar />
{/* <PageWrapper> */}
<Chat />
<Chat style={{ maxWidth: "calc(100vw - 260px)" }} />
{/* </PageWrapper> */}
</Flex>
</Theme>
Expand Down
9 changes: 2 additions & 7 deletions src/features/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useEventBusForChat } from "../hooks/useEventBusForChat";
import { ChatContent } from "../components/ChatContent";
import { Flex } from "@radix-ui/themes";

export const Chat: React.FC = () => {
export const Chat: React.FC<{ style?: React.CSSProperties }> = (props) => {
const {
state,
askQuestion,
Expand All @@ -21,16 +21,11 @@ export const Chat: React.FC = () => {
grow="1"
p={{
initial: "9",
// initial: "5",
// xs: "6",
// sm: "7",
// md: "9"
}}
style={{
...props.style,
height: "100dvh",
maxWidth: "calc(100vw - 260px)", // TODO: host this as the side bar won't always be there
}}
// width="100%"
>
<ChatContent
messages={state.chat.messages}
Expand Down

0 comments on commit 9a108d5

Please sign in to comment.