Skip to content

Comments

Split event handling and chrome.storage saving in extensions options …#2712

Merged
RobbieTheWagner merged 1 commit intoemberjs:mainfrom
trek:trek/split-options-setting-and-options-saving
Feb 21, 2026
Merged

Split event handling and chrome.storage saving in extensions options …#2712
RobbieTheWagner merged 1 commit intoemberjs:mainfrom
trek:trek/split-options-setting-and-options-saving

Conversation

@trek
Copy link
Member

@trek trek commented Feb 20, 2026

Description

Extracting a bit of code from a larger piece of work to make it more reviewable.

For the extensions modal below:
CleanShot 2026-02-20 at 13 54 54@2x

This PR splits the event handling toggling the Tomster icon from its persistence to chrome.storage. This is required because of the shape of what we store.

This shape:

{
  options: {
    showTomster: true
  }
}

means that any update to other values we'd like to store in options must be merged with any existing values we want to retain. It's not been a problem so for because we're only saving a single value. However, if we add another option (the proposed selectedEditor) and don't first grab the stored options, we'd blow them away.

We could go with a structure like

{
  options: {
    showTomster: true
  },
  selectedEditor: <whatever value here>
}

and skip the round-tripping / merge and use a pattern where the event handler also stores, but I wasn't sure if we wanted to add more properties to the root object stored or wanted to keep that clean and store all things

@trek trek marked this pull request as ready for review February 20, 2026 20:21
Copy link
Contributor

@NullVoxPopuli NullVoxPopuli left a comment

Choose a reason for hiding this comment

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

much better API, nice work

@RobbieTheWagner RobbieTheWagner merged commit 7f41f62 into emberjs:main Feb 21, 2026
16 checks passed
@github-actions github-actions bot mentioned this pull request Feb 21, 2026
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