From c629ce6ef89a6239eaa9e06001078ff3e5614a5c Mon Sep 17 00:00:00 2001
From: Papierkorb2292 <104673791+Papierkorb2292@users.noreply.github.com>
Date: Mon, 1 Sep 2025 11:01:08 +0200
Subject: [PATCH 1/3] Add note wrapper widget in mobile_layout.tsx
---
apps/client/src/layouts/mobile_layout.tsx | 44 ++++++++++++-----------
1 file changed, 24 insertions(+), 20 deletions(-)
diff --git a/apps/client/src/layouts/mobile_layout.tsx b/apps/client/src/layouts/mobile_layout.tsx
index b7eceffa2..a324152c9 100644
--- a/apps/client/src/layouts/mobile_layout.tsx
+++ b/apps/client/src/layouts/mobile_layout.tsx
@@ -22,6 +22,7 @@ import FloatingButtons from "../widgets/FloatingButtons.jsx";
import { MOBILE_FLOATING_BUTTONS } from "../widgets/FloatingButtonsDefinitions.jsx";
import ToggleSidebarButton from "../widgets/mobile_widgets/toggle_sidebar_button.jsx";
import CloseZenModeButton from "../widgets/close_zen_button.js";
+import NoteWrapperWidget from "../widgets/note_wrapper.js";
import MobileDetailMenu from "../widgets/mobile_widgets/mobile_detail_menu.js";
const MOBILE_CSS = `
@@ -131,30 +132,33 @@ export default class MobileLayout {
.child(new FlexContainer("column").filling().id("mobile-sidebar-wrapper").child(new QuickSearchWidget()).child(new NoteTreeWidget().cssBlock(FANCYTREE_CSS)))
)
.child(
- new ScreenContainer("detail", "column")
+ new ScreenContainer("detail", "row")
.id("detail-container")
.class("d-sm-flex d-md-flex d-lg-flex d-xl-flex col-12 col-sm-7 col-md-8 col-lg-9")
.child(
- new FlexContainer("row")
- .contentSized()
- .css("font-size", "larger")
- .css("align-items", "center")
- .child()
- .child()
- .child()
+ new NoteWrapperWidget()
+ .child(
+ new FlexContainer("row")
+ .contentSized()
+ .css("font-size", "larger")
+ .css("align-items", "center")
+ .child()
+ .child()
+ .child()
+ )
+ .child()
+ .child()
+ .child(new PromotedAttributesWidget())
+ .child(
+ new ScrollingContainer()
+ .filling()
+ .contentSized()
+ .child(new NoteDetailWidget())
+ .child(new NoteListWidget(false))
+ .child()
+ )
+ .child()
)
- .child()
- .child()
- .child(new PromotedAttributesWidget())
- .child(
- new ScrollingContainer()
- .filling()
- .contentSized()
- .child(new NoteDetailWidget())
- .child(new NoteListWidget(false))
- .child()
- )
- .child()
)
)
.child(
From c99ef4a549f33bbe8180d3be7aa0d021fb33c82a Mon Sep 17 00:00:00 2001
From: Papierkorb2292 <104673791+Papierkorb2292@users.noreply.github.com>
Date: Mon, 1 Sep 2025 11:01:29 +0200
Subject: [PATCH 2/3] Make note wrapper widget aware of note context on mobile
---
apps/client/src/widgets/note_wrapper.ts | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/apps/client/src/widgets/note_wrapper.ts b/apps/client/src/widgets/note_wrapper.ts
index 2e59cfbab..13c01418a 100644
--- a/apps/client/src/widgets/note_wrapper.ts
+++ b/apps/client/src/widgets/note_wrapper.ts
@@ -23,7 +23,9 @@ export default class NoteWrapperWidget extends FlexContainer {
this.refresh();
}
- noteSwitchedAndActivatedEvent() {
+ noteSwitchedAndActivatedEvent({ noteContext }: EventData<"setNoteContext">) {
+ this.noteContext = noteContext;
+
this.refresh();
}
From 623fcce3d10a7043d1dbc377663a2a53c97f9e95 Mon Sep 17 00:00:00 2001
From: Papierkorb2292 <104673791+Papierkorb2292@users.noreply.github.com>
Date: Mon, 1 Sep 2025 11:33:15 +0200
Subject: [PATCH 3/3] Also update note context in other note context events in
note wrapper so it works with tabs
---
apps/client/src/widgets/note_wrapper.ts | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/apps/client/src/widgets/note_wrapper.ts b/apps/client/src/widgets/note_wrapper.ts
index 13c01418a..619f8cda4 100644
--- a/apps/client/src/widgets/note_wrapper.ts
+++ b/apps/client/src/widgets/note_wrapper.ts
@@ -29,11 +29,15 @@ export default class NoteWrapperWidget extends FlexContainer {
this.refresh();
}
- noteSwitchedEvent() {
+ noteSwitchedEvent({ noteContext }: EventData<"setNoteContext">) {
+ this.noteContext = noteContext;
+
this.refresh();
}
- activeContextChangedEvent() {
+ activeContextChangedEvent({ noteContext }: EventData<"setNoteContext">) {
+ this.noteContext = noteContext;
+
this.refresh();
}