Skip to content

Conversation

@david-mears-2
Copy link
Contributor

@david-mears-2 david-mears-2 commented Dec 10, 2025

If a data file has been requested already, this dict should prevent us from making the request again.

Using shallowRef to prevent Vue trying to watch the (very large) Object values.

@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.07%. Comparing base (b368f37) to head (dda3494).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/components/RidgelinePlot.vue 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #14      +/-   ##
==========================================
+ Coverage   93.84%   94.07%   +0.22%     
==========================================
  Files           9        9              
  Lines         130      135       +5     
  Branches       39       41       +2     
==========================================
+ Hits          122      127       +5     
  Misses          8        8              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from load-data to main December 10, 2025 12:19
Copy link
Contributor

@EmmaLRussell EmmaLRussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea to use shallowRef - I don't think that existed when we used the freeze technique in HINT!


const fetchErrors = ref<{ e: Error, message: string }[]>([]);
const histogramData = ref<DataRow[]>([]);
const histogramDataCache = shallowRef<Record<string, DataRow[]>>({});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the cache needs to be a ref, shallow or otherwise.. The dict object reference itself isn't going to change and shouldn't need to be reactive..

But I think the histogramData is a perfect candidate to be a shallowRef since its top level reference will change every time the data selections change, but then the whole data structure should be fixed subsequently, so doesn't need to be deeply reactive/

Also, I really would be inclined to put both histogramData and histogramDataCache into the appStore, which is designed to be a shared data store. At the moment, if you were to call useData from multiple places in the code, you would end up with multiple copies of the data. I know that's not the plan but it still feels a bit worrisome... I think it's fine to still manage the fetching and caching from useData if you want to.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now made a separate dataStore rather than put this all into the appStore, since I am worried about the appStore growing too big.

Copy link
Contributor

@EmmaLRussell EmmaLRussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks good.

@david-mears-2 david-mears-2 merged commit 12b2a84 into main Dec 16, 2025
4 checks passed
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.

3 participants