Skip to content

feat(app): link verified projects locally - #4052

Closed
michaelmwu wants to merge 6 commits into
getpaseo:mainfrom
michaelmwu:add-project-linking-dialog-duplicate-git-repos
Closed

feat(app): link verified projects locally#4052
michaelmwu wants to merge 6 commits into
getpaseo:mainfrom
michaelmwu:add-project-linking-dialog-duplicate-git-repos

Conversation

@michaelmwu

Copy link
Copy Markdown
Contributor

Summary

  • add device-local manual links for projects that verify to the same normalized Git remote and project subdirectory
  • show host, local path, and remote details before linking; links do not move workspaces, settings, or files and can be unlinked later
  • keep saved links reachable for review and unlinking when a linked project is temporarily unavailable on its host

Validation

  • npx vitest run --config vitest.config.ts src/screens/projects-screen.test.tsx src/projects/local-project-links.test.ts src/projects/workspace-structure.test.ts src/hooks/use-projects.test.ts src/i18n/resources.test.ts --bail=1 (62 passed)
  • npm run lint
  • npm run typecheck
  • PLAYWRIGHT_BROWSERS_PATH=/tmp/paseo-playwright-browsers npm run test:e2e --workspace=@getpaseo/app -- e2e/browser/sidebar-project-grouping.spec.ts --grep 'reviews and unlinks a device-local cross-host project link|keeps saved project links reachable after their host project is removed' (2 passed; isolated daemons)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 30, 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-07T20:16:35.040316Z fe4288e New commits
ℹ️ 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.

@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: b566b72be4

ℹ️ 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 thread packages/app/src/projects/local-project-links.ts Outdated

@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: a2d0c6d59f

ℹ️ 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 thread packages/app/src/projects/local-project-links.ts Outdated
Comment thread packages/app/src/projects/local-project-links.ts Outdated
@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds device-local links for projects verified to share a normalized Git remote and subdirectory.

  • Persists and validates local project-link membership.
  • Integrates verified links into workspace and sidebar project grouping.
  • Adds review and unlink UI, translations, documentation, unit coverage, and browser scenarios.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/app/src/projects/local-project-links.ts Defines Git identity normalization, link validation, suggestions, and conservative grouping overrides.
packages/app/src/projects/workspace-structure.ts Integrates validated local links into the canonical grouped-project projection.
packages/app/src/hooks/use-projects.ts Supplies hydration state, stored links, placements, and suggestions to project derivation.
packages/app/src/projects/local-project-links-store.ts Adds validated device-local persistence and link/unlink actions.
packages/app/src/components/project-links-sheet.tsx Adds the project-link review, confirmation, unavailable-member, and unlink interface.
packages/app/e2e/browser/sidebar-project-grouping.spec.ts Covers reviewing, unlinking, and retaining access to saved links when a project disappears.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Host project and workspace snapshots] --> B[Resolve normalized Git identity]
  B --> C{Same remote and subdirectory?}
  C -- Yes --> D[Offer device-local link]
  D --> E[Persist link locally]
  E --> F{All members present and verified?}
  F -- Yes --> G[Apply linked grouping override]
  F -- No --> H[Defer or block override for review]
  H --> I[Keep saved link available for unlinking]
Loading

Reviews (3): Last reviewed commit: "test(app): cover linked hosts omitted du..." | Re-trigger Greptile

Comment thread packages/app/src/projects/local-project-links.ts
Comment thread packages/app/e2e/browser/sidebar-project-grouping.spec.ts Outdated
@michaelmwu
michaelmwu force-pushed the add-project-linking-dialog-duplicate-git-repos branch from 8c7fd4d to d8338c6 Compare September 5, 2026 20:11
Comment thread packages/app/src/projects/local-project-links.ts Outdated

@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: d8338c6b8e

ℹ️ 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 thread packages/app/src/stores/session-store-hooks/selectors.ts

@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: 3442c65d2e

ℹ️ 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 +149 to +152
projectLinkSuggestions: buildProjectLinkSuggestions({
placements: projectLinkPlacements,
links: localProjectLinks,
}),

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 Exclude unhydrated replicas from link suggestions

When a host still has an unhydrated cached directory, its cached Git identity is included in projectLinkPlacements and passed directly to the suggestion builder, even though the same function already identifies that host as unhydrated for grouping. Because ProjectsScreen renders cached projects while loading, the user can accept a purportedly Git-verified suggestion based on stale remote or subdirectory facts; after hydration, the newly persisted link can immediately become invalid or may have linked the wrong projects. Gate suggestions until every participating replica is hydrated, or exclude unhydrated placements from suggestion generation.

Useful? React with 👍 / 👎.

Comment on lines +18 to +19
serverId: z.string().trim().min(1),
projectId: z.string().trim().min(1),

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 opaque member IDs verbatim

When a compatibility project has a path-shaped opaque projectId containing leading or trailing whitespace—for example, a valid POSIX project root ending in a space—these .trim() transforms rewrite its identity during persistence; normalizeMembers also performs the same rewrite at link creation. The saved member then cannot match the exact (serverId, projectId) placement, so a newly accepted link is immediately treated as invalid and never groups. Validate non-emptiness without altering these opaque IDs.

Useful? React with 👍 / 👎.

@michaelmwu
michaelmwu force-pushed the add-project-linking-dialog-duplicate-git-repos branch from 3442c65 to fe4288e Compare September 7, 2026 20:11

@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: fe4288ea91

ℹ️ 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 +457 to +459
link.members.some((member) => unhydratedServerIds.has(member.serverId)) ||
memberKeys.some((memberKey) => !placementsByKey.has(memberKey))
) {

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 Distinguish deleted members from omitted hosts

When every participating host is hydrated and a linked project has actually been deleted, this branch treats the missing placement like a temporarily omitted host and skips all overrides. The surviving member can then fall back to automatic projectKey grouping with another placement, contradicting the new data-model contract that a missing Git fact disables the saved link rather than silently regrouping it. Defer only for omitted or unhydrated hosts; for an authoritative deletion, keep the present members blocked until the link is reviewed.

Useful? React with 👍 / 👎.

Comment on lines +593 to +594
let value = input.trim().replaceAll("\\", "/");
if (!value) return null;

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 trailing whitespace in project paths

On POSIX hosts, trailing spaces are valid filename characters, but trimming the complete path rewrites /repos/app/pkg to /repos/app/pkg. Thus a project rooted in pkg and one rooted in pkg can derive the same supposedly verified subdirectory identity and be offered for linking even though they select different directories. Check for an empty input without removing whitespace from filesystem path segments.

Useful? React with 👍 / 👎.

@boudra

boudra commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Closing this feature PR. Please discuss the workflow and shared need in Discussions, following CONTRIBUTING.md.

@boudra boudra closed this Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants