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

feature(redux-devtools-inspector-monitor): sorted state tree #1264

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

kentkwee
Copy link
Contributor

@kentkwee kentkwee commented Nov 1, 2022

This pull request adds the options to sort the state tree alphabetically, and the option to prevent collecting object keys together.

Partially solves #433

@changeset-bot
Copy link

changeset-bot bot commented Nov 1, 2022

🦋 Changeset detected

Latest commit: 5d46901

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
remotedev-redux-devtools-extension Minor
@redux-devtools/inspector-monitor Minor
@redux-devtools/inspector-monitor-test-tab Major
@redux-devtools/inspector-monitor-trace-tab Major
@redux-devtools/app Patch
test-demo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines 25 to 37
useEffect(() => {
if (!chrome || !chrome.storage) return;
const storage = isFF
? chrome.storage.local
: chrome.storage.sync || chrome.storage.local;
storage.get(
['sortStateTreeAlphabetically', 'disableStateTreeCollection'],
function (result) {
setSortObjectKeys(!!result.sortStateTreeAlphabetically);
setDisableCollection(!!result.disableStateTreeCollection);
}
);
}, []);
Copy link
Member

@Methuselah96 Methuselah96 Nov 6, 2022

Choose a reason for hiding this comment

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

Can we make it so these are props instead? Only the extension itself should be reading/writing settings from storage. It should then pass those settings down as props to the monitor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Will adjust it in the following days.

invertTheme={invertTheme}
hideRoot
sortObjectKeys={sortObjectKeys}
{...(disableCollection ? { collectionLimit: 0 } : {})}
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain what the use case for this option is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the state does have a lot of keys they are collapsed. This option prevents this.

collectionLimit: number - sets the number of nodes that will be rendered in a collection before rendering them in collapsed ranges

@kentkwee
Copy link
Contributor Author

kentkwee commented Nov 7, 2022

I implemented the changes and replaced the options page. The settings are managed in the state now.

@kentkwee
Copy link
Contributor Author

kentkwee commented Jan 8, 2023

I have rebased the pull request.

…ree alphabetically and/or disable collections
@kentkwee
Copy link
Contributor Author

kentkwee commented Apr 8, 2023

@Methuselah96 Could you have a look again and tell me what's missing to get this merged?

Copy link
Member

@Methuselah96 Methuselah96 left a comment

Choose a reason for hiding this comment

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

Thanks for your patience and willingness to work on this. Looks good.

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.

2 participants