Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style(chat-input): polish attachment menu, agent mode & status hints (#16010)

René Wang93a6f956d926
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.json
index 79b4efe7e1b..5426a487921 100644
--- a/locales/en-US/chat.json
+++ b/locales/en-US/chat.json
@@ -491,7 +491,7 @@
"search.mode.useModelBuiltin": "Use model built-in web search",
"search.searchModel.desc": "The current model does not support function calls, so it needs to be paired with a model that does support function calls for online searching.",
"search.searchModel.title": "Search helper model",
- "search.title": "Web search",
+ "search.title": "Web Search",
"searchAgentPlaceholder": "Search agents...",
"searchAgents": "Search agents...",
"selectedAgents": "Selected agents",
diff --git a/locales/en-US/opStatusTray.json b/locales/en-US/opStatusTray.json
index 1a54ac85882..5469ff86496 100644
--- a/locales/en-US/opStatusTray.json
+++ b/locales/en-US/opStatusTray.json
@@ -1,34 +1,32 @@
{
"generatingPhrases": [
- "Working",
- "Drafting",
- "Thinking",
- "Computing",
- "Brewing",
- "Synthesizing",
- "Crunching",
- "Architecting",
- "Composing",
- "Orchestrating",
- "Sketching",
- "Noodling",
- "Pondering",
- "Crafting",
- "Flambéing",
- "Simmering",
- "Whirring",
- "Wrangling",
- "Polishing",
- "Preparing the answer",
- "Baking",
- "Channeling",
- "Coalescing",
- "Deciphering",
- "Forging",
- "Harmonizing",
- "Improvising",
- "Inferring",
- "Tinkering",
- "Zigzagging"
+ "Summoning electrons",
+ "Herding tokens",
+ "Waking the hamsters",
+ "Reticulating splines",
+ "Consulting the oracle",
+ "Bribing the GPU",
+ "Untangling thoughts",
+ "Doing big-brain things",
+ "Letting it cook",
+ "Pondering the orb",
+ "Connecting the dots",
+ "Spinning up neurons",
+ "Chasing the muse",
+ "Aligning the stars",
+ "Brewing brilliance",
+ "Tickling transistors",
+ "Wrangling ideas",
+ "Crunching numbers",
+ "Channeling genius",
+ "Charging brain cells",
+ "Asking the rubber duck",
+ "Overthinking it",
+ "Shuffling synapses",
+ "Mining for answers",
+ "Polishing the prose",
+ "Befriending the algorithm",
+ "Greasing the gears",
+ "Decoding the universe"
]
}
diff --git a/locales/zh-CN/opStatusTray.json b/locales/zh-CN/opStatusTray.json
index 954cd78af39..01dbeb68839 100644
--- a/locales/zh-CN/opStatusTray.json
+++ b/locales/zh-CN/opStatusTray.json
@@ -1,34 +1,32 @@
{
"generatingPhrases": [
- "处理中",
- "思考中",
- "推理中",
- "分析中",
- "检索线索中",
- "梳理上下文中",
- "整理思路中",
- "生成回复中",
- "准备答案中",
- "撰写内容中",
- "组织语言中",
- "完善表达中",
- "核对细节中",
- "提炼重点中",
- "串联信息中",
- "构建方案中",
- "拆解问题中",
- "验证思路中",
- "整合结果中",
- "润色答案中",
- "继续推进中",
- "认真执行中",
- "快速处理中",
- "稳步推进中",
- "灵感生成中",
- "校准方向中",
- "收束结论中",
- "补全细节中",
- "输出结果中",
- "收尾处理中"
+ "疯狂运算中",
+ "奋力搬砖中",
+ "火力全开中",
+ "努力憋大招中",
+ "绞尽脑汁中",
+ "冥思苦想中",
+ "掐指一算中",
+ "闭关修炼中",
+ "头脑风暴中",
+ "灵感加载中",
+ "认真码字中",
+ "抓耳挠腮中",
+ "脑力全开中",
+ "小宇宙爆发中",
+ "齿轮飞转中",
+ "深度思考中",
+ "奋笔疾书中",
+ "元气满满中",
+ "收集灵感中",
+ "全力以赴中",
+ "暗中观察中",
+ "马不停蹄中",
+ "蓄力中",
+ "召唤神龙中",
+ "脑洞大开中",
+ "拼命思考中",
+ "认真思考中",
+ "飞速运转中"
]
}
diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.ts
index 54fcb318dc5..16d100e9973 100644
--- a/packages/locales/src/default/chat.ts
+++ b/packages/locales/src/default/chat.ts
@@ -552,7 +552,7 @@ export default {
'search.searchModel.desc':
'The current model does not support function calls, so it needs to be paired with a model that does support function calls for online searching.',
'search.searchModel.title': 'Search helper model',
- 'search.title': 'Web search',
+ 'search.title': 'Web Search',
'searchAgentPlaceholder': 'Search agents...',
'searchAgents': 'Search agents...',
'selectedAgents': 'Selected agents',
diff --git a/packages/locales/src/default/opStatusTray.ts b/packages/locales/src/default/opStatusTray.ts
index 846a387a3f7..1730a523e94 100644
--- a/packages/locales/src/default/opStatusTray.ts
+++ b/packages/locales/src/default/opStatusTray.ts
@@ -1,34 +1,32 @@
export default {
generatingPhrases: [
- 'Working',
- 'Drafting',
- 'Thinking',
- 'Computing',
- 'Brewing',
- 'Synthesizing',
- 'Crunching',
- 'Architecting',
- 'Composing',
- 'Orchestrating',
- 'Sketching',
- 'Noodling',
- 'Pondering',
- 'Crafting',
- 'Flambéing',
- 'Simmering',
- 'Whirring',
- 'Wrangling',
- 'Polishing',
- 'Preparing the answer',
- 'Baking',
- 'Channeling',
- 'Coalescing',
- 'Deciphering',
- 'Forging',
- 'Harmonizing',
- 'Improvising',
- 'Inferring',
- 'Tinkering',
- 'Zigzagging',
+ 'Summoning electrons',
+ 'Herding tokens',
+ 'Waking the hamsters',
+ 'Reticulating splines',
+ 'Consulting the oracle',
+ 'Bribing the GPU',
+ 'Untangling thoughts',
+ 'Doing big-brain things',
+ 'Letting it cook',
+ 'Pondering the orb',
+ 'Connecting the dots',
+ 'Spinning up neurons',
+ 'Chasing the muse',
+ 'Aligning the stars',
+ 'Brewing brilliance',
+ 'Tickling transistors',
+ 'Wrangling ideas',
+ 'Crunching numbers',
+ 'Channeling genius',
+ 'Charging brain cells',
+ 'Asking the rubber duck',
+ 'Overthinking it',
+ 'Shuffling synapses',
+ 'Mining for answers',
+ 'Polishing the prose',
+ 'Befriending the algorithm',
+ 'Greasing the gears',
+ 'Decoding the universe',
],
};
diff --git a/src/features/ChatInput/ActionBar/AgentMode/index.tsx b/src/features/ChatInput/ActionBar/AgentMode/index.tsx
index 68829a1538a..1c109dd11d6 100644
--- a/src/features/ChatInput/ActionBar/AgentMode/index.tsx
+++ b/src/features/ChatInput/ActionBar/AgentMode/index.tsx
@@ -106,6 +106,15 @@ const styles = createStaticStyles(({ css }) => ({
line-height: 1.4;
color: ${cssVar.colorText};
`,
+ popoverPopup: css`
+ /* The popup pads its option rows by 4px, so its corner must be one step larger
+ than the rows' radius (borderRadius 8 → borderRadiusLG 12 = 8 + 4) to wrap them
+ concentrically instead of looking tighter than them. &&& outranks the base
+ popup style's border-radius. */
+ &&& {
+ border-radius: ${cssVar.borderRadiusLG};
+ }
+ `,
}));
const AGENT_CAPS = [
@@ -226,12 +235,19 @@ const AgentMode = memo(() => {
return (
<Popover
+ className={styles.popoverPopup}
content={popoverContent}
open={canCreateContent && open}
placement="bottomLeft"
trigger="click"
styles={{
- content: { border: `1px solid ${cssVar.colorBorderSecondary}`, padding: 4 },
+ // Match the inner viewport's corner to the enlarged popup radius so its
+ // border corners don't poke through the rounded popup.
+ content: {
+ border: `1px solid ${cssVar.colorBorderSecondary}`,
+ borderRadius: cssVar.borderRadiusLG,
+ padding: 4,
+ },
}}
onOpenChange={handleOpenChange}
>
diff --git a/src/features/ChatInput/ActionBar/Knowledge/useControls.tsx b/src/features/ChatInput/ActionBar/Knowledge/useControls.tsx
index 122548be007..bb2c3fceea7 100644
--- a/src/features/ChatInput/ActionBar/Knowledge/useControls.tsx
+++ b/src/features/ChatInput/ActionBar/Knowledge/useControls.tsx
@@ -92,6 +92,7 @@ export const useControls = ({
label: (
<CheckboxItem
checked={item.enabled}
+ hasPadding={false}
id={item.id}
label={item.name}
labelMaxWidth={labelMaxWidth}
@@ -108,6 +109,7 @@ export const useControls = ({
label: (
<CheckboxItem
checked={item.enabled}
+ hasPadding={false}
id={item.id}
label={item.name}
labelMaxWidth={labelMaxWidth}
diff --git a/src/features/ChatInput/ActionBar/components/CheckboxWithLoading.tsx b/src/features/ChatInput/ActionBar/components/CheckboxWithLoading.tsx
index fe9490448aa..18f756ef678 100644
--- a/src/features/ChatInput/ActionBar/components/CheckboxWithLoading.tsx
+++ b/src/features/ChatInput/ActionBar/components/CheckboxWithLoading.tsx
@@ -13,6 +13,40 @@ export interface CheckboxItemProps {
onUpdate: (id: string, enabled: boolean) => Promise<void>;
}
+// Keep the file extension (and a few trailing characters) readable by ellipsizing
+// the MIDDLE of the name instead of the tail — "2024-quarterly-report-final.pdf"
+// truncates to "2024-quarterly…final.pdf" rather than hiding the ".pdf". Pure CSS:
+// the head flex-shrinks with an ellipsis while the fixed-width tail stays pinned.
+const TRUNCATE_TAIL_LENGTH = 8;
+
+const MiddleEllipsis = memo<{ text: string }>(({ text }) => {
+ // Short names gain nothing from middle truncation — render them in one piece.
+ if (text.length <= TRUNCATE_TAIL_LENGTH + 1) {
+ return <span style={{ overflow: 'hidden', whiteSpace: 'nowrap' }}>{text}</span>;
+ }
+
+ const head = text.slice(0, -TRUNCATE_TAIL_LENGTH);
+ const tail = text.slice(-TRUNCATE_TAIL_LENGTH);
+
+ return (
+ <>
+ <span
+ style={{
+ minWidth: 0,
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ whiteSpace: 'nowrap',
+ }}
+ >
+ {head}
+ </span>
+ <span style={{ flex: 'none', whiteSpace: 'nowrap' }}>{tail}</span>
+ </>
+ );
+});
+
+MiddleEllipsis.displayName = 'MiddleEllipsis';
+
const CheckboxItem = memo<CheckboxItemProps>(
({ id, onUpdate, label, checked, disabled, hasPadding = true, labelMaxWidth }) => {
const [loading, setLoading] = useState(false);
@@ -50,14 +84,13 @@ const CheckboxItem = memo<CheckboxItemProps>(
<span
title={typeof labelContent === 'string' ? labelContent : undefined}
style={{
+ display: 'flex',
maxWidth: labelMaxWidth,
minWidth: 0,
overflow: 'hidden',
- textOverflow: 'ellipsis',
- whiteSpace: 'nowrap',
}}
>
- {labelContent}
+ {typeof labelContent === 'string' ? <MiddleEllipsis text={labelContent} /> : labelContent}
</span>
{loading ? (
<Center width={18}>
diff --git a/src/features/ChatInput/ControlBar/ModeSelector.tsx b/src/features/ChatInput/ControlBar/ModeSelector.tsx
index e97c35b638b..6cdc9f319bc 100644
--- a/src/features/ChatInput/ControlBar/ModeSelector.tsx
+++ b/src/features/ChatInput/ControlBar/ModeSelector.tsx
@@ -106,6 +106,15 @@ const styles = createStaticStyles(({ css }) => ({
line-height: 1.4;
color: ${cssVar.colorText};
`,
+ popoverPopup: css`
+ /* The popup pads its option rows by 4px, so its corner must be one step larger
+ than the rows' radius (borderRadius 8 → borderRadiusLG 12 = 8 + 4) to wrap them
+ concentrically instead of looking tighter than them. &&& outranks the base
+ popup style's border-radius. */
+ &&& {
+ border-radius: ${cssVar.borderRadiusLG};
+ }
+ `,
}));
const AGENT_CAPS = [
@@ -226,12 +235,19 @@ const ModeSelector = memo(() => {
return (
<Popover
+ className={styles.popoverPopup}
content={popoverContent}
open={canCreateContent && open}
placement="topLeft"
trigger="click"
styles={{
- content: { border: `1px solid ${cssVar.colorBorderSecondary}`, padding: 4 },
+ // Match the inner viewport's corner to the enlarged popup radius so its
+ // border corners don't poke through the rounded popup.
+ content: {
+ border: `1px solid ${cssVar.colorBorderSecondary}`,
+ borderRadius: cssVar.borderRadiusLG,
+ padding: 4,
+ },
}}
onOpenChange={handleOpenChange}
>
diff --git a/src/features/CommandMenu/MainMenu.tsx b/src/features/CommandMenu/MainMenu.tsx
index 24228bb4e6d..d7ad31ffd86 100644
--- a/src/features/CommandMenu/MainMenu.tsx
+++ b/src/features/CommandMenu/MainMenu.tsx
@@ -24,7 +24,7 @@ import ContextCommands from './ContextCommands';
import { useCommandMenu } from './useCommandMenu';
const MainMenu = memo(() => {
- const { pathname, menuContext, setPages, pages } = useCommandMenuContext();
+ const { pathname, menuContext, setPages, pages, onClose } = useCommandMenuContext();
const { t } = useTranslation('common');
const { allowed: canCreate } = usePermission('create_content');
@@ -149,7 +149,14 @@ const MainMenu = memo(() => {
icon={<FeatherIcon />}
keywords={t('cmdk.keywords.contactUs').split(' ')}
value="contact-via-email"
- onSelect={() => openFeedbackModal()}
+ onSelect={() => {
+ // Close the palette through the context handler (which runs the exit
+ // animation and clears the local `isVisible` state) before opening the
+ // modal. `openFeedbackModal` only flips the store flag, which alone
+ // doesn't unmount the palette — so without this it stays on screen.
+ onClose();
+ openFeedbackModal();
+ }}
>
{t('cmdk.contactUs')}
</CommandItem>