mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02: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>
103 lines
3.0 KiB
Bash
Executable File
103 lines
3.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [[ $# -lt 2 ]]; then
|
|
echo "Usage: $0 <pr-number> <png-dir> [comment-body-file]" >&2
|
|
exit 1
|
|
fi
|
|
|
|
PR="$1"
|
|
PNG_DIR="$2"
|
|
BODY_FILE="${3:-}"
|
|
|
|
if ! [[ "$PR" =~ ^[0-9]+$ ]]; then
|
|
echo "error: PR number must be a positive integer" >&2
|
|
exit 1
|
|
fi
|
|
|
|
GH_USER=$(gh api user --jq .login)
|
|
BRANCH="agent-screenshots/${GH_USER}"
|
|
REPO="block/buzz"
|
|
|
|
# macOS ships bash 3.2, which lacks mapfile — build the array with read.
|
|
PNGS=()
|
|
while IFS= read -r PNG; do
|
|
PNGS+=("$PNG")
|
|
done < <(find "$PNG_DIR" -maxdepth 1 -name "*.png" -type f | sort)
|
|
if [[ ${#PNGS[@]} -eq 0 ]]; then
|
|
echo "error: no PNGs found in $PNG_DIR" >&2
|
|
exit 1
|
|
fi
|
|
|
|
EXISTING_ENTRIES=""
|
|
if git fetch origin "refs/heads/${BRANCH}:refs/remotes/origin/${BRANCH}" 2>/dev/null; then
|
|
EXISTING_ENTRIES=$(git ls-tree "origin/${BRANCH}" | grep -v $'\t'"\"\\{0,1\\}pr-${PR}--" || true)
|
|
fi
|
|
|
|
NEW_ENTRIES=""
|
|
TREE_PATHS=()
|
|
for PNG in "${PNGS[@]}"; do
|
|
FILENAME=$(basename "$PNG")
|
|
if ! [[ "$FILENAME" =~ ^[a-zA-Z0-9_.-]+$ ]]; then
|
|
echo "error: invalid PNG filename (must be alphanumeric, dots, hyphens, underscores): $FILENAME" >&2
|
|
exit 1
|
|
fi
|
|
BLOB=$(git hash-object -w "$PNG")
|
|
TREE_PATH="pr-${PR}--${FILENAME}"
|
|
NEW_ENTRIES+="$(printf '100644 blob %s\t%s' "$BLOB" "$TREE_PATH")"$'\n'
|
|
TREE_PATHS+=("$TREE_PATH")
|
|
done
|
|
|
|
COMBINED=$(printf '%s\n' "$EXISTING_ENTRIES" "$NEW_ENTRIES" | grep -v '^$')
|
|
TREE=$(echo "$COMBINED" | git mktree)
|
|
|
|
PARENT_ARGS=()
|
|
if git rev-parse "origin/${BRANCH}" >/dev/null 2>&1; then
|
|
PARENT_ARGS=(-p "origin/${BRANCH}")
|
|
fi
|
|
# ${arr[@]+...} guards the empty-array case, which trips set -u on bash 3.2.
|
|
COMMIT=$(git commit-tree "$TREE" ${PARENT_ARGS[@]+"${PARENT_ARGS[@]}"} -m "screenshots: PR #${PR}")
|
|
git push --force-with-lease origin "${COMMIT}:refs/heads/${BRANCH}"
|
|
|
|
RAW_BASE="https://raw.githubusercontent.com/${REPO}/${COMMIT}"
|
|
|
|
# Parallel name/url arrays instead of an associative array (bash 4+ only).
|
|
IMAGE_NAMES=()
|
|
IMAGE_URLS=()
|
|
for i in "${!PNGS[@]}"; do
|
|
IMAGE_NAMES+=("$(basename "${PNGS[$i]}" .png)")
|
|
IMAGE_URLS+=("${RAW_BASE}/${TREE_PATHS[$i]}")
|
|
done
|
|
|
|
if [[ -n "$BODY_FILE" ]]; then
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
"$SCRIPT_DIR/check-pr-image-urls.sh" "$BODY_FILE"
|
|
COMMENT_BODY="$(cat "$BODY_FILE")"
|
|
UNREFERENCED=()
|
|
for i in "${!IMAGE_NAMES[@]}"; do
|
|
NAME="${IMAGE_NAMES[$i]}"
|
|
URL="${IMAGE_URLS[$i]}"
|
|
PLACEHOLDER="{{${NAME}}}"
|
|
if [[ "$COMMENT_BODY" == *"$PLACEHOLDER"* ]]; then
|
|
COMMENT_BODY="${COMMENT_BODY//"$PLACEHOLDER"/}"
|
|
else
|
|
UNREFERENCED+=("${NAME}"$'\t'"${URL}")
|
|
fi
|
|
done
|
|
if [[ ${#UNREFERENCED[@]} -gt 0 ]]; then
|
|
while IFS=$'\t' read -r NAME URL; do
|
|
COMMENT_BODY+=$'\n\n'""
|
|
done < <(printf '%s\n' "${UNREFERENCED[@]}" | sort)
|
|
fi
|
|
else
|
|
COMMENT_BODY="## Screenshots"$'\n\n'
|
|
for URL in "${IMAGE_URLS[@]}"; do
|
|
FILENAME=$(basename "$URL")
|
|
NAME="${FILENAME%.png}"
|
|
COMMENT_BODY+=""$'\n\n'
|
|
done
|
|
fi
|
|
|
|
gh pr comment "$PR" --repo "$REPO" --body "$COMMENT_BODY"
|
|
echo "Posted ${#PNGS[@]} screenshot(s) to PR #${PR}"
|