feat(profile): default spectrum tab preference for NMRium viewers#1467
Open
vcnainala wants to merge 1 commit into
Open
feat(profile): default spectrum tab preference for NMRium viewers#1467vcnainala wants to merge 1 commit into
vcnainala wants to merge 1 commit into
Conversation
Store per-user preferences as JSON on users, expose a profile form and an inline selector to pick a default 1D/2D spectrum tab, validate the value through a form request against the new DefaultSpectrumTab enum, and apply the preferred tab when NMRium loads in the editor, viewer and snapshot components (with postMessage now scoped to the NMRium origin instead of *).
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## development #1467 +/- ##
=================================================
+ Coverage 76.59% 76.63% +0.03%
- Complexity 3593 3611 +18
=================================================
Files 250 253 +3
Lines 13521 13575 +54
=================================================
+ Hits 10357 10403 +46
- Misses 3164 3172 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
preferencescolumn tousersand aDefaultSpectrumTabenum (1D/2D nuclei tabs), with accessor/mutator helpers on theUsermodel.PUT /user/preferencesendpoint (auth + verified, rate limited) validated throughUpdateUserPreferencesRequest; available tab options are shared with the frontend via Inertia props.postMessagecalls now target the resolved NMRium origin instead of"*", and incoming messages are checked against an allow-list of origins.Test plan
sail artisan test tests/Feature/UserPreferencesTest.php(9 passed)npm run build/npm run devafter merge to see the UI changes