Skip to content

upstream取り込み: v2 sidebar section count fix (#3544)#315

Merged
MocA-Love merged 1 commit intomainfrom
upstream-merge/pr8-sidebar-section-count
Apr 18, 2026
Merged

upstream取り込み: v2 sidebar section count fix (#3544)#315
MocA-Love merged 1 commit intomainfrom
upstream-merge/pr8-sidebar-section-count

Conversation

@MocA-Love
Copy link
Copy Markdown
Owner

@MocA-Love MocA-Love commented Apr 18, 2026

概要

upstream から v2 sidebar の section count 表示 fix を取り込む PR。behind 2 → 1(残り 867ef87 は別 PR で手動移植)。

取り込み commit

SHA 内容 分類
1979f4cae fix(desktop): v2 sidebar section count reflects visually grouped workspaces (superset-sh#3544) — 1 file, +23/-1 確実に安全(clean cherry-pick)

fork 適応修正

なし。useDashboardSidebarData.ts への clean apply。

検証

  • typecheck: 全 26 タスク pass
  • lint: 3件 baseline(regression なし)

Codex pre-review

Yes(fork衝突低、git apply --check clean)。

テストチェックリスト

  • v2 sidebar で section にグループ化された workspace が section count に正しく反映されるか

Summary by CodeRabbit

リリースノート

  • リファクタリング
    • ダッシュボードサイドバーの項目の整理構造を改善しました。セクション配下のワークスペースのグループ化と配色処理を最適化しています。

…spaces (superset-sh#3544)

Ungrouped workspaces that render after a section header are already
visually grouped with that section (shared accent color, collapse
together) and get committed into it on next drag. The count, however,
was reading section.workspaces which only included workspaces whose DB
sectionId already matched — so a freshly created section showed "(0)"
while the user sees N workspaces beneath it.

Reparent those workspaces into section.workspaces in the data layer so
the count matches the visual grouping and DnD commit behavior.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

📝 Walkthrough

Walkthrough

useDashboardSidebarData関数が子要素の処理ロジックを変更。ソート後のchildEntriesに対して、「section」ヘッダーの後に続く「workspace」型の子要素を、その先行するセクションに再配置し、ワークスペースのアクセントカラーをセクションの色で上書きします。

Changes

コホート / ファイル 変更内容
ダッシュボードサイドバーデータロジック
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarData/useDashboardSidebarData.ts
子要素の導出ロジックを変更。「section」ヘッダーの後に続くワークスペース要素を先行するセクション内に再構成し、アクセントカラーをセクションの色で統一。ソート後のchildEntriesの組み替えロジックを追加。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 セクションの子らを整列し
ワークスペースを色で統める
サイドバーの階層、今ここに
美しく再び並び直す ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning 提供されたテンプレートの必須セクション(Description、Related Issues、Type of Change、Testing)のいくつかが欠けている。実際の PR 説明は技術的には詳細だが、テンプレート形式に従っていない。 テンプレート形式に従い、Description、Type of Change(Bug fix を選択)、Testing セクションを追加し、Related Issues で upstream の issue/PR リンクを明記してください。
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed PR タイトルは上流からの cherry-pick による sidebar section count 修正であり、変更内容の主要なポイントを簡潔に説明している。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch upstream-merge/pr8-sidebar-section-count

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/components/DashboardSidebar/hooks/useDashboardSidebarData/useDashboardSidebarData.ts`:
- Around line 328-351:
子要素をセクションへ再親化するループ(sortedChildren→currentSection→children)で、PENDING_WORKSPACE_TAB_ORDER
によって追加された「pending workspace」をセクション配下へ移動しないようにしてください:つまり useDashboardSidebarData
のループ内で child が pending を表すかどうかを PENDING_WORKSPACE_TAB_ORDER(または
child.workspace.tabOrder がそれに等しいこと)で判定し、その場合は currentSection があっても
currentSection.workspaces に入れずに children にそのまま push
するように修正してください(対象シンボル:sortedChildren, currentSection, children,
sidebarProject.children, PENDING_WORKSPACE_TAB_ORDER)。
🪄 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: 7a2b8883-ae31-4828-99b2-09971158793d

📥 Commits

Reviewing files that changed from the base of the PR and between 53a0018 and 36de00a.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarData/useDashboardSidebarData.ts

Comment on lines +328 to +351
const sortedChildren = childEntries
.sort((left, right) => left.tabOrder - right.tabOrder)
.map(({ child }) => child);

// Ungrouped workspaces rendered after a section header are visually
// grouped with that section (shared accent, collapse-together) and will
// be committed into it on next DnD. Reparent them here so section counts
// match what the user sees.
const children: DashboardSidebarProjectChild[] = [];
let currentSection: DashboardSidebarSection | null = null;
for (const child of sortedChildren) {
if (child.type === "section") {
currentSection = child.section;
children.push(child);
} else if (currentSection) {
currentSection.workspaces.push({
...child.workspace,
accentColor: currentSection.color,
});
} else {
children.push(child);
}
}
sidebarProject.children = children;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

pending workspace はセクションへ再親化しないでください。

Line 342 の条件だと、Line 310〜315 で追加された pending workspace も PENDING_WORKSPACE_TAB_ORDER により最後に並び、セクションが1つでもあるプロジェクトでは最後のセクション配下へ移動します。作成中/失敗中の workspace が section count に含まれたり、セクションの collapse に巻き込まれたりするため、pending はトップレベルのまま残すのが安全です。

修正案
-				} else if (currentSection) {
+				} else if (currentSection && child.workspace.creationStatus == null) {
 					currentSection.workspaces.push({
 						...child.workspace,
 						accentColor: currentSection.color,
 					});
🤖 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/components/DashboardSidebar/hooks/useDashboardSidebarData/useDashboardSidebarData.ts`
around lines 328 - 351,
子要素をセクションへ再親化するループ(sortedChildren→currentSection→children)で、PENDING_WORKSPACE_TAB_ORDER
によって追加された「pending workspace」をセクション配下へ移動しないようにしてください:つまり useDashboardSidebarData
のループ内で child が pending を表すかどうかを PENDING_WORKSPACE_TAB_ORDER(または
child.workspace.tabOrder がそれに等しいこと)で判定し、その場合は currentSection があっても
currentSection.workspaces に入れずに children にそのまま push
するように修正してください(対象シンボル:sortedChildren, currentSection, children,
sidebarProject.children, PENDING_WORKSPACE_TAB_ORDER)。

@MocA-Love MocA-Love merged commit 7c71684 into main Apr 18, 2026
6 checks passed
MocA-Love added a commit that referenced this pull request Apr 18, 2026
…al dim sync)

- 1979f4c fix(desktop): v2 sidebar section count reflects visually grouped workspaces (superset-sh#3544) → PR #315 (clean cherry-pick)
- 867ef87 fix(desktop): sync v1 terminal dimensions to backend on connect (superset-sh#3545) → PR #316 (manual port for fork cold-restore divergence)
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