Repository navigation
Add file library exclusion globs - #24
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3ff50d89f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| </div> | ||
| <div className="workspace"> | ||
| <Sidebar visible={sidebarVisible} tab={sidebarTab} onTabChange={setSidebarTab} outline={outline} outlineDocumentKey={activeDocumentId} activeOutlineSlug={activeOutlineSlug} outlineMode={preferences.outlineMode} outlineMaxLevel={preferences.outlineMaxLevel} fileTree={fileTree} currentFilePath={filePath} revealFilePath={fileReveal?.path ?? null} revealRequest={fileReveal?.request ?? 0} onOpenFile={(path) => void loadFile(path)} onRevealEntry={(node) => void revealFolderEntryInFinder(node)} onHeadingClick={scrollToHeading} onRequestFocusEditor={() => editorRef.current?.focus()} folderPath={folderPath} onCreateEntry={beginCreateFolderEntry} onRenameEntry={beginRenameFolderEntry} onTrashEntry={(node) => void trashFolderEntry(node)} onRefreshFolder={() => { if (folderPath) void refreshFolder(folderPath) }} /> | ||
| <Sidebar visible={sidebarVisible} tab={sidebarTab} onTabChange={setSidebarTab} outline={outline} outlineDocumentKey={activeDocumentId} activeOutlineSlug={activeOutlineSlug} outlineMode={preferences.outlineMode} outlineMaxLevel={preferences.outlineMaxLevel} fileTree={visibleFileTree} currentFilePath={filePath} revealFilePath={fileReveal?.path ?? null} revealRequest={fileReveal?.request ?? 0} onOpenFile={(path) => void loadFile(path)} onRevealEntry={(node) => void revealFolderEntryInFinder(node)} onHeadingClick={scrollToHeading} onRequestFocusEditor={() => editorRef.current?.focus()} folderPath={folderPath} onCreateEntry={beginCreateFolderEntry} onRenameEntry={beginRenameFolderEntry} onTrashEntry={(node) => void trashFolderEntry(node)} onRefreshFolder={() => { if (folderPath) void refreshFolder(folderPath) }} /> |
There was a problem hiding this comment.
Clear selections hidden by an exclusion change
When a user selects a directory or image and then adds a glob that excludes it, visibleFileTree removes the row but Sidebar retains the node in its local selectedNode state. The toolbar therefore remains enabled with no visible selection, and Create, Rename, Reveal, or Move to Trash still operates on that hidden stale path; in particular, clicking the trash action can remove an item the user can no longer see. Clear the selection whenever its path is absent from the newly filtered tree.
Useful? React with 👍 / 👎.
| .split(/\r?\n/) | ||
| .slice(0, 100) | ||
| .map((line) => normalizePattern(line).slice(0, 256)) | ||
| .filter(Boolean) |
There was a problem hiding this comment.
Count only nonempty patterns toward the glob limit
When the preference contains blank separator lines, the 100-line limit is applied before normalization and empty-line removal, so those blanks consume pattern slots and valid globs later in the textarea are silently ignored. For example, 50 patterns separated by blank lines already exhaust the limit before any subsequent entries are compiled, causing entries the user explicitly excluded to remain visible. Filter empty normalized lines before taking the first 100 patterns.
Useful? React with 👍 / 👎.
| .map((pattern) => ({ | ||
| basenameOnly: !pattern.includes('/'), | ||
| expression: new RegExp(`^${globSource(pattern)}$`) | ||
| })) |
There was a problem hiding this comment.
Compile single-character globs as Unicode-aware
For filenames containing a non-BMP character such as an emoji, ? does not behave as a single-character wildcard because the generated regex is compiled without the Unicode flag and [^/] consumes only one UTF-16 surrogate. Consequently, a documented pattern such as ?.md fails to exclude 😀.md even though it contains one user-visible character. Compile the expression in Unicode mode so the wildcard consumes one code point.
Useful? React with 👍 / 👎.
Summary
Safety boundary
Validation
npm run verify: 27 suites / 130 tests PASSIndependent read-only review is running on exact head c3ff50d.