Skip to content

feat(web): add file tree expand all controls - #12

Merged
Zain-Repo merged 3 commits into
mainfrom
codex/pr-8889-file-tree
Sep 1, 2026
Merged

feat(web): add file tree expand all controls#12
Zain-Repo merged 3 commits into
mainfrom
codex/pr-8889-file-tree

Conversation

@Zain-Repo

Copy link
Copy Markdown
Owner

Summary

Add an accessible expand-all/collapse-all control to the file browser and keep the action idempotent for already-expanded folders.

Validation

  • File tree expansion tests: 3 passed
  • Web typecheck passed

Upstream reference: pingdotgg/t3code#8889

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T18:21:58.394334Z 53067e9 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Sep 1, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dcc458b3a8

ℹ️ 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".

Comment on lines +381 to +384
aria-label={
allDirectoriesExpanded ? "Collapse all folders" : "Expand all folders"
}
onClick={toggleAllDirectories}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the expand-all control to the mobile file tree

This adds the action only to the web file browser, while mobile has an equivalent FileTreeBrowser that maintains expandedPaths and currently exposes only per-directory toggles (apps/mobile/src/features/files/FileTreeBrowser.tsx:118-194). Consequently, users controlling the same project from mobile cannot access the new expand/collapse-all behavior; add the equivalent mobile action or explicitly establish why that client is unsupported.

AGENTS.md reference: AGENTS.md:L67-L70

Useful? React with 👍 / 👎.

@github-actions github-actions Bot added size:L and removed size:M labels Sep 1, 2026
@Zain-Repo

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

useEffect(() => {
if (previousTreePathsRef.current === treePaths) return;

P1 Badge Document the new folder expansion controls

This commit exposes new expand-all/collapse-all behavior in both the web and mobile file browsers, but it does not update any docs/user/ page, so users have no shipped documentation for discovering or understanding the new controls. Add the behavior to the appropriate user guide, as required for user-visible changes.

AGENTS.md reference: AGENTS.md:L73-L75

ℹ️ 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".

@Zain-Repo

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53067e9ffd

ℹ️ 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".

Comment on lines +199 to +201
const toggleAllDirectories = useCallback(() => {
setExpandedPaths(allDirectoriesExpanded ? new Set() : new Set(directoryPaths));
}, [allDirectoriesExpanded, directoryPaths]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve collapse-all across entry refreshes

When a user collapses all folders and the entries are subsequently refreshed or changed, this sets expandedPaths to an empty set, but the initialization effect treats any empty set as uninitialized when the new tree produces a new defaultExpanded value and automatically reopens every top-level folder. Track whether default expansion has already been initialized separately from expandedPaths.size so a deliberate collapse-all remains collapsed after a refresh.

Useful? React with 👍 / 👎.

@Zain-Repo
Zain-Repo merged commit 859bc71 into main Sep 1, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant