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

refactor: improve styles in shortcut hint #4588

Merged
merged 6 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions packages/frontend/scss/misc/_keyboard_hint_box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.keyboard-hint-cheatsheet-dialog {
.keybinding {
display: block;
margin-bottom: 7px;
padding: 7px 0;

.key {
background: var(--keybindingKeyBackground);
Expand Down Expand Up @@ -47,25 +47,29 @@
}

.keyboard-hint-cheatsheet-dialog {
width: 70% !important;
.keybinding {
display: block;
flex-grow: 1;
font-size: 0.84em;
margin-bottom: 0;
}
h4 .keybinding {
flex: none;
margin-left: 20px;
}
.dialog-body {
padding-bottom: 0;
}
.keyboard-hint-dialog-body {
display: flex;
flex-wrap: wrap;
flex-direction: column;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't you think the column order is better? To me it seems intuitive to read it top-to-bottom. And there are no sections that are extra wide:

image

Copy link
Member Author

Choose a reason for hiding this comment

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

If a set that it will result in just one long column which is definitely not better. Or we need 2 columns in the template. But tbh that (and this discussions about edge cases in a rarely used screen) seems a bit overdone for me.

But feel free to add a commit with better styling that fix your concerns :-)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh. I get it. We have column order on main.

padding: 4px;
max-height: 600px;
justify-content: space-evenly;
padding: 20px;
max-height: 80vH;

.action {
max-width: 240px;
width: calc(50% - 7px);
margin-right: 7px;
width: calc(50% - 15px);
margin: 7px;
padding: 10px;
}

h2 {
Expand Down
14 changes: 12 additions & 2 deletions packages/frontend/src/components/KeyboardShortcutHint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,19 @@ function Shortcut(action: ShortcutAction): CheatSheetEntryType {

export function CheatSheetKeyboardShortcut() {
if (runtime.getRuntimeInfo().isMac) {
return <KeyboardShortcut elements={['Meta', '/']} />
return (
<>
<KeyboardShortcut elements={['Meta', '/']} />
<KeyboardShortcut elements={['Meta', '-']} />
</>
)
} else {
return <KeyboardShortcut elements={['Control', '/']} />
return (
<>
<KeyboardShortcut elements={['Control', '/']} />
<KeyboardShortcut elements={['Control', '-']} />
WofWca marked this conversation as resolved.
Show resolved Hide resolved
</>
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function KeybindingCheatSheet(props: DialogProps) {
<CheatSheetKeyboardShortcut />
</DialogHeading>
</DialogHeader>
<DialogBody>
<DialogBody className='dialog-body'>
<div className='keyboard-hint-dialog-body'>
{settingsStore &&
getKeybindings(settingsStore.desktopSettings).map(entry => {
Expand Down
Loading