Skip to content

🤖 refactor: align sub-project creation scope#3266

Open
ammar-agent wants to merge 6 commits into
mainfrom
refactor-subproject-consistency
Open

🤖 refactor: align sub-project creation scope#3266
ammar-agent wants to merge 6 commits into
mainfrom
refactor-subproject-consistency

Conversation

@ammar-agent
Copy link
Copy Markdown
Collaborator

Summary

Audit and prune sub-project-specific divergence so creation, defaults, command actions, and backend APIs use the same parent-owned workspace model. Sub-projects remain as UI/cwd sections, while shared workspace settings and top-level project actions now consistently resolve to the parent project.

Background

Sub-project workspaces share the parent checkout and store the child context in subProjectPath. Several entry points had grown bespoke handling that either dropped the child context, treated children as standalone top-level projects, or exposed unsupported sub-project behavior.

Implementation

  • Added shared sub-project helpers for top-level project filtering and workspace creation scope resolution.
  • Reused that scope resolution in new-chat/draft/deep-link/start-creation flows so sub-project creation stores parent-scoped settings while preserving child context.
  • Updated command palette selected-workspace creation and startup new-chat fallback to preserve sub-project context.
  • Removed the no-op sub-project section drag/reorder affordance.
  • Filtered unsupported top-level-only pickers (multi-project creation, archive merged, project secrets) to parent projects.
  • Normalized assignWorkspaceToSubProject so backend callers can pass either the parent or current sub-project path.
  • Made file completions work for subdirectories inside a parent git repo, matching branch discovery.

Validation

  • bun test src/common/utils/subProjects.test.ts src/browser/hooks/useStartWorkspaceCreation.test.ts src/browser/utils/commands/sources.test.ts src/browser/contexts/ProjectContext.test.tsx src/node/services/projectService.test.ts
  • make typecheck
  • make lint
  • make static-check

Risks

Moderate: this touches shared project routing and creation scope logic. The intended behavior change is to stop treating sub-projects as standalone owners outside the narrow UI/cwd cases. Parent-level project pickers now hide sub-projects where the backend/runtime only supports parent project semantics.


Generated with mux • Model: openai:gpt-5.5 • Thinking: high • Cost: $unknown

@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

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

@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

Final pass after three adversarial code-quality critique rounds. The follow-up commits only reduce indirection and redundant code while preserving the PR behavior.

Copy link
Copy Markdown

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

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: 897f0dcd8a

ℹ️ 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 src/browser/utils/commands/sources.ts
@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the shortcut parity finding: Ctrl+N now uses the selected workspace metadata subProjectPath just like the command palette action.

Copy link
Copy Markdown

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

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: 28b128625d

ℹ️ 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 src/browser/components/ProjectSidebar/ProjectSidebar.tsx Outdated
@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the live-metadata follow-up: Ctrl+N now derives the sub-project from the current sidebar metadata rather than the imperative store.

Copy link
Copy Markdown

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

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: 66fa1eddf8

ℹ️ 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 src/browser/features/Settings/Sections/SecretsSection.tsx Outdated
@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the SecretsSection stale-path regression by requiring the project config to exist before accepting a project-scoped secrets target.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

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

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.

1 participant