Skip to content

Refresh a project favicon when its icon is clicked - #4337

Closed
colonelpanic8 wants to merge 2 commits into
pingdotgg:mainfrom
colonelpanic8:feat/favicon-reload-on-click
Closed

colonelpanic8 wants to merge 2 commits into
pingdotgg:mainfrom
colonelpanic8:feat/favicon-reload-on-click

Conversation

@colonelpanic8

@colonelpanic8 colonelpanic8 commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

What Changed

Clicking a project icon now re-issues its asset URL, so the sidebar picks up an icon that changed on disk without reloading the app.

Project favicon asset URLs are signed tokens that bake in the file the server resolved when the URL was minted. Cache-busting that URL is not enough: it keeps pointing at the file the server found last time. And a project with no icon renders a placeholder rather than an <img>, so previously there was no target to click at all — a project that just gained an icon could never pick it up.

  • apps/web/src/assets/assetUrls.ts: new useRefreshAssetUrl hook that refreshes the assets.createUrl query for a resource, making the server resolve it again and mint a freshly signed URL.
  • apps/web/src/components/ProjectFavicon.tsx: clicking the icon — or the placeholder — refreshes it. Because every instance of a project's icon shares one query, they all refresh together. Dropped the key={src} remount so a refresh swaps the <img> source in place and the loaded image stays on screen while the new bytes decode, instead of flashing back to the placeholder.

The click is deliberately not consumed (stopPropagation is avoided), so pressing an icon in a sidebar row still opens the row as before.

Why

When a project's favicon changes, the sidebar icon stays stale until the app reloads. Click-to-refresh gives a direct way to pull the current icon in place — including the common case where a project only just got an icon and was showing the folder placeholder.

UI Changes

Verified live against a real project in an isolated dev environment, in the sidebar v2 project selector. Screenshots are cropped from the sidebar and upscaled 3× so the 14px icon is legible.

Step Sidebar
Baseline: project icon is favicon.svg (red) baseline
Icon replaced on disk at a different path (favicon.svg deleted, app/icon.svg added, blue) — still stale before the click stale
After clicking the icon — served file moved from favicon.svg to app/icon.svg, which cache-busting alone could not do refreshed
Icon deleted on disk, then clicked — falls back to the placeholder placeholder
New favicon.svg (green) added, then the placeholder clicked — the icon appears recovered

The last row is the case the icon-only click handler could not reach: with no <img> rendered, there was nothing to click.

Checklist

  • vp test run packages/client-runtime/src/state/assets.test.ts (5 passed, incl. new refresh-forwarding case)
  • vp run --filter @t3tools/web --filter @t3tools/client-runtime typecheck
  • vp lint apps/web/src packages/client-runtime/src (no new findings)
  • vp fmt
  • Integrated browser verification in an isolated dev environment: project icon added/replaced/moved/deleted on disk and refreshed by clicking, with the served asset path confirmed in the DOM

🤖 Generated with Claude Code

Note

Refresh a project favicon by clicking its icon

  • Adds a useRefreshAssetUrl hook in assetUrls.ts that returns a callback to manually re-issue an asset URL query for a given environment and resource.
  • Wires that refresh callback to onClick on both the favicon image and the fallback placeholder in ProjectFavicon.tsx, so clicking either triggers a server re-resolve of the project icon.
  • Changes the image key from the asset URL to ${environmentId}:${cwd}, keeping the image mounted across URL refreshes while still remounting when switching projects.

Macroscope summarized 37604c9.


Note

Low Risk
Localized UI and asset-query refresh behavior with no auth, data, or API contract changes.

Overview
Clicking a project favicon (or its folder placeholder) now re-issues the signed asset URL so the server resolves the icon from disk again, picking up adds, moves, deletes, or replacements without reloading the app.

Adds useRefreshAssetUrl in assetUrls.ts, wired through useAtomRefresh on the shared assets.createUrl query so every instance of that project’s icon refreshes together. ProjectFavicon attaches the refresh handler to both the <img> and the placeholder (via a contents wrapper), and leaves clicks bubbling so sidebar row navigation still works.

The image component key is now ${environmentId}:${cwd} instead of src, so a URL refresh keeps the current image visible while new bytes load instead of remounting and flashing the placeholder. A client-runtime test asserts the asset URL atom exposes a refresh hook for manual re-issue.

Reviewed by Cursor Bugbot for commit 37604c9. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8a8cbfba-ab62-4465-a9fa-7a50a720c1e0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jul 23, 2026
Comment thread apps/web/src/components/ProjectFavicon.tsx
Comment thread apps/web/src/components/ProjectFavicon.tsx Outdated
Comment thread apps/web/src/components/ProjectFavicon.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This PR adds a simple UI enhancement: clicking a project favicon refreshes its asset URL. The change is small, self-contained, well-documented with comments, and includes test coverage. No security or schema implications.

You can customize Macroscope's approvability policy. Learn more.

@colonelpanic8
colonelpanic8 force-pushed the feat/favicon-reload-on-click branch from 539a53c to 037a276 Compare July 23, 2026 16:11
Comment thread apps/web/src/components/ProjectFavicon.tsx Outdated
@colonelpanic8
colonelpanic8 force-pushed the feat/favicon-reload-on-click branch from 037a276 to 4bd7623 Compare July 23, 2026 16:15
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Jul 23, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jul 23, 2026
@colonelpanic8
colonelpanic8 force-pushed the feat/favicon-reload-on-click branch 7 times, most recently from 709407d to 91fdee1 Compare July 24, 2026 01:41
@macroscopeapp
macroscopeapp Bot dismissed their stale review July 24, 2026 01:41

Dismissing prior approval to re-evaluate 91fdee1

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Jul 24, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jul 24, 2026
@colonelpanic8
colonelpanic8 force-pushed the feat/favicon-reload-on-click branch 4 times, most recently from fa4c785 to af165bf Compare July 24, 2026 22:32
@macroscopeapp
macroscopeapp Bot dismissed their stale review July 24, 2026 22:32

Dismissing prior approval to re-evaluate af165bf

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jul 24, 2026
@colonelpanic8
colonelpanic8 force-pushed the feat/favicon-reload-on-click branch from af165bf to c5dfaca Compare July 24, 2026 23:11
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
@colonelpanic8
colonelpanic8 force-pushed the feat/favicon-reload-on-click branch from bf76e6c to 0152dc7 Compare July 27, 2026 11:14
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 27, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 28, 2026
@colonelpanic8
colonelpanic8 force-pushed the feat/favicon-reload-on-click branch from 0152dc7 to e28a726 Compare July 28, 2026 02:07
@macroscopeapp
macroscopeapp Bot dismissed their stale review July 28, 2026 02:07

Dismissing prior approval to re-evaluate e28a726

colonelpanic8 and others added 2 commits July 27, 2026 19:46
Project favicon asset URLs are signed tokens that bake in the file the
server resolved when the URL was minted, so a project whose icon changed
on disk keeps showing the old one until the app reloads. Worse, a project
with no icon renders a placeholder rather than an <img>, so there was no
way at all to pick up an icon it just gained.

Clicking a project icon now re-issues its asset URL. The server resolves
the project's icon again, so a newly added, replaced, or moved icon is
picked up, and the freshly signed URL also gets the browser past its
cached copy. The placeholder is clickable too, and because every instance
of a project's icon shares one query, they all refresh together.

The click is not consumed, so pressing an icon in a sidebar row still
opens the row as before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@colonelpanic8
colonelpanic8 force-pushed the feat/favicon-reload-on-click branch from e28a726 to 37604c9 Compare July 28, 2026 02:50
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 28, 2026
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 28, 2026
@t3dotgg

t3dotgg commented Aug 28, 2026

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

Clicking a favicon to refresh it is hidden behavior that users cannot discover. It adds query-refresh state for an uncommon stale-icon case that a reload already fixes.

If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

@t3dotgg t3dotgg closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants