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: Update welcome message #2298

Merged
merged 6 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions lib/ui/src/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,5 @@ function welcomeText({
helpMarkdown = 'See [Cody documentation](https://docs.sourcegraph.com/cody) for help and tips.',
afterMarkdown,
}: WelcomeTextOptions): string {
return ["Hello! I'm Cody. I can write code and answer coding questions for you. " + helpMarkdown, afterMarkdown]
.filter(isDefined)
.join('\n\n')
return [helpMarkdown, afterMarkdown].filter(isDefined).join('\n\n')
}
1 change: 1 addition & 0 deletions vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This is a log of all notable changes to Cody for VS Code. [Unreleased] changes a
- Settings: Relabel "symf Context" as "Search Context". [pull/2285](https://github.com/sourcegraph/cody/pull/2285)
- Chat: Removed 'Chat Suggestions' setting. [pull/2284](https://github.com/sourcegraph/cody/pull/2284)
- Edit: Completed edits are no longer scrolled back into view in the active file. [pull/2297](https://github.com/sourcegraph/cody/pull/2297)
- Chat: Update welcome message. [pull/2298](https://github.com/sourcegraph/cody/pull/2298)

## [0.18.4]

Expand Down
2 changes: 1 addition & 1 deletion vscode/src/commands/menus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function showCommandMenu(
items: (QuickPickItem | QuickPickItemWithSlashCommand)[]
): Promise<CommandMenuResponse> {
const options = {
title: `Cody (Shortcut: ${platform() === 'darwin' ? '⌥' : 'Alt+'}C)`,
title: `Cody Commands (Shortcut: ${platform() === 'darwin' ? '⌥' : 'Alt+'}C)`,
placeHolder: 'Search for a command or enter your question here...',
}

Expand Down
12 changes: 8 additions & 4 deletions vscode/webviews/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,17 @@ function addInstructions<T extends CodyPrompt>([key, command]: [string, T]): [st
}

function getWelcomeMessageByOS(os: string): string {
const welcomeMessageMarkdown = `Start writing code and I’ll autocomplete lines and entire functions for you.
const welcomeMessageMarkdown = `Welcome to Cody! Start writing code and Cody will autocomplete lines and entire functions for you.

You can ask me to explain, document and edit code using the [Cody Commands](command:cody.action.commands.menu) action (${
To run [Cody Commands](command:cody.action.commands.menu) use the keyboard shortcut <span class="keyboard-shortcut"><span>${
os === 'darwin' ? '⌥' : 'Alt'
}+C), or by right-clicking on code and using the “Cody” menu.
}</span><span>C</span></span>, the <span class="cody-icons">A</span> button, or right-click anywhere in your code.

See the [Getting Started](command:cody.welcome) guide for more tips and tricks.
You can start a new chat at any time with <span class="keyboard-shortcut"><span>${
os === 'darwin' ? '⌥' : 'Alt'
}</span><span>/</span></span> or using the <span class="cody-icons">H</span> button.

For more tips and tricks, see the [Getting Started Guide](command:cody.welcome) and [docs](https://docs.sourcegraph.com/cody).
`
return welcomeMessageMarkdown
}
44 changes: 44 additions & 0 deletions vscode/webviews/index.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
@import '@sourcegraph/cody-ui/src/index.css';
@import '@vscode/codicons/dist/codicon';

@font-face {
font-family: cody-icons;
font-display: block;
src: url('../resources/cody-icons.woff') format('woff');
}

:root {
/* Our syntax highlighter expects a dark code background color, regardless of the VS Code color
theme. */
Expand Down Expand Up @@ -48,3 +54,41 @@ a:hover {
.cody-chat-error > span {
font-weight: bold;
}

.cody-icons {
font: normal normal normal 16px/1 cody-icons;
display: inline-block;
text-decoration: none;
text-rendering: auto;
text-align: center;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
user-select: none;
transform: translateY(25%); /* Hacky adjustment for font baseline */
}

.keyboard-shortcut {
color: var(--vscode-keybindingLabel-foreground);
display: inline-flex;
align-items: center;
line-height: 10px;
white-space: nowrap;
}

.keyboard-shortcut > span {
display: inline-block;
background-color: var(--vscode-keybindingLabel-background);
border-width: 1px;
border-style: solid;
border-color: var(--vscode-keybindingLabel-border) var(--vscode-keybindingLabel-border) var(--vscode-keybindingLabel-bottomBorder) var(--vscode-keybindingLabel-border);
border-radius: 3px;
box-shadow: inset 0 -1px 0 var(--vscode-widget-shadow);
vertical-align: middle;
font-size: 11px;
padding: 3px 5px;
margin: 0 2px;
}

.keyboard-shortcut > span:first-child {
margin-left: 0;
}
Loading