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

Prepare one box UI for Cody Web usage #5552

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

vovakulikov
Copy link
Contributor

This PR

  • Fixes styles problem with Cody Web (the whole time vs code dark theme was included in the main lib bundle, which shouldn't be used anywhere outside of storybook demos)
  • Prepare one box UI (render code block only for search intent results and only for one box UI)

Test plan

  • Check Cody Web UI (with one box functionality)
  • Check that vscode one box doesn't get any regressions

@vovakulikov vovakulikov requested review from thenamankumar and a team September 11, 2024 15:21
@vovakulikov vovakulikov self-assigned this Sep 11, 2024
@@ -328,8 +328,8 @@ const TranscriptInteraction: FC<TranscriptInteractionProps> = memo(props => {
contextAlternatives={humanMessage.contextAlternatives}
model={assistantMessage?.model}
isForFirstMessage={humanMessage.index === 0}
showSnippets={experimentalOneBoxEnabled && humanMessage.intent === 'search'}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show snippets only for search intent results (for now)

@@ -46,7 +46,7 @@
z-index: 1;

border-bottom: 1px solid var(--cody-chat-code-border-color);
background-color: var(--vscode-titleBar-inactiveBackground);
background-color: var(--cody-chat-code-header-background);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake, forgot to use a more specific design token for code blocks header

@@ -103,7 +103,7 @@ export const CodeExcerpt: FC<Props> = props => {
}, [highlightRanges, startLine, endLine, tableContainerElement, table])

return (
<Code className={clsx(styles.codeExcerpt, className)}>
<Code className={clsx(styles.codeExcerpt, className)} data-code-excerpt={true}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed to target it from Sourcegraph App via CSS selector (to avoid some web app styling for code tags)

@@ -40,7 +40,7 @@ const AccordionContent = React.forwardRef<
>(({ className, children, ...props }, ref) => (
<AccordionPrimitive.Content
ref={ref}
className="tw-overflow-hidden tw-transition-all data-[state=closed]:tw-animate-accordion-up data-[state=open]:tw-animate-accordion-down"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Search Code blocks should have sticky headers but with overflowed container sticky position simply doesn't work, I don't know the exact reasons why we need this overflow, I checked and animation and accordion UI still works without it, will be happy to revert if someone has any concerns about it

@@ -1,3 +1,5 @@
@import url('../../vscode/.storybook/static/vscode-themes/dark-modern.css');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include dark theme styles only for Cody Web demo

@@ -171,7 +171,6 @@ export const ContextCell: FunctionComponent<{
<FileContextItem
item={item}
showSnippets={showSnippets}
defaultOpen={defaultOpen}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still keep both the args. Both do not every time we show snippets, we need them to be opened by default, and we might experiment with this UX in the near future.

But its fine, we can add it later if required. Non blocking.

@vovakulikov vovakulikov merged commit 0e6dcda into main Sep 11, 2024
19 checks passed
@vovakulikov vovakulikov deleted the vk/prepare-one-box-for-cody-web-release branch September 11, 2024 19:31
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