mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-17 04:37:03 +00:00
## Summary The run Overview tab's "Created by" cell rendered every user as a colored circle with the first letter of their login. Reviewers and run owners expected the same GitHub avatar shown on `/profile` and in the top-right nav. The cell only had `login` to work with — the `PrincipalUser` schema carried no avatar URL. This threads an optional `avatar_url` through `UserPrincipal` end-to-end: schema, server auth, and frontend. The avatar is captured at action time from the request's auth context and persisted with the run's `created_by` principal — a point-in-time snapshot, the same pattern as audit logs and chat apps. ## What changed - **`fabro-types`** — `UserPrincipal` gains `avatar_url: Option<String>` with `#[serde(default, skip_serializing_if)]`, plus a `Principal::user_with_avatar` constructor. The existing `Principal::user` constructor is unchanged (sets `None`), so test fixtures and CLI/replay call sites need no edits. - **OpenAPI** — `PrincipalUser` gains an optional nullable `avatar_url`; Rust (progenitor) and TypeScript clients regenerated. - **`fabro-server`** — `auth_context_from_session` (cookie auth) and `classify_user_token` (JWT auth) populate the principal's avatar from the session/JWT, treating an empty string as `None`. - **`fabro-web`** — the `run-summary-panel` "Created by" cell renders an `<img>` when `avatar_url` is present, falling back to the initial circle otherwise. ## Compatibility The field is optional with serde defaults, so old persisted runs and `RunEvent.actor` payloads deserialize unchanged — they show the initial-circle fallback. No migration or backfill. ## Known gap CLI-initiated runs (`fabro run ...`) still show the initial circle: the CLI auth flow hardcodes an empty `avatar_url` in the JWT subject (`cli_flow.rs:508`). Wiring the avatar through CLI login (`~/.fabro/auth.json`, JWT claims, refresh-token chain) is a deliberate follow-up. Web-initiated runs get the avatar today. ## Test plan - `cargo nextest run --workspace` — 5,832 tests pass, including new `principal.rs` and `principal_round_trip.rs` cases covering avatar serialization and legacy-JSON (no-field) deserialization. - `cd apps/fabro-web && bun test run-summary-panel` — 13 tests pass, including a new case asserting the `<img>` renders with the avatar src. - `bun run typecheck`, `cargo +nightly-2026-04-14 fmt --check --all`, and `clippy --workspace --all-targets -- -D warnings` all clean. - Manual: restart `fabro server`, create a run from the web UI, confirm the real avatar renders on the Overview tab; confirm an older run falls back to the initial circle. --- [](https://github.com/EveryInc/compound-engineering-plugin) 🤖 Generated with Claude Opus 4.7 (1M context, extended thinking) via [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| billed_token_counts_round_trip.rs | ||
| command_termination_round_trip.rs | ||
| diff_stats_round_trip.rs | ||
| diff_summary_round_trip.rs | ||
| event_envelope_round_trip.rs | ||
| git_context_round_trip.rs | ||
| interview_option_round_trip.rs | ||
| interview_question_record_round_trip.rs | ||
| model_costs_round_trip.rs | ||
| model_features_round_trip.rs | ||
| model_limits_round_trip.rs | ||
| model_round_trip.rs | ||
| model_test_mode_round_trip.rs | ||
| pending_interview_record_round_trip.rs | ||
| permission_level_round_trip.rs | ||
| pre_run_push_outcome_round_trip.rs | ||
| principal_round_trip.rs | ||
| provider_id_round_trip.rs | ||
| provider_round_trip.rs | ||
| pull_request_round_trip.rs | ||
| question_type_round_trip.rs | ||
| run_billing_stage_round_trip.rs | ||
| run_event_round_trip.rs | ||
| run_failure_round_trip.rs | ||
| run_integrations_round_trip.rs | ||
| run_projection_round_trip.rs | ||
| run_sandbox_round_trip.rs | ||
| run_summary_round_trip.rs | ||
| sandbox_details_round_trip.rs | ||
| sandbox_services_round_trip.rs | ||
| secret_metadata_round_trip.rs | ||
| secret_type_round_trip.rs | ||
| server_settings_round_trip.rs | ||
| stage_completion_round_trip.rs | ||
| stage_handler_round_trip.rs | ||
| stage_outcome_round_trip.rs | ||
| stage_projection_round_trip.rs | ||
| stage_state_round_trip.rs | ||
| status_round_trip.rs | ||
| submit_answer_request_round_trip.rs | ||
| workflow_settings_round_trip.rs | ||