Skip to content

Commit d2e5eb8

Browse files
committed
Update README wording and improve browser extension message compacting behavior
1 parent f9030fd commit d2e5eb8

3 files changed

Lines changed: 32 additions & 12 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ CWC is a context-first AI coding extension with first-class support for [prompt
66

77
Works with VS Code family of editors (Cursor, Antigravity, VSCodium).
88

9-
✅ **Send prompts anywhere**
9+
✅ **Prepare messages for...**
1010

1111
- Chatbots—_ChatGPT, Claude, Gemini, Grok, DeepSeek, etc._
1212
- Model providers—_Gemini API, OpenRouter, local Ollama, etc._

‎packages/ui/src/components/editor/panel/BrowserExtensionMessage/BrowserExtensionMessage.module.scss‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
.container {
2-
display: flex;
3-
flex-direction: column;
4-
align-items: flex-start;
52
padding: 6px 8px 8px 8px;
63
margin-bottom: calc(5px * -1);
74
background: linear-gradient(
@@ -17,6 +14,9 @@
1714

1815
.heading {
1916
font-weight: 500;
17+
overflow: hidden;
18+
text-overflow: ellipsis;
19+
white-space: nowrap;
2020
}
2121

2222
.links {
@@ -27,7 +27,7 @@
2727
white-space: nowrap;
2828

2929
&:first-child {
30-
margin-right: 10px;
30+
margin-right: 8px;
3131
}
3232
}
3333
}

‎packages/ui/src/components/editor/panel/BrowserExtensionMessage/BrowserExtensionMessage.tsx‎

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,37 @@
1+
import { useLayoutEffect, useRef } from 'react'
2+
3+
import { use_compacting } from '@shared/hooks/use-compacting'
14
import styles from './BrowserExtensionMessage.module.scss'
25

36
export const BrowserExtensionMessage: React.FC = () => {
7+
const { container_ref, compact_step, report_width } = use_compacting(2)
8+
const links_ref = useRef<HTMLDivElement>(null)
9+
10+
useLayoutEffect(() => {
11+
if (links_ref.current) {
12+
let width = 0
13+
const children = links_ref.current.children
14+
for (let i = 0; i < children.length; i++) {
15+
const child = children[i] as HTMLElement
16+
const style = getComputedStyle(child)
17+
width +=
18+
child.offsetWidth +
19+
parseFloat(style.marginLeft) +
20+
parseFloat(style.marginRight)
21+
}
22+
report_width(width, compact_step)
23+
}
24+
}, [compact_step, report_width])
25+
426
return (
5-
<div className={styles.container}>
6-
<div className={styles.heading}>
7-
Install Connector for chat initializations
8-
</div>
9-
<div className={styles.links}>
27+
<div ref={container_ref} className={styles.container}>
28+
<div className={styles.heading}>Install the Connector for auto-fill</div>
29+
<div ref={links_ref} className={styles.links}>
1030
<a href="https://chromewebstore.google.com/detail/code-web-chat-connector/ljookipcanaglfaocjbgdicfbdhhjffp">
11-
Chrome Web Store
31+
{compact_step >= 2 ? 'Chrome' : 'Chrome Web Store'}
1232
</a>
1333
<a href="https://addons.mozilla.org/en-US/firefox/addon/code-web-chat-connector/">
14-
Firefox Add-ons
34+
{compact_step >= 1 ? 'Firefox' : 'Firefox Add-ons'}
1535
</a>
1636
</div>
1737
</div>

0 commit comments

Comments
 (0)