-
Notifications
You must be signed in to change notification settings - Fork 370
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
change: [M3-7785] - Improve Dev Tools #10220
Conversation
|
||
setMockTheme(selectedValue); | ||
setStorage(MOCK_THEME_STORAGE_KEY, selectedValue); | ||
window.location.reload(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching theme is not going to be as common as toggling or flags. I opted to no add this to redux as there is not a lot of value there and it would increase the complexity of this feature by a lot.
#dev-tools:hover { | ||
height: 325px; | ||
height: 375px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
increasing the height here a bit to allow for more room and the new reset button
<div className={isMSWEnabled ? 'mswEnabled' : ''} id="dev-tools"> | ||
<div> | ||
<Handyman /> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this way we can color it with CSS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also/or add text to indicate the MSW is "on"? For accessibility, color should not be the only indicator haha
abuseTicket, | ||
emailBounce, | ||
// abuseTicket, | ||
// emailBounce, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that these are annoying. I don't think I'll miss them, but not sure if anyone else on the team has a reason behind why they have historically been kept visible by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels to me like something that was implemented at once and never changed to no particular reason. If anyone is affected I will add them back but I doubt it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
href="/profile/settings?preferenceEditor=true" | ||
style={{ color: '#fff' }} | ||
> | ||
Open preference Modal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this. ++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is from @jaalah-akamai!
abuseTicket, | ||
emailBounce, | ||
// abuseTicket, | ||
// emailBounce, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that these are annoying. I don't think I'll miss them, but not sure if anyone else on the team has a reason behind why they have historically been kept visible by default.
Coverage Report: ✅ |
@mjac0bs yes I could see it if I turned on always show scrollbar in my OS I fixed it too! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this!
I did get a bit confused at first when I tried setting a theme and nothing happened because I had the MSW off.
I wonder if we should somehow indicate that this theme selector is only for when the MSW is on. Or maybe we could make Cloud Manager respect the override even when the MSW if off.
@bnussman-akamai fair enough - it's in the documentation but I'll add it to the label as well) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only other feature I can think of would be a button that clears all local storage and reloads the page.
It's relatively easy to do this in the browser's dev tools, but I don't think it would hurt to put in our own dev tools.
@bnussman-akamai I'll hold on that item cause it has implications and we'd need to pick and choose what to clear. I'd rather leave that to the developer's discretion. Besides, clearing ALL local storage will log you out (I think?) |
@abailly-akamai Yaya, that's kind of the point. Clearing local storage is super useful for debugging things like our login redirect logic for example. It won't log you out necessarily. I'm cool either way. I've never had a problem opening dev tools to do this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, have we also considered what support for toggling object feature flags would look like?
@@ -75,6 +84,9 @@ export const FeatureFlagTool = withFeatureFlagProvider(() => { | |||
</div> | |||
); | |||
})} | |||
<button onClick={resetFlags} style={{ marginTop: 8 }}> | |||
Reset default flags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reword this to Reset to LaunchDarkly default flags
for more clarity?
Reset default flags | |
Reset to LaunchDarkly default flags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I almost made this same comment, then deleted it, and asked for a code comment, ha. I do still think it would be nice.
I was thinking of (1) more text requiring further height increase of the dev tools panel and (2) whether we'd want to specify LD if to save some trouble of updating it if we were to switch to another tool in the future - but really that's such an easy change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same brain cell 🧠 . (1) We can shorthand to LD to save some width space (2) Agreed
<div className={isMSWEnabled ? 'mswEnabled' : ''} id="dev-tools"> | ||
<div> | ||
<Handyman /> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also/or add text to indicate the MSW is "on"? For accessibility, color should not be the only indicator haha
ce31aee
to
eb1140a
Compare
@hana-linode I want to avoid taking extra real estate on the page with the dev tools badge, so I made the expanded MSW |
Description 📝
This PR brings non-breaking, minor improvement to the dev tools.
Changes 🔄
serverHandlers.ts
Preview 📷
How to test 🧪
Verification steps
yarn up
your applicationAs an Author I have considered 🤔
Check all that apply