ux: hide search kbd hint after first keyboard use (long loop)
This commit is contained in:
+11
-1
@@ -627,13 +627,23 @@ function renderAppShell(container) {
|
|||||||
initNavHideOnScroll(container);
|
initNavHideOnScroll(container);
|
||||||
initOfflineBanner();
|
initOfflineBanner();
|
||||||
initKeyboardShortcuts();
|
initKeyboardShortcuts();
|
||||||
|
if (localStorage.getItem(SEARCH_KBD_KEY)) {
|
||||||
|
document.documentElement.classList.add('search-kbd-done');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const FAB_SEEN_KEY = 'oikos:fabSeenCount';
|
const FAB_SEEN_KEY = 'oikos:fabSeenCount';
|
||||||
const FAB_SEEN_MAX = 5;
|
const FAB_SEEN_MAX = 5;
|
||||||
|
const SEARCH_KBD_KEY = 'oikos:searchKbdUsed';
|
||||||
|
|
||||||
const SHORTCUTS = [
|
const SHORTCUTS = [
|
||||||
{ key: '/', description: () => t('shortcuts.search'), action: () => document.getElementById('more-sheet-search')?.click() },
|
{ key: '/', description: () => t('shortcuts.search'), action: () => {
|
||||||
|
if (!localStorage.getItem(SEARCH_KBD_KEY)) {
|
||||||
|
localStorage.setItem(SEARCH_KBD_KEY, '1');
|
||||||
|
document.documentElement.classList.add('search-kbd-done');
|
||||||
|
}
|
||||||
|
document.getElementById('more-sheet-search')?.click();
|
||||||
|
} },
|
||||||
{ key: 'n', description: () => t('shortcuts.new'), action: () => document.querySelector('.page-fab')?.click() },
|
{ key: 'n', description: () => t('shortcuts.new'), action: () => document.querySelector('.page-fab')?.click() },
|
||||||
{ key: '?', description: () => t('shortcuts.help'), action: () => showShortcutsModal() },
|
{ key: '?', description: () => t('shortcuts.help'), action: () => showShortcutsModal() },
|
||||||
{ key: 'g d', description: () => t('shortcuts.goDash'), action: () => navigate('/') },
|
{ key: 'g d', description: () => t('shortcuts.goDash'), action: () => navigate('/') },
|
||||||
|
|||||||
@@ -305,7 +305,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 1024px) {
|
@media (min-width: 1024px) {
|
||||||
.more-sheet__search-kbd {
|
html:not(.search-kbd-done) .more-sheet__search-kbd {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user