mirror of
https://github.com/block/buzz.git
synced 2026-11-24 18:21:59 +00:00
## Summary Projects v3 makes repository work shareable, discussion-aware, and easier to scan in one coherent workspace. People can copy canonical links, reopen the exact workspace tab, understand issue and pull-request context at a glance, find related channel conversations, and assign or unassign issues across Desktop and CLI. - **Unified workspace** — top-level sections sit above repository controls in one rounded workspace, with navigation positioned close to the page heading. README and Files retain branch selection; every section has a labeled icon header, and Issues and Pull Requests expose creation from a consistent right-aligned action. - **Repository management** — the repository selector is always available, including single-repository projects. Its integrated add flow lets project owners create a repository manually or select an existing repository without a separate toolbar button. - **Readable work-item lists** — issue and pull-request rows use plain-language context instead of opaque metadata. Files, commits, issues, pull requests, channels, and contributors share consistent row density and right-aligned timestamps, while deterministic fallback-avatar colors keep participants distinct on light backgrounds. Inbox pull-request metadata wraps between complete phrases and truncates long channel names instead of compressing copy into narrow columns. - **Reliable entity links** — projects, repositories, issues, pull requests, and commits have canonical `buzz://` links, preview cards, OS deep-link routing, and tab-aware navigation. Reopening the same link re-applies its destination instead of leaving the user on a locally selected tab. - **Related conversations** — repository and work-item views surface channels discussing the current entity, including participants, channel navigation, message context, and an explicit notice when discovery reaches its 500-result cap. - **Reversible issue ownership** — trusted assignment and unassignment events work across Desktop, Tauri, `buzz-sdk`, and `buzz issues`. Assignees appear in project views and the assigned inbox, while authorized users can remove assignments directly from the assignee row. Assignment state is derived chronologically from labeled Nostr notes. Issue authors and repository owners may change any assignee; other users may only assign or unassign themselves. Shared golden fixtures keep entity-link grammar and validation aligned across TypeScript and Rust. The branch also updates `webbrowser` to the patched release for RUSTSEC-2026-0257. ### Related issue N/A. ### Testing - [x] `just ci` — formatting, lint, typechecking, unit tests, and builds passed - [x] Full pre-push suite — organization, branch-skew, Desktop checks, typechecking, and tests passed on the latest push - [x] `cargo test -p buzz-cli` and focused `buzz-sdk` assignment tests passed - [x] Focused Tauri recipient-note and 500-result search-limit tests passed - [x] Desktop entity-link and issue-assignment unit tests passed - [x] Playwright smoke coverage passed for assignment, repeated entity-link navigation, repository create/select flows, section headers and actions, timestamp alignment, timeline icons, sentence-style issue/PR metadata, header spacing, avatar contrast, and Inbox metadata at stacked and side-rail breakpoints - [ ] Manual staging pass: link round-trips, Channels tab, assignment flows, and inbox routing ### Screenshots Pull requests explain who opened the request, where it lives, and which branch it comes from; fallback avatars remain visually distinct.  Issues use the same sentence-style hierarchy while keeping status and recency easy to scan.  The wide Inbox detail keeps author, timestamp, and origin context readable beside its metadata rail.  [View the complete six-state Projects v3 screenshot set](https://github.com/block/buzz/pull/5624#issuecomment-5268039672) and [the compact/wide Inbox comparison](https://github.com/block/buzz/pull/5624#issuecomment-5268614585). --- > Supersedes #5624, whose head commit accumulated permanently-queued required check suites (block-dco-check et al.) that GitHub never dispatched. History flattened into a single signed-off commit on latest main; tree verified byte-identical (`git merge-tree`) to merging the original branch into main. --------- Signed-off-by: Thomas Petersen <thomasp@squareup.com> Co-authored-by: Wintermute <3f1797424fd9ad6653a83665c660517777cd7f8c228c0d5907f49e01537f3ca5@buzz.block.builderlab.xyz>
225 lines
9.7 KiB
TypeScript
225 lines
9.7 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
|
|
|
import { waitForAnimations } from "../helpers/animations";
|
|
import { installMockBridge } from "../helpers/bridge";
|
|
|
|
const SHOTS = "test-results/projects-v3-screenshots";
|
|
|
|
async function openBuzzProject(page: import("@playwright/test").Page) {
|
|
await page.goto("/", { waitUntil: "domcontentloaded" });
|
|
await page.getByTestId("open-projects-view").click();
|
|
await page.getByTestId("projects-section-projects").click();
|
|
const projectEntry = page
|
|
.locator(
|
|
'[data-testid="project-card-buzz"], [data-testid="project-row-buzz"]',
|
|
)
|
|
.first();
|
|
await expect(projectEntry).toBeVisible({ timeout: 10_000 });
|
|
await projectEntry.click();
|
|
}
|
|
|
|
// Walks the Projects v3 workspace through its headline states so PR
|
|
// screenshots capture distinct pixels per feature (overview box, tab-strip
|
|
// plus, issue detail with inline copy link + avatar timeline, PR detail).
|
|
test("projects v3 workspace screenshot states", async ({ page }) => {
|
|
await installMockBridge(page);
|
|
await openBuzzProject(page);
|
|
await expect(
|
|
page.getByRole("button", { name: "Open Discussion" }),
|
|
).toHaveCount(0);
|
|
|
|
// Single-box workspace: tabs sit above the pickers, which only appear for
|
|
// the README overview and Files.
|
|
const overviewTab = page.getByRole("tab", { name: "Overview" });
|
|
const filesTab = page.getByRole("tab", { name: "Files" });
|
|
const channelsTab = page.getByRole("tab", { name: "Channels" });
|
|
const contributorsTab = page.getByRole("tab", { name: "Contributors" });
|
|
const tabMenu = page.getByTestId("project-workspace-tab-menu");
|
|
const workspacePanel = page.getByTestId("project-workspace-panel");
|
|
const selectionRow = page.getByTestId("project-repository-selection-row");
|
|
await expect(filesTab).toBeVisible();
|
|
await expect(selectionRow).toBeVisible();
|
|
await expect(
|
|
workspacePanel.getByTestId("project-repository-selection-row"),
|
|
).toBeVisible();
|
|
await expect(
|
|
workspacePanel.getByTestId("project-workspace-tab-menu"),
|
|
).toHaveCount(0);
|
|
const overviewBounds = await overviewTab.boundingBox();
|
|
const channelsBounds = await channelsTab.boundingBox();
|
|
const contributorsBounds = await contributorsTab.boundingBox();
|
|
const tabMenuBounds = await tabMenu.boundingBox();
|
|
const workspaceBounds = await workspacePanel.boundingBox();
|
|
const selectionBounds = await selectionRow.boundingBox();
|
|
expect(overviewBounds).not.toBeNull();
|
|
expect(channelsBounds).not.toBeNull();
|
|
expect(contributorsBounds).not.toBeNull();
|
|
expect(tabMenuBounds).not.toBeNull();
|
|
expect(workspaceBounds).not.toBeNull();
|
|
expect(selectionBounds).not.toBeNull();
|
|
expect(channelsBounds?.x).toBeLessThan(contributorsBounds?.x ?? 0);
|
|
expect(overviewBounds?.x).toBe(workspaceBounds?.x);
|
|
expect(tabMenuBounds?.y).toBeLessThan(workspaceBounds?.y ?? 0);
|
|
expect(overviewBounds?.y).toBeLessThan(selectionBounds?.y ?? 0);
|
|
await expect(
|
|
workspacePanel.getByRole("heading", { name: "README", exact: true }),
|
|
).toBeVisible();
|
|
await expect(
|
|
workspacePanel.getByTestId("project-section-header-icon"),
|
|
).toBeVisible();
|
|
await waitForAnimations(page);
|
|
await page.screenshot({ path: `${SHOTS}/01-workspace-overview.png` });
|
|
|
|
await filesTab.click();
|
|
await expect(selectionRow).toBeVisible();
|
|
await expect(
|
|
workspacePanel.getByRole("heading", { name: "Files", exact: true }),
|
|
).toBeVisible();
|
|
await page.getByRole("tab", { name: "Commits" }).click();
|
|
await expect(selectionRow).toHaveCount(0);
|
|
await expect(
|
|
workspacePanel.getByRole("heading", { name: "Commits", exact: true }),
|
|
).toBeVisible();
|
|
const commitRow = page.getByTestId("project-activity-feed-item").first();
|
|
const commitDate = commitRow.getByTestId("project-commit-row-date");
|
|
const commitHash = commitRow.getByTitle(/^View commit /);
|
|
await expect(commitDate).toBeVisible();
|
|
const commitDateBounds = await commitDate.boundingBox();
|
|
const commitHashBounds = await commitHash.boundingBox();
|
|
expect(commitDateBounds).not.toBeNull();
|
|
expect(commitHashBounds).not.toBeNull();
|
|
expect(commitDateBounds?.x).toBeGreaterThan(commitHashBounds?.x ?? 0);
|
|
await contributorsTab.click();
|
|
const contributorRow = page.getByTestId("project-contributor-row").first();
|
|
await expect(
|
|
page.getByTestId("project-contributor-row-date").first(),
|
|
).toBeVisible();
|
|
const contributorBounds = await contributorRow.boundingBox();
|
|
expect(contributorBounds).not.toBeNull();
|
|
|
|
// Issues tab: the create action lives in the section header.
|
|
await page.getByRole("tab", { name: "Issues", exact: true }).click();
|
|
await expect(selectionRow).toHaveCount(0);
|
|
const newIssueButton = workspacePanel.getByRole("button", {
|
|
name: "New issue",
|
|
});
|
|
await expect(newIssueButton).toBeVisible();
|
|
await expect(tabMenu.getByRole("button", { name: "New issue" })).toHaveCount(
|
|
0,
|
|
);
|
|
const issuesHeading = workspacePanel.getByRole("heading", {
|
|
name: "Issues",
|
|
exact: true,
|
|
});
|
|
const issuesHeadingBounds = await issuesHeading.boundingBox();
|
|
const newIssueBounds = await newIssueButton.boundingBox();
|
|
expect(issuesHeadingBounds).not.toBeNull();
|
|
expect(newIssueBounds).not.toBeNull();
|
|
expect(newIssueBounds?.x).toBeGreaterThan(issuesHeadingBounds?.x ?? 0);
|
|
const issueRow = page.getByTestId("project-issue-row").first();
|
|
await expect(issueRow).toBeVisible({ timeout: 10_000 });
|
|
const issueDate = issueRow.getByTestId("project-issue-row-date");
|
|
const issueId = issueRow.getByTitle("View issue");
|
|
await expect(issueDate).toBeVisible();
|
|
const issueDateBounds = await issueDate.boundingBox();
|
|
const issueIdBounds = await issueId.boundingBox();
|
|
const issueRowBounds = await issueRow.boundingBox();
|
|
expect(issueDateBounds).not.toBeNull();
|
|
expect(issueIdBounds).not.toBeNull();
|
|
expect(issueRowBounds).not.toBeNull();
|
|
expect(contributorBounds?.height).toBe(issueRowBounds?.height);
|
|
expect(issueDateBounds?.x).toBeGreaterThan(issueIdBounds?.x ?? 0);
|
|
await waitForAnimations(page);
|
|
await page.screenshot({ path: `${SHOTS}/02-issues-tab.png` });
|
|
|
|
// Issue detail: inline copy link after the title, assignees rail, and the
|
|
// avatar comment timeline (seed comments so the timeline renders).
|
|
await issueRow.getByRole("button", { name: /^#/ }).click();
|
|
const composer = page.getByTestId("project-issue-comment-composer");
|
|
await expect(composer).toBeVisible();
|
|
await expect(tabMenu).toHaveCount(0);
|
|
for (const comment of [
|
|
"The palette needs the most work — starting there.",
|
|
"Agreed. Typography pass can land separately.",
|
|
]) {
|
|
await composer.locator('[contenteditable="true"]').fill(comment);
|
|
await composer.getByRole("button", { name: "Send message" }).click();
|
|
await expect(page.getByText(comment, { exact: true })).toBeVisible({
|
|
timeout: 10_000,
|
|
});
|
|
}
|
|
await expect(page.getByTestId("project-issue-copy-link")).toBeVisible();
|
|
await expect(
|
|
page.getByTestId("project-issue-comment-timeline-row").first(),
|
|
).toBeVisible();
|
|
// Let the "Comment posted." toast dismiss so it doesn't photobomb.
|
|
await expect(page.getByText("Comment posted.")).toHaveCount(0, {
|
|
timeout: 10_000,
|
|
});
|
|
await waitForAnimations(page);
|
|
await page.screenshot({ path: `${SHOTS}/03-issue-detail.png` });
|
|
|
|
// PR list: section header owns creation; detail keeps its entity header.
|
|
await page
|
|
.getByRole("navigation", { name: "Project breadcrumb" })
|
|
.getByRole("button", { name: "Issues", exact: true })
|
|
.click();
|
|
await expect(tabMenu).toBeVisible();
|
|
await page.getByRole("tab", { name: "Pull Request", exact: true }).click();
|
|
await expect(
|
|
workspacePanel.getByRole("heading", {
|
|
name: "Pull Requests",
|
|
exact: true,
|
|
}),
|
|
).toBeVisible();
|
|
await expect(
|
|
workspacePanel.getByRole("button", { name: "New pull request" }),
|
|
).toBeVisible();
|
|
await expect(
|
|
tabMenu.getByRole("button", { name: "New pull request" }),
|
|
).toHaveCount(0);
|
|
const prRow = page.getByTestId("project-pull-request-row").first();
|
|
await expect(prRow).toBeVisible({ timeout: 10_000 });
|
|
const prDate = prRow.getByTestId("project-pull-request-row-date");
|
|
const prId = prRow.getByTitle("View pull request");
|
|
await expect(prDate).toBeVisible();
|
|
const prDateBounds = await prDate.boundingBox();
|
|
const prIdBounds = await prId.boundingBox();
|
|
expect(prDateBounds).not.toBeNull();
|
|
expect(prIdBounds).not.toBeNull();
|
|
expect(prDateBounds?.x).toBeGreaterThan(prIdBounds?.x ?? 0);
|
|
await prRow.getByRole("button", { name: /^#/ }).click();
|
|
await expect(
|
|
page.getByTestId("project-pull-request-copy-link"),
|
|
).toBeVisible();
|
|
await expect(tabMenu).toHaveCount(0);
|
|
await waitForAnimations(page);
|
|
await page.screenshot({ path: `${SHOTS}/04-pr-detail.png` });
|
|
});
|
|
|
|
test("projects v3 work-item list metadata", async ({ page }) => {
|
|
await page.addInitScript(() => {
|
|
window.localStorage.setItem("buzz.projects.viewMode", "list");
|
|
});
|
|
await installMockBridge(page);
|
|
await page.goto("/", { waitUntil: "domcontentloaded" });
|
|
await page.getByTestId("open-projects-view").click();
|
|
|
|
await page.getByTestId("projects-section-prs").click();
|
|
const pullRequestRow = page.getByTestId(/^projects-pr-row-/).first();
|
|
await expect(pullRequestRow).toBeVisible();
|
|
await expect(pullRequestRow).toContainText("opened this in");
|
|
await expect(pullRequestRow).toContainText(/from\s*feature\/mock-2-0/);
|
|
await expect(pullRequestRow).not.toContainText(/#[0-9a-f]{8}/);
|
|
await waitForAnimations(page);
|
|
await page.screenshot({ path: `${SHOTS}/05-pr-list-metadata.png` });
|
|
|
|
await page.getByTestId("projects-section-issues").click();
|
|
const issueRow = page.getByTestId(/^projects-issue-row-/).first();
|
|
await expect(issueRow).toBeVisible();
|
|
await expect(issueRow).toContainText(/opened this in\s*relay-tools/);
|
|
await expect(issueRow).not.toContainText(/#[0-9a-f]{8}/);
|
|
await waitForAnimations(page);
|
|
await page.screenshot({ path: `${SHOTS}/06-issue-list-metadata.png` });
|
|
});
|