Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#8076: add starter mod sidebar panels to closedtabs on install #8083

Conversation

grahamlangford
Copy link
Collaborator

@grahamlangford grahamlangford commented Mar 28, 2024

What does this PR do?

Reviewer Tips

  • Moved some files from @/sidebar to @/store/sidebar because they're needed in @/background

Discussion

Demo

https://www.loom.com/share/ea9510086b1346808ee289e5a8419d2f

Remaining Work

  • Tests

Checklist

  • Add tests and/or storybook stories
  • Designate a primary reviewer @BLoe

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.21%. Comparing base (84cf0c8) to head (0fb0e37).

❗ Current head 0fb0e37 differs from pull request most recent head 5fb913c. Consider uploading reports for the commit 5fb913c to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8083      +/-   ##
==========================================
- Coverage   73.33%   73.21%   -0.13%     
==========================================
  Files        1309     1312       +3     
  Lines       40699    40773      +74     
  Branches     7566     7569       +3     
==========================================
+ Hits        29848    29852       +4     
- Misses      10851    10921      +70     

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

@twschiller twschiller added enhancement New feature or request user experience Improve the user experience (UX) labels Mar 28, 2024
@twschiller twschiller added this to the 1.8.12 milestone Mar 28, 2024
@grahamlangford grahamlangford marked this pull request as ready for review March 28, 2024 18:13
Copy link
Collaborator

@BLoe BLoe left a comment

Choose a reason for hiding this comment

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

Just some naming nits and a question about redux-persist typing, but looks good otherwise 👍

src/background/starterMods.ts Outdated Show resolved Hide resolved
* @param activatedModComponents the activated mod components
* @param modComponentDefinitions the mod component definitions
*/
export function getModComponentIdsForModComponentDefinitions(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should use a different prefix here rather than get* since this isn't "fetching" anything. Generally I think we use select* in cases like this where it's just unpacking something from the inputs and returning a different data structure?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

All of the other functions in this file were prefixed with get, so I was maintaining consistency. I wouldn't think that get would necessarily signify fetching and I'm used to select being used for redux selectors.

@@ -56,6 +57,10 @@ function eventKeyForEntry(entry: Nullishable<SidebarEntry>): string | null {

export { eventKeyForEntry };

export function getEventKeyForPanel(modComponentId: UUID): string {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again, not sure we should use get* here since it's more just "calculating" something, not fetching. What about just eventKeyForPanel()?


// The subset of the sidebar state that we persist
// See persistSidebarConfig.whitelist
type SidebarPeristedState = Pick<SidebarState, "closedTabs">;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Technically I think this should be Pick<SidebarState, "closedTabs"> & PersistedState. I think the code here is fine, since you are spreading the whole state back onto the result/return, but I just wouldn't want someone to accidentally trim off the _persist field and mess up the redux-persist migrations somehow.

Copy link

github-actions bot commented Apr 1, 2024

When the PR is merged, the first loom link found on this PR will be posted to #sprint-demo on Slack. Do not edit this comment manually.

Co-authored-by: Ben Loe <below413@gmail.com>
@grahamlangford grahamlangford enabled auto-merge (squash) April 1, 2024 14:50
@grahamlangford grahamlangford merged commit 83fd174 into main Apr 1, 2024
18 checks passed
@grahamlangford grahamlangford deleted the 8076-slice-1-add-starter-mod-sidebar-panels-to-closedtabs-on-install branch April 1, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request user experience Improve the user experience (UX)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slice 1: Add starter mod sidebar panels to closedTabs on install
5 participants