Skip to content

Commit 9e0cfae

Browse files
authored
Merge pull request #933 from iOfficeAI/feat/homepage-guid-ui
feat(guid,layout): homepage UX and sidebar tweaks
2 parents b83d671 + f0e47ab commit 9e0cfae

File tree

4 files changed

+44
-8
lines changed

4 files changed

+44
-8
lines changed

src/renderer/pages/guid/index.module.css

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,28 @@
2828
min-width: 0;
2929
}
3030

31+
/* 首页输入框下方「模型 / 模式」按钮:弱化视觉,不抢主输入区 */
32+
.actionTools :global(.sendbox-model-btn) {
33+
background-color: transparent !important;
34+
border: 1px solid var(--border-base) !important;
35+
color: var(--color-text-2) !important;
36+
}
37+
38+
.actionTools :global(.sendbox-model-btn:hover) {
39+
background-color: var(--color-fill-2) !important;
40+
border-color: var(--color-border-2) !important;
41+
color: var(--color-text-1) !important;
42+
}
43+
44+
/* 暗色模式:边框用稍亮色,否则与背景融在一起看不见 */
45+
[data-theme='dark'] .actionTools :global(.sendbox-model-btn) {
46+
border-color: var(--bg-4) !important;
47+
}
48+
49+
[data-theme='dark'] .actionTools :global(.sendbox-model-btn:hover) {
50+
border-color: var(--bg-5) !important;
51+
}
52+
3153
.actionSubmit {
3254
display: flex;
3355
align-items: center;
@@ -94,6 +116,11 @@
94116
position: relative;
95117
}
96118

119+
/* 整体内容块略往上移,减轻「重心偏下」的感觉 */
120+
.guidContainer .guidLayout {
121+
margin-top: -5vh;
122+
}
123+
97124
@media (max-width: 768px) {
98125
.guidContainer {
99126
justify-content: flex-start;
@@ -102,6 +129,10 @@
102129
padding-top: 20px;
103130
-webkit-overflow-scrolling: touch;
104131
}
132+
133+
.guidContainer .guidLayout {
134+
margin-top: 0;
135+
}
105136
}
106137

107138
/* 浅色占位符 */

src/renderer/pages/guid/index.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -862,11 +862,11 @@ const Guid: React.FC = () => {
862862
const handleInputChange = useCallback(
863863
(value: string) => {
864864
setInput(value);
865+
// 首页不根据输入 @ 呼起 mention 列表,占位符里的 @agent 仅为提示,选 agent 用顶部栏或下拉手动选
865866
const match = value.match(mentionMatchRegex);
866867
if (match) {
867868
setMentionQuery(match[1]);
868-
setMentionOpen(true);
869-
setMentionSelectorOpen(false);
869+
setMentionOpen(false);
870870
} else {
871871
setMentionQuery(null);
872872
setMentionOpen(false);
@@ -1431,17 +1431,18 @@ const Guid: React.FC = () => {
14311431
<ConfigProvider getPopupContainer={() => guidContainerRef.current || document.body}>
14321432
<div ref={guidContainerRef} className={styles.guidContainer}>
14331433
<div className={styles.guidLayout}>
1434-
<p className={`text-2xl font-semibold mb-8 text-0 text-center`}>{t('conversation.welcome.title')}</p>
1434+
<p className={`text-2xl font-semibold mb-6 text-0 text-center`}>{t('conversation.welcome.title')}</p>
14351435

14361436
{/* Agent 选择器 - 在标题下方 */}
14371437
{availableAgents && availableAgents.length > 0 && (
14381438
<div className='w-full flex justify-center'>
14391439
<div
1440-
className='inline-flex items-center bg-fill-2'
1440+
className='flex flex-wrap items-center justify-center'
14411441
style={{
1442-
marginBottom: 16,
1443-
padding: '4px',
1442+
marginBottom: 20,
1443+
padding: '6px',
14441444
borderRadius: '30px',
1445+
backgroundColor: 'var(--color-guid-agent-bar, var(--aou-2))',
14451446
transition: 'all 0.6s cubic-bezier(0.2, 0.8, 0.3, 1)',
14461447
width: 'fit-content',
14471448
gap: 0,
@@ -1532,7 +1533,7 @@ const Guid: React.FC = () => {
15321533
</Dropdown>
15331534
</div>
15341535
)}
1535-
<Input.TextArea autoSize={{ minRows: 3, maxRows: 20 }} placeholder={typewriterPlaceholder || t('conversation.welcome.placeholder')} className={`text-16px focus:b-none rounded-xl !bg-transparent !b-none !resize-none !p-0 ${styles.lightPlaceholder}`} value={input} onChange={handleInputChange} onPaste={onPaste} onFocus={handleTextareaFocus} onBlur={handleTextareaBlur} {...compositionHandlers} onKeyDown={handleInputKeyDown}></Input.TextArea>
1536+
<Input.TextArea autoSize={{ minRows: 3, maxRows: 20 }} placeholder={`${selectedAgentLabel}, ${typewriterPlaceholder || t('conversation.welcome.placeholder')}`} className={`text-16px focus:b-none rounded-xl !bg-transparent !b-none !resize-none !p-0 ${styles.lightPlaceholder}`} value={input} onChange={handleInputChange} onPaste={onPaste} onFocus={handleTextareaFocus} onBlur={handleTextareaBlur} {...compositionHandlers} onKeyDown={handleInputKeyDown}></Input.TextArea>
15361537
{mentionOpen && (
15371538
<div className='absolute z-50' style={{ left: 16, top: 44 }}>
15381539
{mentionMenu}
@@ -1598,7 +1599,7 @@ const Guid: React.FC = () => {
15981599
}
15991600
>
16001601
<span className='flex items-center gap-4px cursor-pointer lh-[1]'>
1601-
<Button type='text' shape='circle' className={isPlusDropdownOpen ? styles.plusButtonRotate : ''} icon={<Plus theme='outline' size='14' strokeWidth={2} fill={iconColors.primary} />}></Button>
1602+
<Button type='text' shape='circle' className={`sendbox-model-btn ${isPlusDropdownOpen ? styles.plusButtonRotate : ''}`} icon={<Plus theme='outline' size='14' strokeWidth={2} fill={iconColors.primary} />}></Button>
16021603
{files.length > 0 && (
16031604
<Tooltip className={'!max-w-max'} content={<span className='whitespace-break-spaces'>{getCleanFileNames(files).join('\n')}</span>}>
16041605
<span className='text-t-primary'>File({files.length})</span>

src/renderer/styles/themes/base.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ body,
257257
/* Layout sider base styles / 布局侧栏基础样式 */
258258
.layout-sider {
259259
overflow-x: hidden;
260+
box-shadow: none !important;
261+
border-right: 1px solid var(--border-base);
260262
}
261263

262264
.layout-sider.collapsed .arco-layout-sider-children,

src/renderer/styles/themes/color-schemes/default.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,15 @@
6868
--fill-0: #ffffff; /* 填充色 0 */
6969
--fill-white-to-black: #ffffff; /* 白到黑填充色 */
7070
--border-special: var(--bg-3); /* 特殊边框色 */
71+
--color-guid-agent-bar: #eaecf7; /* 首页 Agent 选择条背景 - 亮色 */
7172
}
7273

7374
/* Dark Mode */
7475
[data-color-scheme='default'][data-theme='dark'] {
7576
/* AOU Brand Colors - Dark Mode */
7677
--aou-1: #2a2a2a;
7778
--aou-2: #3d4150;
79+
--color-guid-agent-bar: var(--aou-2); /* 首页 Agent 选择条背景 - 暗色沿用 aou-2 */
7880
--aou-3: #525a77;
7981
--aou-4: #6a749b;
8082
--aou-5: #838fba;

0 commit comments

Comments
 (0)