Skip to content

Commit 3abc791

Browse files
committed
Fix document tree indent spacing and add web dev server
1 parent 28bce5b commit 3abc791

3 files changed

Lines changed: 337 additions & 4 deletions

File tree

components/PromptTreeItem.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ const DocumentTreeItem: React.FC<DocumentTreeItemProps> = (props) => {
190190

191191
const safeIndent = Math.max(indentPerLevel, 0);
192192
const paddingTopBottom = Math.max(verticalSpacing, 0);
193+
const basePaddingLeft = 4; // matches Tailwind px-1 for consistent baseline spacing
194+
const rowPaddingLeft = basePaddingLeft + Math.max(level, 0) * safeIndent;
193195

194196
return (
195197
<li
@@ -206,8 +208,8 @@ const DocumentTreeItem: React.FC<DocumentTreeItemProps> = (props) => {
206208
<div
207209
onClick={(e) => !isRenaming && onSelectNode(node.id, e)}
208210
onDoubleClick={(e) => !isRenaming && handleRenameStart(e)}
209-
style={{ paddingTop: `${paddingTopBottom}px`, paddingBottom: `${paddingTopBottom}px` }}
210-
className={`w-full text-left px-1 rounded-md group flex justify-between items-center transition-colors duration-150 text-xs relative focus:outline-none ${
211+
style={{ paddingTop: `${paddingTopBottom}px`, paddingBottom: `${paddingTopBottom}px`, paddingLeft: `${rowPaddingLeft}px` }}
212+
className={`w-full text-left pr-1 rounded-md group flex justify-between items-center transition-colors duration-150 text-xs relative focus:outline-none ${
211213
isSelected ? 'bg-tree-selected text-text-main' : 'hover:bg-border-color/30 text-text-secondary hover:text-text-main'
212214
} ${isFocused ? 'ring-2 ring-primary ring-offset-[-2px] ring-offset-secondary' : ''}`}
213215
>
@@ -270,7 +272,6 @@ const DocumentTreeItem: React.FC<DocumentTreeItemProps> = (props) => {
270272
{isFolder && isExpanded && (
271273
<ul
272274
className="m-0 pl-0 list-none space-y-0"
273-
style={{ marginLeft: `${safeIndent}px` }}
274275
>
275276
{node.children.map((childNode, index) => (
276277
<DocumentTreeItem

0 commit comments

Comments
 (0)