-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat(ui): Change default language for Resource Editor to YAML and store preference in localStorage. Fixes #3543 #3560
Conversation
…uto-completion more prominent. Store preference in localStorage.
Thank you. I think we can keep the note as a footer. I think the text could just be. "Basic completion for YAML. Switch to JSON for full auto-completion" The YAML button has been bugging me for ages - it looks bad. Can we replace the YAML buttons check box with |
Here's what I came up with. I also tweaked the editor container itself, which I think may fix #3542 as well (will need to confirm). The font was also set to Courier / monospace which wasn't being applied to the code itself but rather the right click menu, so I changed that as well: |
perfect |
private static getLang(): string { | ||
const stored = localStorage.getItem(LOCAL_STORAGE_KEY); | ||
if (stored !== null) { | ||
if (stored === 'yaml' || stored === 'json') { |
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.
good guard condition here
} | ||
|
||
private set type(type: string) { | ||
this.setState({type, value: stringify(parse(this.state.value), type)}); | ||
private static getLang(): string { |
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.
maybe loadLang
?
} | ||
|
||
&__lang-toggle { |
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 avoid creating a new style like this - I think the existing "-o" style is acceptable
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.
could you use a different (empty?) icon for unchecked?
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 didn't love how the empty icon for unchecked looked so I used an "x" instead. Does the job
Also makes note about auto-completion more prominent:
Checklist:
"fix(controller): Updates such and such. Fixes #1234"
.Fixes #3543