mirror of
https://github.com/block/buzz.git
synced 2026-11-05 08:51:10 +00:00
## Summary - Makes Projects repository-aware across browsing, branch and tag selection, local and remote source management, work items, commits, and contextual repository actions. - Refines project details into consistent single-column reading surfaces with a resizable, section-aware context pod, while keeping project conversations available in the attached chat panel. - Adds persistent sidebar project navigation, direct entity links, repository discussion channels, contributor identity matching, and consistent loading and activity presentation. - Keeps branch-specific controls on code-oriented sections while Tasks, Reviews, and Channels remain repository-scoped, reducing misleading context and actions. Replacement for #5981 with an identical final tree flattened into one signed-off commit because the required DCO check suite remained stalled. ### Related issue N/A ### Testing - [x] Desktop pre-push checks, TypeScript typecheck, and unit tests - [x] E2E production build with `pnpm build:e2e` - [x] Focused Playwright smoke coverage for project workspace, task, review, commit, sidebar, and contextual-panel behavior - [ ] Attach final before/after screenshots after design review --------- Signed-off-by: Thomas Petersen <thomasp@squareup.com> Signed-off-by: Wintermute <165f0c871dd2586bb18b6aa109eeaf57bb2132ff4d27b10120f4368a0f627022@buzz.block.builderlab.xyz> Co-authored-by: Wintermute <165f0c871dd2586bb18b6aa109eeaf57bb2132ff4d27b10120f4368a0f627022@buzz.block.builderlab.xyz>
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import type {
|
|
ProjectIssue,
|
|
ProjectPullRequest,
|
|
} from "@/features/projects/hooks";
|
|
|
|
export type ProjectRightPanelScope = "branch" | "repository";
|
|
|
|
const BRANCH_SCOPED_TABS = new Set([
|
|
"activity",
|
|
"contributors",
|
|
"files",
|
|
"overview",
|
|
]);
|
|
|
|
/** Identifies whether a project tab follows the selected Git ref. */
|
|
export function projectRightPanelScope(
|
|
activeTab: string,
|
|
): ProjectRightPanelScope {
|
|
return BRANCH_SCOPED_TABS.has(activeTab) ? "branch" : "repository";
|
|
}
|
|
|
|
export function projectTaskActivity(issues: ProjectIssue[]) {
|
|
const completed = issues.filter(
|
|
(issue) => issue.status === "Done" || issue.status === "Closed",
|
|
).length;
|
|
return {
|
|
active: issues.length - completed,
|
|
completed,
|
|
total: issues.length,
|
|
};
|
|
}
|
|
|
|
export function projectReviewActivity(pullRequests: ProjectPullRequest[]) {
|
|
return {
|
|
merged: pullRequests.filter(
|
|
(pullRequest) => pullRequest.status === "Merged",
|
|
).length,
|
|
open: pullRequests.filter(
|
|
(pullRequest) =>
|
|
pullRequest.status === "Open" || pullRequest.status === "Draft",
|
|
).length,
|
|
total: pullRequests.length,
|
|
};
|
|
}
|