← Back to Pull requests

Added contributors image caching mechanism #550

Closed
SantamRC closed this pull request without merging on Jun 07, 2026 14:18 UTC
View on GitHub
SantamRC SantamRC commented on Mar 23, 2026 15:51 UTC
Author

This PR adds contributors image caching mechanism in the about page using cached_network_image.

Presently in the about page, Images were downloaded fresh on every page visit and Contributors' avatars had to be fetched from GitHub's servers each time. Also Images wouldn't display if the network was unavailable.

This mechanism solves these issues

Diff: 15 lines (+10 / -5) across 2 files Reviewer: magic-peach Review duration: 109347m
All Vouch review confidence checks passed
Residual risk 0.03 = Change Risk (0.21) × (1 − Review Confidence (0.84)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.21 · 15 lines diff across 2 files
0.21
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.71 · 3 substantive comment(s)
0.71
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
83%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.166
Real PR Conversation Timeline
6 items
netlify[bot] netlify[bot] commented on Mar 23, 2026 15:51 UTC
Bot

<span aria-hidden="true">✅</span> Deploy Preview for cv-mobile-app-web ready!

| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 9c6931c0c7717814638c6aaadcedc3313c13e790 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/cv-mobile-app-web/deploys/69c1616d3b046b000868ff8d |
|<span aria-hidden="true">😎</span> Deploy Preview | https://deploy-preview-550--cv-mobile-app-web.netlify.app |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />!QR Code<br /><br />_Use your smartphone camera to open QR code link._</details> |
---
<!-- cv-mobile-app-web Preview -->
_To edit notification comments on pull requests, go to your Netlify project configuration._

Copilot Copilot commented on code on Mar 23, 2026 15:54 UTC
Code Review
pubspec.yaml:1
@@ -63,6 +63,7 @@ dependencies:
   markdown: any
   webview_flutter: 4.13.1
   flutter_quill: ^11.4.2
+  cached_network_image: ^3.4.1

cached_network_image was added to pubspec.yaml, but pubspec.lock is not updated in this PR. Since this repo commits pubspec.lock, please run flutter pub get and commit the resulting lockfile changes to keep dependency resolution reproducible across CI/dev machines.

Copilot Copilot commented on code on Mar 23, 2026 15:54 UTC
Code Review
lib/ui/views/about/components/contributor_avatar.dart:1
@@ -24,13 +24,17 @@ class ContributorAvatar extends StatelessWidget {
           ),
           child: ClipRRect(
             borderRadius: BorderRadius.circular(24),
-            child: FadeInImage.memoryNetwork(
-              placeholder: kTransparentImage,
-              image: contributor.avatarUrl,
+            child: CachedNetworkImage(
+              imageUrl: contributor.avatarUrl,
+              placeholder: (context, url) => Container(
+                color: Colors.grey[300],
+              ),
+              errorWidget: (context, url, error) => const Icon(Icons.error),
+              fit: BoxFit.cover,
             ),

This avatar renders at ~50px but CachedNetworkImage will typically decode/cache the full-size GitHub avatar unless you constrain decode dimensions. Consider setting width/height on the image and using memCacheWidth/memCacheHeight (and/or disk cache sizing) based on the widget size/devicePixelRatio to reduce memory use and improve scroll performance when many contributors are shown.

copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Mar 23, 2026 15:54 UTC
Reviewer

Pull request overview

Adds disk/memory caching for contributor avatar images on the About page to avoid re-downloading on each visit and improve offline behavior.

Changes:

  • Add cached_network_image dependency.

  • Replace FadeInImage.memoryNetwork with CachedNetworkImage for contributor avatars (with placeholder/error UI).
  • Reviewed changes

    Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

    | File | Description |
    | ---- | ----------- |
    | pubspec.yaml | Adds cached_network_image to enable avatar caching. |
    | lib/ui/views/about/components/contributor_avatar.dart | Switches avatar rendering to CachedNetworkImage with placeholder/error handling. |

    ---

    💡 <a href="/CircuitVerse/mobile-app/new/master?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.

    magic-peach magic-peach approved these changes on May 25, 2026 04:33 UTC
    Approved Reviewer

    Straightforward improvement. CachedNetworkImage gives persistent disk caching, which means avatars survive across sessions and load instantly on repeat visits. The placeholder and error widget are both correctly handled.

    Reviewers
    Assignees
    SantamRC SantamRC
    Labels
    risk: low confidence: 83.6% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 21% (LOW) · Higher = larger blast radius
    21%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 83.6% · Lower = rushed or shallow review
    83.6%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 3.5% · Safe to merge
    3.5%