Skip to content
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

Chat UI revamp #1074

Merged
merged 1 commit into from
Jan 22, 2025
Merged

Chat UI revamp #1074

merged 1 commit into from
Jan 22, 2025

Conversation

zeroliu
Copy link
Collaborator

@zeroliu zeroliu commented Jan 21, 2025

Revamp chat UI to address a few pain points:

  • Busy Chat Input: The chat input area is considered cluttered because too many controls are directly next to the text input, including adding a new chat, saving to note, reindexing vault, and changing chat mode.
  • Context Input Issues: The context input often lacks space to display contexts, wrapping onto new lines in the UI. When it mixes with the chat control, it looks broken. Also, when users are not in copilot plus mode, the context area is blank, causing confusion and a big gap.

The new UI fixes these functionalities with the following improvements:

  1. The chat UI specific controls: chat model select, add a new chat, save as note, toggle relevant note and suggested prompts, and reindex vault are moved out of the text input and placed on top. The chat input specific controls: AI model select, add image, and submit chat are kept at the bottom.
Screenshot 2025-01-20 at 4 16 01 PM Screenshot 2025-01-20 at 4 17 04 PM
  1. When chat mode or qa mode is selected, the context select will be removed completely
Screenshot 2025-01-20 at 4 16 49 PM
  1. Refined the context menu items to handle long names and different types better.
  2. Hide the message controls by default and only show them on hover. On mobile, they will show by default.
  3. Restyle the chat components to remove the gray background.

@zeroliu zeroliu force-pushed the zero/chat-ui-revamp branch 2 times, most recently from fda75e6 to 7d7a1c2 Compare January 21, 2025 00:29
@zeroliu zeroliu requested a review from logancyang January 21, 2025 00:41
@zeroliu zeroliu force-pushed the zero/chat-ui-revamp branch from 7d7a1c2 to 97bc85f Compare January 21, 2025 00:44
@logancyang
Copy link
Owner

logancyang commented Jan 21, 2025

Looks great overall! A few comments on the style:

SCR-20250121-mbgc SCR-20250121-meco SCR-20250121-mgmt

@zeroliu
Copy link
Collaborator Author

zeroliu commented Jan 22, 2025

Looks great overall! A few comments on the style:

SCR-20250121-mbgc SCR-20250121-meco SCR-20250121-mgmt

RE making placeholder more transparent: The placeholder is already set to a lighter color (as you can see in the second screenshot), but the theme you used in the first screenshot doesn't seem to distinguish it from the muted color. I don't think we should introduce a fourth muted level outside of the design system. WDYT?

RE add context color: I intentionally made add context button pop out. If it uses the same text-faint token, the entire left section will use the same color. It will make placeholder harder to distinguish from the rest. Cursor adds a border to the button to make it stands out. Would you like to explore that option?

@zeroliu
Copy link
Collaborator Author

zeroliu commented Jan 22, 2025

RE timestamp: It's also using the most light color and the smallest font in the design system. We can break out and introduce a smaller and lighter one, but it will defy the purpose of the design system. I believe the main reason it doesn't look as good is that the theme does not distinguish between muted and faint colors. Consequently, everything marked as faint stands out more than it should. Again, this is the choice of the theme. There isn't much we can do about it. If we choose to use a gray color without a semantic token, it may look strange in another theme, potentially causing other issues.

@zeroliu
Copy link
Collaborator Author

zeroliu commented Jan 22, 2025

Default:
Screenshot 2025-01-21 at 6 31 28 PM

Things:
Screenshot 2025-01-21 at 6 31 17 PM

I made the other changes as you suggested

@zeroliu zeroliu force-pushed the zero/chat-ui-revamp branch from 97bc85f to 2d846b5 Compare January 22, 2025 02:32
@logancyang
Copy link
Owner

RE making placeholder more transparent: The placeholder is already set to a lighter color (as you can see in the second screenshot), but the theme you used in the first screenshot doesn't seem to distinguish it from the muted color. I don't think we should introduce a fourth muted level outside of the design system. WDYT?

RE add context color: I intentionally made add context button pop out. If it uses the same text-faint token, the entire left section will use the same color. It will make placeholder harder to distinguish from the rest. Cursor adds a border to the button to make it stands out. Would you like to explore that option?

Gotcha. Then the placeholder should be fine as is.

I think Cursor's plus icon with a border looks great, quite clean and minimal. Right now "Add context" with the placeholder text below looks a bit cluttered IMHO. We could imitate Cursor there.

@zeroliu zeroliu force-pushed the zero/chat-ui-revamp branch from 2d846b5 to 5e2e4c8 Compare January 22, 2025 04:45
@zeroliu
Copy link
Collaborator Author

zeroliu commented Jan 22, 2025

RE making placeholder more transparent: The placeholder is already set to a lighter color (as you can see in the second screenshot), but the theme you used in the first screenshot doesn't seem to distinguish it from the muted color. I don't think we should introduce a fourth muted level outside of the design system. WDYT?
RE add context color: I intentionally made add context button pop out. If it uses the same text-faint token, the entire left section will use the same color. It will make placeholder harder to distinguish from the rest. Cursor adds a border to the button to make it stands out. Would you like to explore that option?

Gotcha. Then the placeholder should be fine as is.

I think Cursor's plus icon with a border looks great, quite clean and minimal. Right now "Add context" with the placeholder text below looks a bit cluttered IMHO. We could imitate Cursor there.

Sounds good. Updated

Screenshot 2025-01-21 at 8 45 23 PM Screenshot 2025-01-21 at 8 46 28 PM

@logancyang
Copy link
Owner

@zeroliu sorry I meant could the "Add context" text be removed? My main concern is the stacked text at very uneven spacings.

SCR-20250121-sdbh

Ideally, as you guys mentioned before, eventually we should get rid of chat mode selection completely. But as we still rely on it now and decide to move it to the left side, this area with "Add context" becomes stacked up. The placeholder text / text input can also benefit from a bit more top spacing imo.

@zeroliu
Copy link
Collaborator Author

zeroliu commented Jan 22, 2025

@zeroliu sorry I meant could the "Add context" text be removed? My main concern is the stacked text at very uneven spacings.

SCR-20250121-sdbh Ideally, as you guys mentioned before, eventually we should get rid of chat mode selection completely. But as we still rely on it now and decide to move it to the left side, this area with "Add context" becomes stacked up. The placeholder text / text input can also benefit from a bit more top spacing imo.

The text box has a line height. When measuring the gap between elements, we usually use the distance between the bounding boxes, instead of the characters.

Screenshot 2025-01-21 at 9 13 27 PM

I think the term "add context" is needed because I often forget that the + button on the top right is for starting a new chat. The label here will help people identify the different functionalities of the two + buttons. You can find the same pattern in Cursor where the Add Context label will first shown and disappear when contexts are selected.

The mix of borderless elements and the ones with border does make the space looks off. We can add a border to the chat model select too. But I think it's better without. I can also adjust the spacing to make it look more even.

Screenshot 2025-01-21 at 9 21 25 PM

@zeroliu
Copy link
Collaborator Author

zeroliu commented Jan 22, 2025

Here's a version without the "add context" label, compared to the one with label (fine tuned the space)

Screenshot 2025-01-21 at 9 24 25 PM

Latest version

Screenshot 2025-01-21 at 9 33 36 PM

@zeroliu zeroliu force-pushed the zero/chat-ui-revamp branch from 5e2e4c8 to 5a273a1 Compare January 22, 2025 05:26
@zeroliu zeroliu force-pushed the zero/chat-ui-revamp branch from 5a273a1 to bf15e02 Compare January 22, 2025 05:33
@logancyang
Copy link
Owner

Oh yes you are right, Cursor also has "Add context" when there's no context. Let's keep it then.

The latest version looks better with the new spacing. LGTM!

@logancyang logancyang merged commit 40c5f50 into logancyang:master Jan 22, 2025
2 checks passed
@logancyang logancyang mentioned this pull request Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants