feat(trees): add flattened segment truncation option - #1068
Conversation
|
@AbarnaaSree is attempting to deploy a commit to the Pierre Computer Company Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e49dae4f2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return flattenedSegmentsTruncation === 'end' ? ( | ||
| <MiddleTruncate minimumLength={5}> | ||
| {segments.map((segment) => segment.name).join(' / ')} | ||
| </MiddleTruncate> |
There was a problem hiding this comment.
Render the rename input in end truncation mode
When renaming is enabled and a flattened row is renamed with flattenedSegmentsTruncation: 'end', this branch renders only the joined segment names and drops the renameInput that was passed in. Starting rename on such a flattened row leaves renameInputRef unset, so the inline editor never appears/focuses and the user cannot edit or commit the rename in this mode.
Useful? React with 👍 / 👎.
| searchFakeFocus, | ||
| stickyFolders, | ||
| unsafeCSS, | ||
| flattenedSegmentsTruncation, |
There was a problem hiding this comment.
Forward the truncation option through SSR preload
Adding this as a public FileTreeOptions value means callers can pass it to preloadFileTree, but only the client FileTree constructor destructures and forwards it; in preloadFileTree the new field still falls through into controllerOptions and is never passed to FileTreeView. With preloadFileTree({ flattenedSegmentsTruncation: 'end', ... }), the SSR HTML is rendered with the default per-segment markup and then changes on hydrate/render, so the option is ineffective for the server output and produces a client/server first-paint mismatch.
Useful? React with 👍 / 👎.
|
The Vercel checks for |
Summary
Adds a
flattenedSegmentsTruncationoption to the FileTree component to control how flattened path segments are truncated.Changes
flattenedSegmentsTruncationto the public FileTree options.per-segmentandendtruncation modes.FileTreetoFileTreeView.Validation
trees:typecheck— passedgit diff --cached --check— passed