Finder-style columns that reveal each successive level of a hierarchy
Finder 风格的分栏,逐级展开层级结构
also called也叫
browser view, Finder column view, Miller columns, hierarchical browser浏览器视图、Finder 分栏视图、Miller 分栏、层级浏览器
If you called it…如果你管它叫……
“the finder columns thing”「Finder 里那个分栏的东西」
“folders opening in columns to the right”「文件夹一级级往右边开列」
“the file browser where every level gets a new column”「每深入一级就新开一列的文件浏览器」
“side by side columns showing a folder path”「并排几列展示文件夹路径」
“the hierarchy browser with arrows at the end of rows”「行尾带箭头的层级浏览器」
Files
标本可交互,可以直接操作。
Anatomy — every part, named解剖 —— 每个部件的名字
1Path column路径列NSBrowser
“Each folder opening in a new column” is a path column in an NSBrowser.
「每个文件夹在新列里打开」,每一列都是 NSBrowser 里的一列路径列。
Prompt fragmentPrompt 片段
an NSBrowser path column that keeps one visible level of the selected hierarchy
NSBrowser 的一列路径列,保持所选层级中的一级可见
2Branch indicator分支指示箭头NSBrowserCell.isLeaf
“The little arrow at the end of a folder row” is the branch indicator for a non-leaf cell.
「文件夹行尾的小箭头」就是非叶子单元格的分支指示箭头。
Prompt fragmentPrompt 片段
the branch indicator on a non-leaf NSBrowserCell, showing that selecting the row will reveal another column
非叶子 NSBrowserCell 上的分支指示箭头,表示选中该行会展开下一列
3Selected path选中路径NSBrowser.path
“The highlighted row in every column” is the selected path through the browser.
「每一列里高亮的那一行」连起来就是浏览器里的选中路径。
Prompt fragmentPrompt 片段
the NSBrowser selected path, with one highlighted ancestor row preserved in each visible column
NSBrowser 的选中路径,每个可见列里都保留一个高亮的祖先行
Prompt — paste into your agentPrompt —— 直接粘贴给你的代理
Build a Finder-style Column View with NSBrowser and NSBrowserCell: selecting a non-leaf row reveals its children in a new column immediately to the right, preserving the visible hierarchy path. Do not substitute a flat list or a single sidebar-detail split.
用 NSBrowser 和 NSBrowserCell 构建 Finder 风格的分栏视图:选中非叶子行时,它的子项立即在右侧新列中出现,保持层级路径可见。不要用扁平列表或单个「边栏+详情」拆分布局来替代。
Debug prompt — when it misbehaves调试 Prompt —— 当它不听话时
Debug my macOS column view (NSBrowser, Miller columns). Rule out: stale columns because reloadColumn/reloadData never ran after the model changed; confusing path-based selection with item-based delegate methods; lazy child loading never triggered because isLeafItem answers wrong; the horizontal scroll position jumping when columns are added. The symptom:
# Column View (Browser) · 分栏视图(层级浏览器)
UI reference — https://K3tty5555.github.io/LearnUI_PM/macos/column-view/
**Finder-style columns that reveal each successive level of a hierarchy**
Finder 风格的分栏,逐级展开层级结构
**Also called / 也叫:** browser view, Finder column view, Miller columns, hierarchical browser / 浏览器视图、Finder 分栏视图、Miller 分栏、层级浏览器
## Anatomy — every part, named / 解剖
1. **Path column · 路径列** (`NSBrowser`)
“Each folder opening in a new column” is a path column in an NSBrowser.
「每个文件夹在新列里打开」,每一列都是 NSBrowser 里的一列路径列。
Prompt fragment: an NSBrowser path column that keeps one visible level of the selected hierarchy
2. **Branch indicator · 分支指示箭头** (`NSBrowserCell.isLeaf`)
“The little arrow at the end of a folder row” is the branch indicator for a non-leaf cell.
「文件夹行尾的小箭头」就是非叶子单元格的分支指示箭头。
Prompt fragment: the branch indicator on a non-leaf NSBrowserCell, showing that selecting the row will reveal another column
3. **Selected path · 选中路径** (`NSBrowser.path`)
“The highlighted row in every column” is the selected path through the browser.
「每一列里高亮的那一行」连起来就是浏览器里的选中路径。
Prompt fragment: the NSBrowser selected path, with one highlighted ancestor row preserved in each visible column
## Prompt / 提示词
Build a Finder-style Column View with NSBrowser and NSBrowserCell: selecting a non-leaf row reveals its children in a new column immediately to the right, preserving the visible hierarchy path. Do not substitute a flat list or a single sidebar-detail split.
用 NSBrowser 和 NSBrowserCell 构建 Finder 风格的分栏视图:选中非叶子行时,它的子项立即在右侧新列中出现,保持层级路径可见。不要用扁平列表或单个「边栏+详情」拆分布局来替代。
## Debug prompt / 调试提示词
Debug my macOS column view (NSBrowser, Miller columns). Rule out: stale columns because reloadColumn/reloadData never ran after the model changed; confusing path-based selection with item-based delegate methods; lazy child loading never triggered because isLeafItem answers wrong; the horizontal scroll position jumping when columns are added. The symptom:
调试我的 macOS 分栏视图(NSBrowser、Miller columns)。排除以下可能:模型变了之后没调 reloadColumn/reloadData,列内容是旧的;把基于 path 的选中和基于 item 的 delegate 方法搞混;isLeafItem 回答错了,子项的懒加载永远不触发;新增列时水平滚动位置乱跳。症状是:
## In code / 代码里叫什么
- **AppKit** `NSBrowser`
- **AppKit** `NSBrowserCell`
- **SwiftUI** `NavigationSplitView` — approximate; no direct equivalent / 近似方案;没有直接等价物