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(working-sidebar): align the documents list with the panel tab strip (#20806)

Arvin Xue5b444218a00
diff --git a/src/features/AgentDocumentsExplorer/DocumentExplorerToolbar.tsx b/src/features/AgentDocumentsExplorer/DocumentExplorerToolbar.tsx
index 2d9dd56caf4..76e2d8b25bc 100644
--- a/src/features/AgentDocumentsExplorer/DocumentExplorerToolbar.tsx
+++ b/src/features/AgentDocumentsExplorer/DocumentExplorerToolbar.tsx
@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next';
const styles = createStaticStyles(({ css, cssVar }) => ({
toolbar: css`
/* Title on the column of the panel tabs' icons; the + stays on the row edge. */
- padding-inline-start: 6px;
+ padding-inline-start: 10px;
color: ${cssVar.colorTextSecondary};
`,
title: css`
diff --git a/src/features/AgentDocumentsExplorer/DocumentExplorerTree.tsx b/src/features/AgentDocumentsExplorer/DocumentExplorerTree.tsx
index cb83df9eec3..985677440b5 100644
--- a/src/features/AgentDocumentsExplorer/DocumentExplorerTree.tsx
+++ b/src/features/AgentDocumentsExplorer/DocumentExplorerTree.tsx
@@ -96,9 +96,9 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
--trees-item-row-gap-override: ${DOCUMENT_TREE_LAYOUT.iconGap}px;
/* No horizontal gutter of its own: a row's hover fill spans the panel's
- content edges. Rows start without leading padding (DOCUMENT_TREE_ROW_CSS)
- so the chevron glyph lines up with the γ€Œζ–‡ζ‘£γ€ title, which in turn sits on
- the column of the panel tabs (ζŠ€θƒ½ / ζ–‡ζ‘£) above. */
+ content edges, the same edges as the panel tabs (ζŠ€θƒ½ / ζ–‡ζ‘£) above. Rows
+ pad their start (DOCUMENT_TREE_ROW_CSS) so the first glyph β€” file icon or
+ chevron β€” lines up with the γ€Œζ–‡ζ‘£γ€ title. */
--trees-item-padding-x-override: 6px;
--trees-item-margin-x-override: 0px;
--trees-padding-inline-override: 0px;
diff --git a/src/features/Conversation/WorkingSidebar/ResourcesSection/index.tsx b/src/features/Conversation/WorkingSidebar/ResourcesSection/index.tsx
index 1a0a6afc952..6bfc9eb555b 100644
--- a/src/features/Conversation/WorkingSidebar/ResourcesSection/index.tsx
+++ b/src/features/Conversation/WorkingSidebar/ResourcesSection/index.tsx
@@ -37,7 +37,9 @@ const ResourcesSection = memo<ResourcesSectionProps>(({ deviceId, enabled = true
flex={1}
gap={16}
paddingBlock={8}
- paddingInline={'8px 12px'}
+ // The document tree's row fill spans the content edges, so it takes the
+ // header's 4px gutter: a selected row then lines up with the tabs above.
+ paddingInline={filter === 'documents' ? 4 : '8px 12px'}
style={{ minHeight: 0 }}
>
{isHetero && workingDirectory && filter === 'skills' && (
diff --git a/src/features/ExplorerTree/documentTreeStyle.ts b/src/features/ExplorerTree/documentTreeStyle.ts
index 6e6dedacffb..891d1abae05 100644
--- a/src/features/ExplorerTree/documentTreeStyle.ts
+++ b/src/features/ExplorerTree/documentTreeStyle.ts
@@ -156,12 +156,26 @@ export const DOCUMENT_TREE_ROW_CSS = `
font-weight: 500;
}
- /* The chevron glyph sits centered in its 16px slot, ~6px in from the slot's
- edge. Starting rows with no leading padding puts that glyph on the same line
- as the section title and the panel tabs above it, while the hover fill still
- reaches the panel edge. The trailing padding (the action lane) stays. */
+ /* The row's fill shares the panel tabs' edge (the pane's 4px gutter); this
+ leading padding keeps the first glyph off that edge. Alignment is by glyph,
+ not by box: the file glyph's ~2.7px inset lands it on the section title's
+ first character. The trailing padding (the action lane) stays. */
[data-type='item'] {
- padding-inline-start: 0;
+ padding-inline-start: 8px;
+ }
+
+ /* The chevron glyph sits ~5.7px inside its 16px slot, so it would read as
+ indented past the title and the file glyphs. Pull only the glyph back onto
+ their column; the slot keeps its width so the folder glyph and the label
+ stay where the nested file rows expect them. \`translate\` composes with
+ pierre's own nudge / expand-rotation \`transform\` instead of replacing it.
+ \`translate\` is physical, so RTL mirrors it toward the inline start too. */
+ [data-item-type='folder'] > [data-item-section='icon'] > [data-icon-name='file-tree-icon-chevron'] {
+ translate: -4px 0;
+
+ &:dir(rtl) {
+ translate: 4px 0;
+ }
}
${DOCUMENT_TREE_NO_FOCUS_BORDER_CSS}