Repository navigation
feat: team settings, issue copy actions, and a visible delete - #171
Conversation
Teams could only be renamed or archived from one long list under workspace settings, nothing in the sidebar led there, and an archived team could never be brought back because the UI had no restore at all. Add restoreTeam alongside archiveTeam, a POST /api/teams/:id/restore to reach it, and a per team settings page holding the name, description, membership, and an archive that asks first and can be undone. Each team in the sidebar gets a menu pointing at its own page. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdded team settings and restoration flows, issue copy and deletion actions, quick-create estimates, shared issue prompt formatting, UI integrations, test coverage, and Next.js agent guidance. ChangesTeam management
Issue workflows
Web development guidance
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (3)
apps/web/src/features/issues/issue-copy-actions.tsx (1)
14-15: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the shared public URL contract.
The local
issueUrlhelper bypassesabsoluteUrl(). This bypasses centralized validation and normalization. Update its tests with the same contract.
apps/web/src/features/issues/issue-copy-actions.tsx#L14-L15: replace manual origin concatenation withabsoluteUrl()from@/lib/env.ts.apps/web/tests/features/issues/issue-copy-actions.test.tsx#L120-L132: update URL expectations for the configured normalized public URL.Based on learnings and coding guidelines, build public absolute URLs with
absoluteUrl(path).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/src/features/issues/issue-copy-actions.tsx` around lines 14 - 15, Update issueUrl in apps/web/src/features/issues/issue-copy-actions.tsx#L14-L15 to build the issue path through absoluteUrl() from `@/lib/env.ts`, removing manual origin concatenation while preserving the /issue/{identifier} path. Update the URL expectations in apps/web/tests/features/issues/issue-copy-actions.test.tsx#L120-L132 to assert the configured normalized public URL.Sources: Coding guidelines, Learnings
packages/core/tests/org/team-service.test.ts (1)
95-102: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winTest the issue-preservation contract.
This test only verifies that the team row remains. It passes if archiving deletes or detaches every issue. Create an issue for
team, archive the team, then assert that the issue remains with its originalteamId.As per coding guidelines, "A feature is incomplete until it has tests that would fail if the feature broke."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/core/tests/org/team-service.test.ts` around lines 95 - 102, Add an issue for the created team in the “leaves the issues of an archived team where they are” test before archiving, then query that issue afterward and assert it still exists with its original teamId. Keep the existing archived team row assertions unchanged.Source: Coding guidelines
apps/web/tests/features/settings/team-settings-panel.test.tsx (1)
75-84: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the member identifier in the POST request.
The recorder only checks the URL and method. This test passes if
toggleMembershipsends an empty or incorrect request body. Captureinit.bodyand assert that the POST payload containsuserId: 'user_2'.As per coding guidelines, "A feature is incomplete until it has tests that would fail if the feature broke."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/tests/features/settings/team-settings-panel.test.tsx` around lines 75 - 84, Update the test case around toggleMembership to capture the POST request init.body and assert that the payload includes userId: 'user_2', while preserving the existing URL and method assertions. Ensure the test would fail if the member identifier were omitted or incorrect.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/web/src/app/api/teams/`[id]/restore/route.ts:
- Around line 8-15: Validate the awaited route params with the appropriate Zod
schema from `@orbit/shared`, extract the validated id, and only then call
restoreTeam in POST. Preserve the existing restore, publish, and response flow
while ensuring malformed path input is rejected at the route validation
boundary.
In `@apps/web/src/components/layout/sidebar-team.tsx`:
- Around line 161-167: Update the team settings Link in the sidebar to use the
same conditional onClick/onNavigate callback pattern as the existing team and
child links, ensuring mobile sidebar closure runs before navigation.
In `@apps/web/src/features/issues/issue-properties.tsx`:
- Around line 331-357: Thread the detail exit callback through IssueProperties
into DeleteIssueRow, accepting an optional leave callback and passing it as
onDeleted to deletion.request. Update the IssueDetailView call site to provide
leave, and add a regression test verifying the callback runs after deletion
confirmation.
---
Nitpick comments:
In `@apps/web/src/features/issues/issue-copy-actions.tsx`:
- Around line 14-15: Update issueUrl in
apps/web/src/features/issues/issue-copy-actions.tsx#L14-L15 to build the issue
path through absoluteUrl() from `@/lib/env.ts`, removing manual origin
concatenation while preserving the /issue/{identifier} path. Update the URL
expectations in
apps/web/tests/features/issues/issue-copy-actions.test.tsx#L120-L132 to assert
the configured normalized public URL.
In `@apps/web/tests/features/settings/team-settings-panel.test.tsx`:
- Around line 75-84: Update the test case around toggleMembership to capture the
POST request init.body and assert that the payload includes userId: 'user_2',
while preserving the existing URL and method assertions. Ensure the test would
fail if the member identifier were omitted or incorrect.
In `@packages/core/tests/org/team-service.test.ts`:
- Around line 95-102: Add an issue for the created team in the “leaves the
issues of an archived team where they are” test before archiving, then query
that issue afterward and assert it still exists with its original teamId. Keep
the existing archived team row assertions unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 1a65148c-864e-4ec1-b396-95c6c858a61a
📒 Files selected for processing (23)
apps/web/AGENTS.mdapps/web/CLAUDE.mdapps/web/src/app/(app)/team/[key]/settings/page.tsxapps/web/src/app/api/teams/[id]/restore/route.tsapps/web/src/components/layout/sidebar-team.tsxapps/web/src/features/issues/issue-copy-actions.tsxapps/web/src/features/issues/issue-detail.tsxapps/web/src/features/issues/issue-properties.tsxapps/web/src/features/issues/quick-create.tsxapps/web/src/features/settings/team-settings-panel.tsxapps/web/tests/components/layout/sidebar.test.tsxapps/web/tests/features/issues/board.test.tsxapps/web/tests/features/issues/issue-copy-actions.test.tsxapps/web/tests/features/issues/issue-detail-delete.test.tsxapps/web/tests/features/issues/issue-list.test.tsxapps/web/tests/features/issues/issue-properties.test.tsxapps/web/tests/features/issues/my-issues-view.test.tsxapps/web/tests/features/issues/quick-create.test.tsxapps/web/tests/features/settings/team-settings-panel.test.tsxpackages/core/src/org/team-service.tspackages/core/tests/org/team-service.test.tspackages/shared/src/utils/index.tspackages/shared/tests/utils/issue-prompt.test.ts
# Conflicts: # apps/web/src/features/issues/quick-create.tsx
Deleting from the new properties row left the detail page or the peek open on an issue that no longer exists, because it dropped the onDeleted callback the header and the shortcut both pass. Archiving a team from its own settings page then removed the only route back to the restore control, so the workspace team list now links to each team's settings, archived ones included. Also validate the id on the restore route and run the sidebar navigation callback when the settings link is followed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Teams
Teams could only be renamed or archived from one long list in workspace settings, nothing in the sidebar led there, and an archived team could never be brought back because the UI had no restore at all. Archiving was a one way door.
restoreTeamin core, mirroringarchiveTeam, reachable atPOST /api/teams/:id/restore/team/[key]/settings: name, description, membership, and an archive that asks first and can be undoneArchive stays a soft delete. Nothing destroys a team or its issues.
Issue copy actions
Four icon actions in the issue detail header, matching what people expect from a tracker wired to git:
https://orbit.noveum.ai/issue/ENG-42ENG-42shashank/eng-42-fan-out-delta-packetsissuePromptlives in@orbit/shared/utilsnext tobranchName, so the MCP server can use the same format. Every value is XML escaped, so a crafted title cannot forge a tag. Fields the issue does not have are left out rather than emitted empty.Create dialog
The dialog hardcoded
estimate: null, so effort could only be set after the issue existed. It now has an Estimate control alongside the others, and creates with it.Delete
Delete was reachable only from the three dot menu. It now also sits at the bottom of the properties panel, below Sprint, still gated on
issue:deleteand still confirming first.Tests
bun run verifygreen. New coverage:issuePromptformatting and escaping (6), the copy toolbar including the clipboard being refused (9), the team settings panel (5), archive and restore round trip in core against Postgres (4), the sidebar team menu (2), estimate on create (2), the delete row (2).Four existing test harnesses render the issue detail and were missing
TooltipProvider, which the app mounts globally inproviders.tsx. Added there rather than dropping the shared Tooltip.🤖 Generated with Claude Code
Greptile Summary
The update completes both previously requested fixes.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Reviews (2): Last reviewed commit: "fix: close the surface after a delete an..." | Re-trigger Greptile