Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughAdds a centralized upload-error interpreter and wires it into the profile-picture upload UI; upgrades Next/React versions; and refactors and extends worktree tooling with shared helpers, VS Code settings, pre-commit hook setup, improved symlink creation, and sync.conf changes. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer CLI
participant Sync as wt-sync.sh
participant Main as Main Repo (fs)
participant WT as Worktree (fs)
participant Python as Python (optional)
participant Git as Git
participant VSCode as .vscode/settings.json
participant Hooks as .hooks/pre-commit
Dev->>Sync: invoke wt-sync.sh (worktree)
Sync->>Main: read sync.conf
Sync->>Main: ensure_source_dirs()
Main-->>Sync: create/repair missing source dirs
Sync->>WT: for each mapping, create_symlink(rel_path)
Sync->>Python: request relative symlink path (if available)
alt Python available
Python-->>Sync: computed relative path
else
Sync-->>Sync: fallback path computation or error
end
Sync->>Git: configure worktree hooks (core.hooksPath, extensions.worktreeConfig)
Sync->>VSCode: setup_vscode_settings(worktree_path)
Sync->>Hooks: setup_precommit_hook(worktree_path)
Sync->>WT: run post-sync npm install (subshell)
Sync-->>Dev: finish
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@services/api/upload-error.ts`:
- Around line 31-36: The serverMsg assignment can end up being a non-string
(e.g., an object) causing toasts to show “[object Object]”; in the block that
builds serverMsg (using error.response?.data?.error and messageFromUnknown) add
a type check so you only use error.response.data.error when it's a string,
otherwise fall back to messageFromUnknown or a safe stringified version (e.g.,
JSON.stringify with try/catch) and finally ensure the function returns a string
by coalescing to FALLBACK_HINT if needed; update the logic around serverMsg and
the return so serverMsg is always a string before returning.
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In `@package.json`:
- Line 112: Update the pinned dependency for eslint-config-next to match the
Next.js 16.1 upgrade: change the package.json entry for "eslint-config-next"
from "16.0.7" to a 16.1.x release (e.g. "16.1.1") so it aligns with the "next":
"16.1" entry; after editing the "eslint-config-next" version, run your package
install (npm/yarn/pnpm) to refresh the lockfile and verify linting passes.
In `@scripts/worktree/wt-common.sh`:
- Around line 88-92: The heredoc that emits the tailwind setting containing
backticks causes shell command substitution; update the heredoc usage so
backticks are not interpreted by the shell—either switch to a quoted heredoc
(e.g., use <<'EOF') or escape backticks inside the
tailwindCSS.experimental.classRegex block so the patterns like
"['\"`]([^'\"`]*tw-[^'\"`]*)['\"`]" are preserved; modify the section that
writes tailwindCSS.experimental.classRegex (the heredoc that includes clsx(),
cn(), cva() patterns) to use a safe quoted heredoc or escape each backtick and
ensure any injected variables (e.g., $color) are handled separately.
In `@scripts/worktree/wt-sync.sh`:
- Around line 125-149: The ensure_source_dirs function is performing destructive
operations (rm -f and mkdir -p) even in dry-run mode; add a guard at the top of
ensure_source_dirs to detect the dry-run flag (e.g., DRY_RUN or the existing
--dry-run variable used elsewhere) and return early with a log message when
dry-run is active, and similarly wrap the other blocks that call rm -f
"$source_path" and mkdir -p "$source_path" (the spots you noted around the other
removals/creates) with the same dry-run check so no filesystem mutations occur
during --dry-run.
- Around line 283-287: The string comparison between "$worktree_path" and
"$MAIN_REPO" can miss symlinked/realpath variants; resolve both to canonical
paths before comparing (e.g., use realpath or readlink -f) and compare those
values instead. Update the check around worktree_path and MAIN_REPO so it
computes resolved_worktree="$(realpath "$worktree_path" 2>/dev/null || readlink
-f "$worktree_path" 2>/dev/null || echo "$worktree_path")" and
resolved_main="$(realpath "$MAIN_REPO" 2>/dev/null || readlink -f "$MAIN_REPO"
2>/dev/null || echo "$MAIN_REPO")" and then compare resolved_worktree ==
resolved_main to decide to log_verbose " Skipping main repo" and return.
🧹 Nitpick comments (2)
package.json (1)
119-122: Align React package ranges with pinned type packages.
react/react-domuse caret ranges (^19.2.3) while@types/reactand@types/react-domare pinned to exact versions (19.2.3). If a newer React 19.x version is released and resolved, the type definitions will not update automatically, potentially causing type/runtime mismatches. Consider pinning React to exact versions or loosening the type packages to match the same range.scripts/worktree/wt-add.sh (1)
41-48: Consider removing duplicate VS Code + hook setup after wt-sync.
wt-sync.shnow runssetup_vscode_settingsandsetup_precommit_hook; doing it again here is redundant and can be trimmed.

Adds a shared upload error normalizer so uploads surface friendly network/403/size failures. Wires the PFP edit flow to use it instead of raw errors. No behavioral changes beyond clearer toasts.
Summary by CodeRabbit
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.