upstream 取り込み PR #11: use task title as workspace name (#3678)#414
upstream 取り込み PR #11: use task title as workspace name (#3678)#414
Conversation
…uperset-sh#3678) The branch still uses deriveBranchName({slug, title}) so the Linear/GitHub identifier stays in the branch for traceability; only the displayed workspace name switches from e.g. "SUPER-172" to the human-readable title.
📝 WalkthroughWalkthroughワークスペース作成フローにおいて、2つのコンポーネントで Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 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: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/`$taskId/components/PropertiesSidebar/components/OpenInWorkspace/OpenInWorkspace.tsx:
- Line 124: task.title is used directly as the workspace name when calling
createWorkspace.mutateAsyncWithPendingSetup; add input validation/sanitization
before passing name: ensure task.title is not empty or whitespace-only, trim it,
enforce a reasonable max length, and remove or replace
filesystem/URL/UI-problematic characters (e.g. '/', '\', newlines) or fall back
to task.slug if sanitized title is invalid; keep deriveBranchName({ slug, title
}) behavior and wasExisting/worktreeId logic unchanged, and ensure the sanitized
value is what you pass to createWorkspace.mutateAsyncWithPendingSetup as the
name parameter.
🪄 Autofix (Beta)
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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1b7c5884-0b44-4c1a-a05c-178eb1c3851f
📒 Files selected for processing (2)
apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/$taskId/components/PropertiesSidebar/components/OpenInWorkspace/OpenInWorkspace.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/components/TasksView/components/TasksTopBar/components/RunInWorkspacePopover/RunInWorkspacePopover.tsx
| { | ||
| projectId, | ||
| name: task.slug, | ||
| name: task.title, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# useCreateWorkspace と mutateAsyncWithPendingSetup の実装を確認し、
# name のバリデーション/サニタイズ、および wasExisting 判定のキーを特定する
fd -t f 'workspaces' apps/desktop/src/renderer/react-query
rg -nP -C5 'mutateAsyncWithPendingSetup|wasExisting' --type=ts --type=tsx
rg -nP -C3 '\bname\b.*(trim|slice|sanitize|length)' --type=ts --type=tsx -g '!**/node_modules/**'Repository: MocA-Love/superset
Length of output: 453
🏁 Script executed:
#!/bin/bash
# Find useCreateWorkspace hook and related mutations
echo "=== Finding workspace-related hooks ==="
find apps/desktop/src/renderer/react-query/workspaces -type f -name "*.ts" -o -name "*.tsx" | head -20
echo -e "\n=== Searching for useCreateWorkspace ==="
rg 'useCreateWorkspace|mutateAsyncWithPendingSetup' -t ts -t tsx apps/desktop/src/renderer
echo -e "\n=== Searching for wasExisting ==="
rg 'wasExisting' -t ts -t tsx apps/desktop/src/renderer -C 3
echo -e "\n=== Checking OpenInWorkspace.tsx ==="
find apps/desktop/src/renderer -name 'OpenInWorkspace.tsx' -exec head -150 {} \;Repository: MocA-Love/superset
Length of output: 6626
🏁 Script executed:
#!/bin/bash
echo "=== Reading useCreateWorkspace.ts ==="
wc -l apps/desktop/src/renderer/react-query/workspaces/useCreateWorkspace.ts
echo -e "\n=== Full content ==="
cat -n apps/desktop/src/renderer/react-query/workspaces/useCreateWorkspace.ts
echo -e "\n=== Searching for workspace creation/validation in src/lib ==="
find apps/desktop/src/lib -type f \( -name "*.ts" -o -name "*.tsx" \) | xargs grep -l "wasExisting\|workspace" | head -10Repository: MocA-Love/superset
Length of output: 6812
🏁 Script executed:
#!/bin/bash
echo "=== Finding workspaces tRPC router ==="
find apps/desktop/src/lib/trpc -type f -name "*workspace*"
echo -e "\n=== Searching for workspaces router directory ==="
ls -la apps/desktop/src/lib/trpc/routers/ | grep -i workspace
echo -e "\n=== Check main index for workspaces ==="
grep -n "workspaces" apps/desktop/src/lib/trpc/index.tsRepository: MocA-Love/superset
Length of output: 1039
🏁 Script executed:
#!/bin/bash
echo "=== Reading workspaces.ts ==="
wc -l apps/desktop/src/lib/trpc/routers/workspaces/workspaces.ts
echo -e "\n=== First 200 lines of workspaces.ts ==="
head -200 apps/desktop/src/lib/trpc/routers/workspaces/workspaces.ts
echo -e "\n=== Reading workspace-creation.ts ==="
wc -l apps/desktop/src/lib/trpc/routers/workspaces/utils/workspace-creation.ts
cat -n apps/desktop/src/lib/trpc/routers/workspaces/utils/workspace-creation.tsRepository: MocA-Love/superset
Length of output: 15863
🏁 Script executed:
#!/bin/bash
echo "=== Reading create procedures ==="
wc -l apps/desktop/src/lib/trpc/routers/workspaces/procedures/create.ts
head -300 apps/desktop/src/lib/trpc/routers/workspaces/procedures/create.ts
echo -e "\n=== Reading workspace-auto-rename.ts ==="
cat -n apps/desktop/src/lib/trpc/routers/workspaces/utils/workspace-auto-rename.tsRepository: MocA-Love/superset
Length of output: 9201
🏁 Script executed:
#!/bin/bash
echo "=== Checking for name validation in workspace schema/types ==="
find packages/db/src -type f -name "*.ts" | xargs grep -l "workspace" | head -5
echo -e "\n=== Checking workspace table schema ==="
rg "export const workspaces|workspace.*schema" packages/db/src -t ts -A 10 | head -50Repository: MocA-Love/superset
Length of output: 1760
task.title をワークスペース名として使用する際の検証を確認してください。
task.slug(例: SUPER-172)から task.title への変更により、以下の観点で考慮が必要です:
task.titleが空文字や空白のみの場合のハンドリング- 非常に長いタイトルやファイルシステム/UI で問題となる文字(
/,\, 改行など)の検証またはサニタイズ
createWorkspace.mutateAsyncWithPendingSetup の実装を確認したところ、name パラメータは検証なくそのままデータベースに挿入されています。現在、テキスト長の制限や特殊文字の事前チェックがないため、入力側での適切なサニタイズまたはバリデーションレイヤーの追加を検討してください。
なお、wasExisting 判定は worktreeId に基づいているため、タイトルの一意性が問題になることはありません。branchName は引き続き deriveBranchName({ slug, title }) で識別子を含むため、追跡性は保たれています。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/`$taskId/components/PropertiesSidebar/components/OpenInWorkspace/OpenInWorkspace.tsx
at line 124, task.title is used directly as the workspace name when calling
createWorkspace.mutateAsyncWithPendingSetup; add input validation/sanitization
before passing name: ensure task.title is not empty or whitespace-only, trim it,
enforce a reasonable max length, and remove or replace
filesystem/URL/UI-problematic characters (e.g. '/', '\', newlines) or fall back
to task.slug if sanitized title is invalid; keep deriveBranchName({ slug, title
}) behavior and wasExisting/worktreeId logic unchanged, and ensure the sanitized
value is what you pass to createWorkspace.mutateAsyncWithPendingSetup as the
name parameter.
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
upstream
#3678を軽量取り込み。1 commit / 2 files / +2 / -2 の最小変更。取り込み内容
5611677d4fix(desktop): use task title as workspace name when opening a task (fix(desktop): use task title as workspace name when opening a task superset-sh/superset#3678)変更詳細
task を workspace として開く際の workspace name を、Linear/GitHub 識別子 (例: "SUPER-172") から人間向けタイトルに切り替え。branch 名は
deriveBranchName({slug, title})のまま維持され、Linear/GitHub 識別子はトレーサビリティのため branch 側で保たれる。変更ファイル:
apps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/$taskId/components/PropertiesSidebar/components/OpenInWorkspace/OpenInWorkspace.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/tasks/$taskId/components/RunInWorkspacePopover/RunInWorkspacePopover.tsxコンフリクト解消
なし (clean cherry-pick)。
Fork 固有機能ヘルスチェック
本 PR は task UI の naming のみ変更。fork 固有機能 (19 procedure, TERMINAL_OPTIONS, SUPERSET_WORKSPACE_NAME, dmg.size, 依存, TiptapPromptEditor, v1MigrationState) には触れず、影響なし。
Test plan
bun install正常完了bun run typecheckグリーン (27/27)bun run lintグリーンslug/title形式残 upstream 取り込み
本 PR で計画 scope は実質完了。残る真の未取り込みは
#3697 split workspace-creation routerの 1 件のみ。これは fork 独自拡張 (baseBranchSource / PR checkout / fork note) と全面衝突する大規模 refactor で、別 refactor PR として別途対応予定。Summary by CodeRabbit
リリースノート