GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: configurable project grouping by tlh38 · Pull Request #2055 · pingdotgg/t3code Conversation
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Needs human review 2 blocking correctness issues found. This PR introduces a new configurable project grouping feature with ~1600 lines of new code, new UI workflows, and cross-cutting behavioral changes. Additionally, there is an unresolved high-severity review comment identifying a bug where physical vs scoped key format mismatch breaks manual project sorting functionality. You can customize Macroscope's approvability policy. Learn more. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- Group projects by repository path with per-project overrides - Add nested context menu actions for grouped project members - Update rename/delete flows for multi-project sidebar rows
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| ): string { | ||
| return project?.repositoryIdentity?.canonicalKey ?? scopedProjectKey(projectRef); | ||
| return project ? deriveLogicalProjectKey(project, options) : scopedProjectKey(projectRef); | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
deriveLogicalProjectKeyFromRef is now unusedLow Severity
deriveLogicalProjectKeyFromRef is exported but no longer imported or called anywhere in the codebase after this PR refactored all callers to use deriveLogicalProjectKeyFromSettings instead. This is dead exported code.
Reviewed by Cursor Bugbot for commit 41e5a90. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- lets users change project grouping from the project sort menu - removes the duplicate setting from General settings Co-authored-by: codex <[email protected]>
| for (const sourceItem of source) { | ||
| if (typeof sourceItem.id !== "string" || typeof sourceItem.label !== "string") { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟢 Low src/main.ts:165
When source contains null or undefined elements (possible via untrusted IPC input), accessing sourceItem.id on line 166 throws a TypeError instead of being filtered out. Consider adding a guard to skip non-object elements before property access.
for (const sourceItem of source) {
+ if (!sourceItem || typeof sourceItem !== 'object') {
+ continue;
+ }
if (typeof sourceItem.id !== "string" || typeof sourceItem.label !== "string") {In file apps/desktop/src/main.ts around lines 165-166:
When `source` contains `null` or `undefined` elements (possible via untrusted IPC input), accessing `sourceItem.id` on line 166 throws a `TypeError` instead of being filtered out. Consider adding a guard to skip non-object elements before property access.
Evidence trail:
apps/desktop/src/main.ts lines 162-167 (normalizeContextMenuItems function with typeof sourceItem.id check), apps/desktop/src/main.ts lines 1734-1737 (ipcMain.handle calling normalizeContextMenuItems with untrusted IPC items)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| if (!isDisabled) { | ||
| if (hasChildren) { | ||
| button.addEventListener("mouseenter", () => { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium src/contextMenuFallback.ts:96
When a submenu overflows the right viewport edge, the mouseenter handler (lines 96-110) calls clampMenuPosition to flip it to the left side, but openMenu's requestAnimationFrame callback (lines 132-134) immediately re-clamps it using the original preferredLeft (which caused the overflow). The menu ends up pinned to the right edge instead of the intended left-side position, making the flip logic non-functional.
In file apps/web/src/contextMenuFallback.ts around line 96:
When a submenu overflows the right viewport edge, the `mouseenter` handler (lines 96-110) calls `clampMenuPosition` to flip it to the left side, but `openMenu`'s `requestAnimationFrame` callback (lines 132-134) immediately re-clamps it using the original `preferredLeft` (which caused the overflow). The menu ends up pinned to the right edge instead of the intended left-side position, making the flip logic non-functional.
Evidence trail:
apps/web/src/contextMenuFallback.ts lines 96-110 (mouseenter handler with flip logic), lines 131-133 (requestAnimationFrame callback in openMenu), lines 3-15 (clampMenuPosition function). The rAF callback scheduled in openMenu uses the original preferredLeft parameter, which overwrites any position changes made after openMenu returns but before the rAF callback executes.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium components/Sidebar.tsx:2689
The inline selector at lines 2689-2692 creates a new object reference on every render. Since useSettings includes the selector function in its useMemo dependency array, projectGroupingSettings becomes a new reference each render. This causes the useMemo hooks at lines 2729-2734 and 2746-2763 to recompute unnecessarily, defeating memoization. Consider extracting the selector to a stable reference with useCallback or defining it outside the component.
const projectGroupingSettings = useSettings(useCallback((settings) => ({
sidebarProjectGroupingMode: settings.sidebarProjectGroupingMode,
sidebarProjectGroupingOverrides: settings.sidebarProjectGroupingOverrides,
}), []));
apps/web/src/hooks/useHandleNewThread.ts:22
The inline selector arrow function passed to
useSettingscreates a new function reference on every render. SinceuseSettingsusesuseMemowith theselectorin its dependency array,projectGroupingSettingswill be a new object reference on every render even when the values haven't changed. This object is included in theuseCallbackdependency array at line 137, causinghandleNewThreadto be recreated on every render and defeating the purpose ofuseCallback. Consumers that depend onhandleNewThreadbeing stable (e.g., in effect dependencies or child component memoization) will see unnecessary re-renders or potentially infinite update loops.
In file apps/web/src/components/Sidebar.tsx around lines 2689-2692:
The inline selector at lines 2689-2692 creates a new object reference on every render. Since `useSettings` includes the `selector` function in its `useMemo` dependency array, `projectGroupingSettings` becomes a new reference each render. This causes the `useMemo` hooks at lines 2729-2734 and 2746-2763 to recompute unnecessarily, defeating memoization. Consider extracting the selector to a stable reference with `useCallback` or defining it outside the component.
Evidence trail:
apps/web/src/components/Sidebar.tsx lines 2689-2692 (inline selector), lines ~2729-2734 (physicalToLogicalKey useMemo with projectGroupingSettings dependency), lines ~2746-2763 (sidebarProjects useMemo with projectGroupingSettings dependency) at REVIEWED_COMMIT; apps/web/src/hooks/useSettings.ts line 141 shows `return useMemo(() => (selector ? selector(merged) : (merged as T)), [merged, selector]);` - the selector is in the dependency array at REVIEWED_COMMIT.
Also found in 1 other location(s):
- apps/web/src/hooks/useHandleNewThread.ts:22 -- The inline selector arrow function passed to `useSettings` creates a new function reference on every render. Since `useSettings` uses `useMemo` with the `selector` in its dependency array, `projectGroupingSettings` will be a new object reference on every render even when the values haven't changed. This object is included in the `useCallback` dependency array at line 137, causing `handleNewThread` to be recreated on every render and defeating the purpose of `useCallback`. Consumers that depend on `handleNewThread` being stable (e.g., in effect dependencies or child component memoization) will see unnecessary re-renders or potentially infinite update loops.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Extended this a bit to solve #1912 as well: CleanShot.2026-04-16.at.00.01.22.mp4Can you verify that it still solves your problem? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Can confirm this would fix the issue |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@tlh38 I've tried out this MR's build and can verify it fixes the issue I was having on #1922. Thanks! Just a nit - what's the difference between the "Group by repository" and "Group by repository path"? "Group by repository" makes sense but "Group by repository path" is a bit confusing: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Group by repo path is useful if you work on monorepos and wanna have separate projects for subdirectories (e.g. frontend, backend) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const projectGroupingSettings = useSettings((settings) => ({ | ||
| sidebarProjectGroupingMode: settings.sidebarProjectGroupingMode, | ||
| sidebarProjectGroupingOverrides: settings.sidebarProjectGroupingOverrides, | ||
| })); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
useSettings defeat memoizationMedium Severity
The useSettings hook depends on [merged, selector] in its final useMemo. Since the selector is an inline arrow function returning a new object, it's a new reference every render, so the useMemo re-runs and produces a new object every time. The resulting projectGroupingSettings object is then used as a dependency in downstream useMemo/useCallback hooks, defeating their memoization entirely. In useHandleNewThread, this causes handleNewThread to be recreated every render, cascading invalidations through the sidebar. Existing callers of useSettings use primitive-returning selectors where this is harmless; the new object-returning pattern is uniquely problematic.
Reviewed by Cursor Bugbot for commit 616b074. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- Return `null` when no saved or runtime label exists - Avoid showing raw environment IDs in the sidebar
- derive logical project keys when expanding bootstrap projects - map Claude Opus 4.7 xhigh effort to the SDK max value - normalize repository root assertions for nested worktrees Co-authored-by: codex <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2497af2. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| return mapping; | ||
| }, [orderedProjects]); | ||
| return buildPhysicalToLogicalProjectKeyMap({ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
High Severity
syncProjectUiFromStore in service.ts now stores keys in projectOrder using derivePhysicalProjectKey (format ${environmentId}:${normalizedCwd}), but orderItemsByPreferredIds in Sidebar.tsx still matches projects using scopedProjectKey(scopeProjectRef(...)) (format ${environmentId}:${projectId}). These are completely different string formats, so the preferred order lookup never matches any project, and manual project sorting is silently broken.
Reviewed by Cursor Bugbot for commit 2497af2. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I was literally about to implement this 😄 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Integrates upstream/main (9df3c64) on top of fork's main (9602c18). Upstream features adopted: - Claude Opus 4.5 and 4.7 built-in models (pingdotgg#2072, pingdotgg#2143) - Node-native TypeScript migration across desktop/server (pingdotgg#2098) - Configurable project grouping with client-settings overrides (pingdotgg#2055, pingdotgg#2099) - Thread status in command palette (pingdotgg#2107) - Responsive composer / plan sidebar on narrow windows (pingdotgg#1198) - Capture-phase CTRL+J keydown for Windows terminal toggle (pingdotgg#2113/pingdotgg#2142) - Bypass xterm for global terminal shortcuts (pingdotgg#1580) - Windows ARM build target (pingdotgg#2080) - Windows PATH hydration + repair (pingdotgg#1729) - Gitignore-aware workspace search (pingdotgg#2078) - Claude process leak fix + stale session monitoring (pingdotgg#2042) - Preserve provider bindings when stopping sessions (pingdotgg#2084) - Clean up invalid pending-approval projections (pingdotgg#2106) — new migration - Extract backend startup readiness coordination - Drop stale text-gen options on reset (pingdotgg#2076) - Extend negative repository identity cache TTL (pingdotgg#2083) - Allow deleting non-empty projects from warning toast (pingdotgg#1264) - Restore defaults only on General settings (pingdotgg#1710) - Release workflow modernization (blacksmith runners, GitHub App token guards, v0.0.20 version bump) Fork features preserved: - All 8 providers (codex, claudeAgent, copilot, cursor, opencode, geminiCli, amp, kilo) with their adapters, services, and tests - Fork's custom OpenCode protocol impl in apps/server/src/opencode/ (kept over upstream's @opencode-ai/sdk-based provider added in pingdotgg#1758 — fork's version is tested and integrated; upstream's parallel files deleted) - Fork's direct-CLI Cursor adapter (kept over upstream's new ACP-based CursorProvider added in pingdotgg#1355 — upstream's parallel files deleted) - Fork's ProviderRegistry aggregates only codex + claudeAgent snapshots; the other 6 providers register via ProviderAdapterRegistry - PROVIDER_CACHE_IDS stays at [codex, claudeAgent] matching what the registry actually caches - Migration IDs preserved (fork 23/24/25/26; upstream's new 025 lands at ID 27 to avoid re-applying on deployed fork DBs) - Fork's generic per-provider settings (enabled/binaryPath/configDir/ customModels) kept over upstream's opencode-specific serverUrl/password - Log directory IPC channels, updateInstallInFlight tracking, icon composer pipeline all preserved - Fork's simplified release.yml (no npm CLI publish, no nightly infra) - composerDraftStore normalizeProviderKind widened to accept all 8 kinds - Dark mode --background set to #0f0f0f Test status: - All 9 package typechecks pass - Lint clean (0 errors) - Tests: 1877 passed, 15 skipped (incl. 4 historically-flaky GitManager cross-repo PR selector tests newly gated with TODO for Node-native-TS follow-up)
pingdotgg#2055 silently regressed two sidebar behaviors by changing how projects are keyed in `uiStateStore`: - Manual-sort drag reorder snapped projects back to their original position. Writers populated `projectOrder` with physical keys (env + cwd) but readers matched items by scoped keys (env + project id), so `preferredIds` never matched and manual order was discarded. - Expand/collapse state was wiped whenever projects were grouped (grouping != `separate`), because `syncProjects` seeded `projectExpandedById` by physical key while the UI read and wrote it by logical (group) key. Route readers and writers through a single source of truth: - `getProjectOrderKey` centralizes the physical-key derivation used by `projectOrder` so future callers cannot silently drift again. - `SyncProjectInput` now carries both a physical `key` (sort order) and a `logicalKey` (expand/collapse). `syncProjects` keys `projectExpandedById` by `logicalKey`, and persistence tracks the member cwds per group so localStorage hydration still works for grouped projects.
pingdotgg#2055 silently regressed two sidebar behaviors by changing how projects are keyed in `uiStateStore`: - Manual-sort drag reorder snapped projects back to their original position. Writers populated `projectOrder` with physical keys (env + cwd) but readers matched items by scoped keys (env + project id), so `preferredIds` never matched and manual order was discarded. - Expand/collapse state was wiped whenever projects were grouped (grouping != `separate`), because `syncProjects` seeded `projectExpandedById` by physical key while the UI read and wrote it by logical (group) key. Route readers and writers through a single source of truth: - `getProjectOrderKey` centralizes the physical-key derivation used by `projectOrder` so future callers cannot silently drift again. - `SyncProjectInput` now carries both a physical `key` (sort order) and a `logicalKey` (expand/collapse). `syncProjects` keys `projectExpandedById` by `logicalKey`, and persistence tracks the member cwds per group so localStorage hydration still works for grouped projects.
Brings in upstream changes since d22c6f5: - Claude Opus 4.5 built-in model (pingdotgg#2143) - Claude Opus 4.7 built-in model (pingdotgg#2072) - opencode provider support (pingdotgg#1758) - Claude process leak fix & session reaper (pingdotgg#2042) - Configurable project grouping (pingdotgg#2055) - Node-native TypeScript for desktop/server (pingdotgg#2098) - Clean up invalid pending approval projections (pingdotgg#2106) - Thread status in command palette (pingdotgg#2107) - Backend startup readiness coordination (pingdotgg#2133) - Preserve provider bindings on session stop (pingdotgg#2125) - Allow deleting non-empty projects (pingdotgg#1264) - Various Windows fixes and CI improvements Conflict resolutions: - model.ts: kept claudeAgent opus-4-7 default, added opencode entry - settings.ts: adopted upstream sidebarProjectGroupingMode/Overrides - ClaudeProvider.ts: adopted upstream Opus 4.7 effort config - Sidebar.tsx: adopted upstream project grouping approach - package.json: kept custom desktop-only build filter Co-Authored-By: Claude Opus 4.6 <[email protected]>
…ct-grouping feat(sidebar): configurable project grouping (port upstream pingdotgg#2055)
Co-authored-by: tlh38 <[email protected]> Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: codex <[email protected]>
Co-authored-by: tlh38 <[email protected]> Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: codex <[email protected]>
Co-authored-by: tlh38 <[email protected]> Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: codex <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[Bug]: Nested Projects Overlap in Monorepo feat: configurable logical project keying
There was an error while loading. Please reload this page.