Skip to content

feat: 9-phase audit + modernization (P0-P8)#7

Open
gabrielcsapo wants to merge 1 commit into
mainfrom
feat/groffee-modernization
Open

feat: 9-phase audit + modernization (P0-P8)#7
gabrielcsapo wants to merge 1 commit into
mainfrom
feat/groffee-modernization

Conversation

@gabrielcsapo

Copy link
Copy Markdown
Owner

Summary

Audit-driven sweep of UX gaps, real bugs, and missing features that came out of a deep walkthrough of the running instance at https://groffee.local. Squashed from 41 incremental commits into one PR for review.

Each phase was individually green on pnpm typecheck + pnpm lint, then chrome-verified end-to-end after a final hotfix. See the commit body for the per-phase breakdown.

Stats: 125 files changed, +43,715 / -1,619.

What's in the box

  • P0 — page-bleed fix, stuck-pipeline watchdog, server-side filter URL state, danger-zone polish
  • P1 — cursor pagination, diff highlighting, branch+tag picker, line anchors, search facet fix, markdown editor + image upload, edit-in-browser CRUD
  • P2 — PR review: detail-page tabs, inline diff comments, merge button, CI status badge
  • P3 — pipelines GA: ANSI logs, timestamps, live-tail SSE, search-in-log, log download, rerun-failed-jobs-only, artifact retention + UI, secrets (AES-GCM) + UI + runner injection, build matrix, inline error annotations, config editor, list filters, run history sidebar
  • P4 — homelab ops: invite links, admin CLI, admin dashboard, per-repo reindex, historical PR backfill
  • P5 — clone popover, About sidebar in tree+blob, markdown copy buttons + heading anchors, /tags page
  • P6 — avatar upload, profile fields (bio/website/location), PAT polish, SSH-keys UI
  • P7 — mobile responsive pass on repo browsing / issue+PR detail / search
  • P8 — default branch change, repo rename, archive flag, deploy keys

Cross-cutting principle

Cursor pagination on every list (no offset, no fetch-all-and-slice). Aggregates precomputed where applicable. Every list query scoped by viewer permissions in SQL.

Test plan

  • `pnpm typecheck` clean
  • `pnpm lint` clean
  • `pnpm fmt --check` clean
  • Chrome-verified on the running instance after the hotfix landed:
    • Repo home / tree / blob render and don't bleed across nav
    • Filter URL state (?status=merged) shows correct tab on direct load
    • Stuck pipeline run #14 now shows `timed_out` instead of running 8000+ minutes
    • Pipelines list filter dropdowns (ref / trigger / actor) work
    • Run detail: ANSI logs, search-in-log, download, rerun-failed, run history sidebar
    • Settings: edit policy, default branch, rename, archive, secrets, deploy keys, invites, search reindex
    • New issue form has Markdown editor with toolbar + Write/Preview tabs
    • Search facets: clean language labels (Tsx, Typescript, JSON, …) — no more `.lient.tsx`
    • Clone popover with HTTPS/SSH/CLI/VS Code tabs
  • Manual sanity on production after merge
  • DB migrations (10 new) apply cleanly: 0013–0022

Known follow-ups (not blocking)

  1. Search facets show "Yaml" twice (`yml` + `yaml` aggregate to same display label but stay separate raw extensions for filter compatibility). Append the ext to the label, e.g. "Yaml (.yml)".
  2. About sidebar reflows below content right at the `xl:` breakpoint (1280px). Consider a custom breakpoint or pulling into `lg:`.
  3. Swift not in Shiki's loaded language list, so Swift diffs lose token-level color (still get +/- row colors). Adding Swift to the highlighter init would fix.

🤖 Generated with Claude Code

Audit-driven sweep of UX gaps, real bugs, and missing features that came out of
a deep walkthrough of the running instance. 41 incremental commits squashed into
one PR for review. Each phase was individually green on pnpm typecheck +
pnpm lint and chrome-verified end-to-end after a final hotfix.

P0 (bug fixes)
- Repo-layout Outlet keyed by pathname so sibling tab navigation fully unmounts
  the previous page (Pipelines → Activity, Settings → Pipelines, …).
- Pipeline run-level timeout (configurable via top-level timeout in YAML;
  default 60min) plus a stuck-run sweeper that recovers runs whose worker
  process died without writing finishedAt.
- Server-side initial fetch reads ?status= so direct-loading filtered URLs
  shows the correct list instead of always defaulting to "open".
- Danger-zone confirm-input placeholder no longer pre-fills the repo name.

P1 (foundation + daily ergonomics)
- Cursor-based pagination primitives in @groffee/db (encodeCursor /
  decodeCursor / cursorWhere / cursorOrderBy / paginatedResult); retrofit on
  issues / PRs / pipelines lists with a shared LoadMore component.
- Diff syntax highlighting via the existing Shiki helper (server-side; +/-
  row coloring preserved).
- Unified branch+tag picker with search + keyboard nav, used consistently
  across home / tree / blob / commits.
- Line anchors and Copy permalink button on the blob view (#L42 / #L42-L60).
- Search language facet labels: replaced brittle SUBSTR-based extension
  extraction with JS aggregation so facets like ".lient.tsx" become Tsx /
  TypeScript / JSON / etc.
- Markdown editor component (Write/Preview tabs, drag-paste image upload,
  toolbar) wired into issue / PR / comment forms; bodies now render markdown.
- Image upload API at /api/uploads (content-addressed, sha256, 10 MB cap).
- Edit-in-browser file CRUD via git CLI (hash-object / mktree / commit-tree /
  update-ref); per-repo "edit policy" toggle (direct vs PR mode).

P2 (light code review)
- diff_comments table for inline PR review (threaded via parentId).
- PR detail page tabs (Conversation / Files changed / Commits).
- Inline diff comment UI with reply, resolve, collapse-when-resolved.
- Merge button (merge / squash; rebase returns 501) with branch-deletion
  checkbox.
- CI status badge on Conversation tab via getLatestRunForCommit.

P3 (pipelines polish — flagship)
- ANSI color rendering + per-line ISO timestamps stored TAB-separated on disk.
- Live-tail SSE with per-conn byte offsets + 15s heartbeat + terminal-state
  close.
- Search-in-log; per-step and full-run log download.
- "Rerun failed jobs only" preserves the prior run's succeeded jobs.
- pipelineArtifacts.retentionUntil + 30-min retention sweeper + UI.
- repoSecrets schema (AES-256-GCM at rest, master key at data/.groffee-key
  mode 0600) + UI under repo settings + runner env injection (per-step).
- Build matrix support: matrix in YAML, per-cell row in pipelineJobs,
  template interpolation for matrix.X, DAG render with cell aggregation.
- Inline error annotations: parse file:line from logs, validate path exists
  via git cat-file, link to /blob/<sha>/<path>#L<line>.
- Pipeline config editor at /pipelines/config with validate-then-commit
  (re-uses the P1 editFile flow so it respects editPolicy).
- Run history sidebar on detail page (last 15 runs on same ref).
- List page filters: ref, trigger, actor (URL-driven, paginated).

P4 (homelab ops)
- Repo invite links (one-time, time-limited, optional permission binding).
- Admin CLI subcommands (reset-password, make-admin, disable-user,
  recompute-storage, reindex-search).
- Admin dashboard rebuilt: storage by repo, audit feed (filterable),
  search index freshness, PR backfill button.
- Per-repo "Reindex now" button with last_indexed_at status.
- Historical PR backfill from "Merge pull request #N" commit messages.

P5 (repo polish)
- Clone helper popover (HTTPS / SSH / CLI tabs + "Open in VS Code").
- About sidebar lifted to shared component, rendered on tree + blob too.
- Markdown copy buttons on every <pre><code>, heading anchor links.
- /tags listing page with cursor pagination.

P6 (personal touches)
- Profile schema: avatarUploadId, website, location.
- Avatar upload via the P1 image upload route + <Avatar /> component used in
  the top-bar and profile page.
- Profile fields UI (bio with char counter, website URL-validated, location).
- PAT management UI polish (status badge, last-used, revoke confirm).
- SSH keys UI: algorithm-prefix gate + clarified vs deploy keys.

P7 (mobile responsive)
- Repo browsing: About reflow, file-table column hiding, repo nav
  horizontal-scroll, blob action bar.
- Issue / PR detail: comment-header stacking, tab strip scroll, Files-changed
  file-list collapsible under lg.
- Search: tab strip scroll + Languages facet collapsible under md.

P8 (settings expansion)
- Default branch change (DB-only, validated against gitRefs).
- Repository rename (renames disk dir + diskPath; redirects to new URL).
- Archive flag enforced across every write path (issues, PRs, comments,
  diff comments, secrets, invites, edit-in-browser, SSH push).
- Per-repo deploy keys (separate table; SSH auth callback tries user keys
  then deploy keys; read-only flag enforced).

Hotfix
- Rename RepoAboutSidebar's `ref` prop to `gitRef`. `ref` is React-reserved
  and crashed every repo home/tree/blob route with "Refs cannot be used in
  Server Components".

Cross-cutting principle established for the codebase: cursor pagination, no
"fetch all and slice", aggregates precomputed where applicable, every
list scoped by viewer permissions in SQL.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant