Skip to content

fix: refine mention badge layout and add missing-avatar fallback - #1160

Open
brendenchu wants to merge 2 commits into
dev-null-sh:productionfrom
brendenchu:fix/mention-badge-styling
Open

brendenchu wants to merge 2 commits into
dev-null-sh:productionfrom
brendenchu:fix/mention-badge-styling

Conversation

@brendenchu

@brendenchu brendenchu commented Oct 26, 2026 •

Copy link
Copy Markdown

Summary

GitHub mention badges in bios and company fields had uneven horizontal padding and a text baseline offset from the surrounding prose. Tighten the badge proportions, align the username baseline with the text, and show an @ fallback when an avatar cannot load.

Changes

  • Use the smaller padding equally on both sides, reduce the avatar-to-name gap, and scale both corner radii with the text.
  • Align the username baseline with the surrounding prose while keeping the avatar centered.
  • Inherit the surrounding text color and truncate long handles within the available width.
  • Reveal a decorative CSS @ when an avatar fails, preserving copied mention text. Remount the image when its GitHub URL changes so a previous failure cannot hide a new avatar.

The shared component renders profile bios, company fields, sidebar bios, and preview bios. No preview content, database changes, or screenshot assets are included in this code branch.

Validation

Local validation completed successfully in Docker. The local development image includes OpenSSH and a named user matching its configured UID/GID; the test environment explicitly sets the upstream repository expected by the GitHub mocks. These environment fixes are outside this application PR.

docker compose -f compose.yaml build app
docker compose -f compose.yaml config --quiet
docker compose -f compose.yaml run --rm --no-deps \
  -e APP_ENV=testing -e DB_DATABASE=testing -e DB_URL= \
  -e CACHE_STORE=array -e SESSION_DRIVER=array -e MAIL_MAILER=array \
  -e INERTIA_SSR_ENABLED=false \
  -e GITHUB_REPOSITORY=dev-null-sh/dev-null.sh \
  -e XDEBUG_MODE=coverage app composer test
  • Full composer test — passed, exit 0.
  • PHP: 4,300 tests passed, 24,126 assertions; 100% code coverage and 100% type coverage.
  • Frontend: 46 test files passed, plus 162 Node tests passed, zero failures.
  • Formatting and static checks completed successfully; frontend lint reported 17 warnings and zero errors.
  • Focused bio component check: docker compose -f compose.yaml run --rm --no-deps app bun x vp test run tests/Unit/BioText.test.tsx — 4 tests passed.
  • Focused lint: docker compose -f compose.yaml run --rm --no-deps app bun x vp lint resources/js/components/bio-text.tsx — no warnings or errors.
  • git diff --check — passed.

Headless Chrome checked the same seeded guest profile before and after, in both themes at 1440×1000 and 390×1000. A baseline probe measured the first mention's offset from the prose at 0.828125px before and 0px after in all four configurations. Computed bio line-height remained 24.375px and badge height remained 21.609375px. No horizontal viewport overflow was observed. The company-row alignment causes a small, approximately 2px upward shift in following content; this is not a claim of zero layout change globally.

Visual evidence

Before/after screenshots of the same seeded guest profile, independently reviewed as media revision capture-v1. Before: 3ceaefa6745d8fa5d6376213521221b44136bd4b. After: 1a30db3428d5ffec70272b040ab055d82c4d5ab4. Assets are hosted separately from the code branch at commit 55a68da7775146c05fd3a4328d452003ae9af4ba.

Profile bio and company field Before After
Desktop, 1440×1000, light Before Desktop, 1440×1000, light After Desktop, 1440×1000, light
Desktop, 1440×1000, dark Before Desktop, 1440×1000, dark After Desktop, 1440×1000, dark
Mobile emulation, 390×1000, light Before Mobile emulation, 390×1000, light After Mobile emulation, 390×1000, light
Mobile emulation, 390×1000, dark Before Mobile emulation, 390×1000, dark After Mobile emulation, 390×1000, dark

Simulated avatar failure, desktop dark: GitHub avatar requests were aborted. The image became hidden and the CSS @ remained visible without a broken-image indicator.

Simulated avatar failure, desktop dark

Captured layout metrics. No recording was captured; the change concerns static badge rendering.

Device verification

Headless Google Chrome 156.0.8078.47 on macOS 27.0.1, desktop and mobile viewport emulation; no physical-device or simulator testing. Captures use fresh page loads, with a reload for the simulated avatar failure. There are no new input fields or primary actions. On-screen keyboard, notch/safe-area hardware, touch interactions, scrolling, and client-side transitions were not verified.

Independent review

Independent Codex reviewer /root/review_badge: CODE: PASS, VISUAL: PASS for base 3ceaefa6745d8fa5d6376213521221b44136bd4b → head 1a30db3428d5ffec70272b040ab055d82c4d5ab4, media capture-v1 / 55a68da7775146c05fd3a4328d452003ae9af4ba.

The reviewer examined the component, all four callers, existing tests, all nine screenshots, and captured layout metrics. Review identified and resolved stale hidden-image styling on username changes by keying the image by its URL. No remaining findings within that scope.

Limitations

  • Visual evidence covers the guest profile bio and company field. Signed-in sidebar and user-preview popover were inspected in source but not captured in-browser.
  • Hover/focus states, extremely long handles, real devices, and interactive mobile behavior were not visually verified.
  • Review and before screenshots use the originating branch base. Upstream production was 64ab4a65c2353ed0e633cb6c2805e4565ea58603 when preparing the PR; its two intervening commits do not edit this component.
  • Hosted CI results are separate from these local checks.

Summary by CodeRabbit

  • Bug Fixes
    • GitHub mention badges have an updated layout. If an avatar fails to load, an “@” fallback appears in its place while the handle remains separate badge text. The fallback is hidden from assistive technologies, helping keep the mention’s accessible presentation clear.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 59b86abc-937e-4ced-bf6e-369b59013077
Commits

Reviewing files that changed from the base of the PR and between 1a30db3 and 601049c.

Files selected for processing: 1
  • resources/js/components/bio-text.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The GitHub mention badge layout changed. Its avatar container provides an @ fallback, which appears when the avatar image errors. The handle remains separate badge text.

Changes: GitHub mention badge

Layer / File(s) Summary
Badge presentation and avatar fallback
resources/js/components/bio-text.tsx
The badge styling changed. The avatar container provides an @ fallback marked aria-hidden. If the image errors, the component hides it to reveal the fallback.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: xheaven, 0z3

Merge Risk: Minimal · up to 60104

The mention badge preserves copied handle text and provides the intended decorative avatar fallback without an established merge-blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the two main changes: the refined mention badge layout and the missing-avatar fallback. Both appear in the file summary (bio-text.tsx badge layout changes and the aria-hidden avatar @ …
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the two main changes: the refined mention badge layout and the missing-avatar fallback. Both appear in the file summary (bio-text.tsx badge layout changes and the aria-hidden avatar @ fallback) and in the PR objectives. The title is concise, specific, and follows the conventional prefix style. It does not mention the remount on URL change or truncation, but those are secondary details.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@brendenchu
brendenchu marked this pull request as ready for review October 26, 2026 01:46
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