Skip to content

Build your personal knowledge base with Trilium Notes

fix(master detail): keep the panes still through the slide

Elian Doranc5effe47313d
diff --git a/apps/client/src/widgets/dialogs/OptionsDialog.css b/apps/client/src/widgets/dialogs/OptionsDialog.css
index c07f05e66e..2f1d782a4e 100644
--- a/apps/client/src/widgets/dialogs/OptionsDialog.css
+++ b/apps/client/src/widgets/dialogs/OptionsDialog.css
@@ -66,10 +66,6 @@ body.mobile .modal.options-dialog:not(.mobile-master-detail) .modal-dialog {
/* The master-detail flow itself is the shared one (master_detail.css); what is particular here is the
page selector's own padding, and the settings page filling the pane it is wrapped in. */
body.mobile .modal.options-dialog.mobile-master-detail {
- .modal-body {
- padding: 0;
- }
-
.options-mobile-nav {
padding: 8px 25px;
}
diff --git a/apps/client/src/widgets/dialogs/note_attributes.css b/apps/client/src/widgets/dialogs/note_attributes.css
index e7a1da29f9..c8cb9376cb 100644
--- a/apps/client/src/widgets/dialogs/note_attributes.css
+++ b/apps/client/src/widgets/dialogs/note_attributes.css
@@ -153,6 +153,15 @@ body.mobile .modal.note-attributes-modal {
* over a page — a modal over a modal. The flow itself is the shared one (master_detail.css); what is
* particular to this dialog is what the page holds.
*/
+body.mobile .modal.note-attributes-modal.mobile-master-detail {
+ /* The panes carry what was the body's padding, so that a pane looks the same whether it is being
+ slid (placed against the padding box) or at rest (see master_detail.css). */
+ .tn-master-pane,
+ .tn-detail-pane {
+ padding-inline: var(--bs-modal-padding, 16px);
+ }
+}
+
.attribute-detail-page {
/* The form was drawn as a popup, and a page needs neither of the two things a popup has to carry: a
heading naming what is being edited (the page is headed with its name, and the badges beside it say
diff --git a/apps/client/src/widgets/dialogs/revisions.css b/apps/client/src/widgets/dialogs/revisions.css
index 0f06503678..07a8af2343 100644
--- a/apps/client/src/widgets/dialogs/revisions.css
+++ b/apps/client/src/widgets/dialogs/revisions.css
@@ -295,10 +295,6 @@ body.desktop .revisions-dialog {
/* The master-detail flow itself is the shared one (master_detail.css); what is particular here is that
the revision fills its pane and scrolls inside itself rather than as a pane. */
body.mobile .revisions-dialog.mobile-master-detail {
- .modal-body {
- padding: 0;
- }
-
.revision-detail {
overflow: hidden;
}
diff --git a/apps/client/src/widgets/react/master_detail.css b/apps/client/src/widgets/react/master_detail.css
index a4ac79cea0..4e9b4bea8e 100644
--- a/apps/client/src/widgets/react/master_detail.css
+++ b/apps/client/src/widgets/react/master_detail.css
@@ -5,8 +5,22 @@
* is in them (its own padding, what scrolls, a footer).
*/
body.mobile .modal.mobile-master-detail {
- .modal-body {
+ /*
+ * Spelled out through the dialog to out-specify the body a full-page dialog is given
+ * (`overflow: scroll` in style.css, at the same weight as a plainer selector here would carry), and
+ * neither of the two can be left to the other:
+ *
+ * - a body that scrolls is a body that scrolls sideways through a slide, the pane coming in
+ * standing a screen's width past its end. A scrollbar appears for as long as the slide lasts,
+ * and everything under it shifts by its width and back;
+ * - a body with padding is a body whose panes have two geometries: an absolutely positioned pane
+ * is placed against the padding box, so a pane at rest sits inside that padding and the same
+ * pane mid-slide covers it — a jump of the padding's width at each end of the animation. The
+ * padding belongs to the panes here, which carry it into both states.
+ */
+ > .modal-dialog > .modal-content > .modal-body {
position: relative;
+ padding: 0;
/* Each pane scrolls itself, which is also what keeps the sliding ones contained. */
overflow: hidden;
}