Compare commits

..

11 Commits

Author SHA1 Message Date
SiriusXT
53a8f6b4c0 Merge branch 'main' into fix/split_pane
Some checks failed
Checks / main (push) Has been cancelled
2025-11-29 11:39:05 +08:00
SiriusXT
9ae1a55896 chore(react/empty): obtain ntxId via React props instead of DOM query 2025-11-29 11:38:45 +08:00
Elian Doran
3cc64b5764
fix(mobile/context_menu): note color picker not working
Some checks are pending
Checks / main (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Dev / Test development (push) Waiting to run
Dev / Build Docker image (push) Blocked by required conditions
Dev / Check Docker build (Dockerfile) (push) Blocked by required conditions
Dev / Check Docker build (Dockerfile.alpine) (push) Blocked by required conditions
/ Check Docker build (Dockerfile) (push) Waiting to run
/ Check Docker build (Dockerfile.alpine) (push) Waiting to run
/ Build Docker images (Dockerfile, ubuntu-24.04-arm, linux/arm64) (push) Blocked by required conditions
/ Build Docker images (Dockerfile.alpine, ubuntu-latest, linux/amd64) (push) Blocked by required conditions
/ Build Docker images (Dockerfile.legacy, ubuntu-24.04-arm, linux/arm/v7) (push) Blocked by required conditions
/ Build Docker images (Dockerfile.legacy, ubuntu-24.04-arm, linux/arm/v8) (push) Blocked by required conditions
/ Merge manifest lists (push) Blocked by required conditions
playwright / E2E tests on linux-arm64 (push) Waiting to run
playwright / E2E tests on linux-x64 (push) Waiting to run
2025-11-28 23:43:16 +02:00
Elian Doran
19cf07564f
style(mobile/context_menu): taller height + small animation when expanding items 2025-11-28 23:21:31 +02:00
Elian Doran
5847ce5c14
feat(dev): enable CSS source maps 2025-11-28 23:21:14 +02:00
Elian Doran
a7ad45635e
style(mobile/context_menu): clean up border radiuses 2025-11-28 21:27:06 +02:00
Elian Doran
781215394e
refactor(mobile/context_menu): unify styles 2025-11-28 21:24:51 +02:00
Elian Doran
0aafdca999
style(mobile/context_menu): improve backdrop 2025-11-28 21:21:07 +02:00
Elian Doran
18d3cb6f0c
style(mobile/context_menu): dark submenu style 2025-11-28 21:14:06 +02:00
Elian Doran
263a96e8b7
style(mobile/context_menu): improve submenu style 2025-11-28 20:57:42 +02:00
Elian Doran
27d5009486
style(mobile/context_menu): disable hover color 2025-11-28 20:44:29 +02:00
5 changed files with 61 additions and 38 deletions

View File

@ -8,6 +8,7 @@ import Color, { ColorInstance } from "color";
import Debouncer from "../../utils/debouncer"; import Debouncer from "../../utils/debouncer";
import FNote from "../../entities/fnote"; import FNote from "../../entities/fnote";
import froca from "../../services/froca"; import froca from "../../services/froca";
import { isMobile } from "../../services/utils";
const COLOR_PALETTE = [ const COLOR_PALETTE = [
"#e64d4d", "#e6994d", "#e5e64d", "#99e64d", "#4de64d", "#4de699", "#e64d4d", "#e6994d", "#e5e64d", "#99e64d", "#4de64d", "#4de699",
@ -128,7 +129,6 @@ function CustomColorCell(props: ColorCellProps) {
const colorInput = useRef<HTMLInputElement>(null); const colorInput = useRef<HTMLInputElement>(null);
const colorInputDebouncer = useRef<Debouncer<string | null> | null>(null); const colorInputDebouncer = useRef<Debouncer<string | null> | null>(null);
const callbackRef = useRef(props.onSelect); const callbackRef = useRef(props.onSelect);
const isSafari = useRef(/^((?!chrome|android).)*safari/i.test(navigator.userAgent));
useEffect(() => { useEffect(() => {
colorInputDebouncer.current = new Debouncer(250, (color) => { colorInputDebouncer.current = new Debouncer(250, (color) => {
@ -160,11 +160,11 @@ function CustomColorCell(props: ColorCellProps) {
}, [pickedColor]); }, [pickedColor]);
return <div style={`--foreground: ${getForegroundColor(props.color)};`} return <div style={`--foreground: ${getForegroundColor(props.color)};`}
onClick={(e) => { onClick={isMobile() ? (e) => {
// The color picker dropdown will close on Safari if the parent context menu is // The color picker dropdown will close on some browser if the parent context menu is
// dismissed, so stop the click propagation to prevent dismissing the menu. // dismissed, so stop the click propagation to prevent dismissing the menu.
isSafari.current && e.stopPropagation(); e.stopPropagation();
}}> } : undefined}>
<ColorCell {...props} <ColorCell {...props}
color={pickedColor} color={pickedColor}
className={clsx("custom-color-cell", { className={clsx("custom-color-cell", {

View File

@ -1316,7 +1316,7 @@ body.mobile #context-menu-container.mobile-bottom-menu {
inset-inline-end: 0 !important; inset-inline-end: 0 !important;
bottom: 0 !important; bottom: 0 !important;
top: unset !important; top: unset !important;
max-height: 70vh; max-height: 90vh;
overflow: auto !important; overflow: auto !important;
user-select: none; user-select: none;
-webkit-user-select: none; -webkit-user-select: none;

View File

@ -119,17 +119,6 @@ body.backdrop-effects-disabled {
font-size: 0.9rem !important; font-size: 0.9rem !important;
} }
body.mobile .dropdown-menu {
backdrop-filter: var(--dropdown-backdrop-filter);
border-radius: var(--dropdown-border-radius);
position: relative;
}
body.mobile .dropdown-menu .dropdown-menu {
backdrop-filter: unset !important;
border-radius: unset !important;
}
body.desktop .dropdown-menu::before, body.desktop .dropdown-menu::before,
:root .ck.ck-dropdown__panel::before, :root .ck.ck-dropdown__panel::before,
:root .excalidraw .popover::before, :root .excalidraw .popover::before,
@ -157,17 +146,12 @@ body.desktop .dropdown-submenu .dropdown-menu::before {
content: unset; content: unset;
} }
body.mobile .dropdown-submenu .dropdown-menu {
background: transparent !important;
}
body.desktop .dropdown-submenu .dropdown-menu { body.desktop .dropdown-submenu .dropdown-menu {
backdrop-filter: var(--dropdown-backdrop-filter); backdrop-filter: var(--dropdown-backdrop-filter);
background: transparent; background: transparent;
} }
.dropdown-item, .dropdown-item,
body.mobile .dropdown-submenu .dropdown-toggle,
.excalidraw .context-menu .context-menu-item { .excalidraw .context-menu .context-menu-item {
--menu-item-start-padding: 8px; --menu-item-start-padding: 8px;
--menu-item-end-padding: 22px; --menu-item-end-padding: 22px;
@ -201,10 +185,6 @@ body.mobile .dropdown-item:not(:last-of-type) {
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
body.mobile .dropdown-submenu:hover {
background: transparent !important;
}
html body .dropdown-item.disabled, html body .dropdown-item.disabled,
html body .dropdown-item[disabled] { html body .dropdown-item[disabled] {
color: var(--menu-text-color) !important; color: var(--menu-text-color) !important;
@ -322,13 +302,25 @@ body.desktop .dropdown-menu.static .dropdown-item.active {
} }
/* #region Mobile tweaks for dropdown menus */ /* #region Mobile tweaks for dropdown menus */
body.mobile #context-menu-cover {
transition: background-color 150ms ease-in;
&.show {
background: rgba(0, 0, 0, 0.7);
}
}
body.mobile .dropdown-menu { body.mobile .dropdown-menu {
--dropdown-menu-padding-vertical: 0.7em; --dropdown-menu-padding-vertical: 0.7em;
--dropdown-menu-padding-horizontal: 1em; --dropdown-menu-padding-horizontal: 1em;
--hover-item-background-color: var(--card-background-color);
font-size: 1em !important; font-size: 1em !important;
backdrop-filter: var(--dropdown-backdrop-filter);
border-radius: var(--dropdown-border-radius) var(--dropdown-border-radius) 0 0;
position: relative;
.dropdown-toggle::after { .dropdown-toggle::after {
top: var(--dropdown-menu-padding-vertical); top: 0.5em;
right: var(--dropdown-menu-padding-horizontal); right: var(--dropdown-menu-padding-horizontal);
transform: translateX(50%) rotate(90deg); transform: translateX(50%) rotate(90deg);
} }
@ -366,6 +358,37 @@ body.mobile .dropdown-menu {
.dropdown-divider { .dropdown-divider {
visibility: hidden; visibility: hidden;
} }
.dropdown-submenu {
padding: 0 !important;
backdrop-filter: unset !important;
.dropdown-toggle {
padding: var(--dropdown-menu-padding-vertical) var(--dropdown-menu-padding-horizontal);
}
.dropdown-menu {
--menu-background-color: rgba(0, 0, 0, 0.15);
border-radius: 0;
max-height: 0;
transition: max-height 100ms ease-in;
display: block !important;
&.show {
max-height: 1000px;
}
.dropdown-item {
background: transparent;
}
}
&.submenu-open {
.dropdown-toggle {
padding-bottom: var(--dropdown-menu-padding-vertical);
}
}
}
} }
/* #endregion */ /* #endregion */

View File

@ -10,16 +10,16 @@ import FNote from "../../entities/fnote";
import search from "../../services/search"; import search from "../../services/search";
import { TypeWidgetProps } from "./type_widget"; import { TypeWidgetProps } from "./type_widget";
export default function Empty({ }: TypeWidgetProps) { export default function Empty({ ntxId }: TypeWidgetProps) {
return ( return (
<> <>
<WorkspaceSwitcher /> <WorkspaceSwitcher />
<NoteSearch /> <NoteSearch ntxId={ntxId ?? null} />
</> </>
) )
} }
function NoteSearch() { function NoteSearch({ ntxId }: { ntxId: string | null }) {
const resultsContainerRef = useRef<HTMLDivElement>(null); const resultsContainerRef = useRef<HTMLDivElement>(null);
const autocompleteRef = useRef<HTMLInputElement>(null); const autocompleteRef = useRef<HTMLInputElement>(null);
@ -45,7 +45,6 @@ function NoteSearch() {
if (!suggestion?.notePath) { if (!suggestion?.notePath) {
return false; return false;
} }
const ntxId = autocompleteRef.current?.closest(".note-split")?.getAttribute("data-ntx-id") ?? null;
const activeNoteContext = appContext.tabManager.getNoteContextById(ntxId) ?? appContext.tabManager.getActiveContext(); const activeNoteContext = appContext.tabManager.getNoteContextById(ntxId) ?? appContext.tabManager.getActiveContext();
if (activeNoteContext) { if (activeNoteContext) {
activeNoteContext.setNote(suggestion.notePath); activeNoteContext.setNote(suggestion.notePath);

View File

@ -27,7 +27,8 @@ async function register(app: express.Application) {
appType: "custom", appType: "custom",
cacheDir: path.join(srcRoot, "../../.cache/vite"), cacheDir: path.join(srcRoot, "../../.cache/vite"),
base: `/${assetUrlFragment}/`, base: `/${assetUrlFragment}/`,
root: clientDir root: clientDir,
css: { devSourcemap: true }
}); });
app.use(`/${assetUrlFragment}/`, (req, res, next) => { app.use(`/${assetUrlFragment}/`, (req, res, next) => {
req.url = `/${assetUrlFragment}` + req.url; req.url = `/${assetUrlFragment}` + req.url;