Implement sidebar tree view state persistence

This commit is contained in:
lix-2026
2026-05-27 16:32:05 +08:00
parent bd7470d03e
commit e43efacbce
15 changed files with 1875 additions and 17 deletions
+22 -1
View File
@@ -622,6 +622,7 @@ html[data-mnote-sidebar-resizing="true"] .mnote-sidebar-resizer::before {
min-height: 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
.mnote-sidebar-nav a,
@@ -1374,7 +1375,7 @@ body {
background: var(--atelier-sidebar);
border-right: 0;
box-shadow: none;
overflow-x: hidden;
overflow: hidden;
}
.mnote-sidebar-header,
@@ -1439,6 +1440,13 @@ body {
padding: 0 8px 18px;
}
.wolai-my-pages-section {
flex: 1 1 auto;
min-height: 0;
display: flex;
flex-direction: column;
}
.wolai-section-title,
.wolai-sidebar-tabs {
height: 32px;
@@ -1496,7 +1504,10 @@ body {
}
.wolai-sidebar-tab-panels {
flex: 1 1 auto;
min-height: 0;
overflow-y: auto;
overscroll-behavior: contain;
}
.wolai-sidebar-tab-panel[hidden] {
@@ -1996,6 +2007,7 @@ body {
}
.wolai-sidebar-footer {
flex: 0 0 auto;
border-top: 0;
background: var(--atelier-sidebar);
}
@@ -4470,6 +4482,15 @@ mod tests {
assert!(MNOTE_CSS.contains("::-webkit-scrollbar-thumb"));
}
#[test]
fn sidebar_scroll_is_contained_to_tree_panels() {
assert!(MNOTE_CSS.contains(".mnote-sidebar,\n.wolai-sidebar {\n width: var(--mnote-sidebar-width, 248px);\n background: var(--atelier-sidebar);\n border-right: 0;\n box-shadow: none;\n overflow: hidden;"));
assert!(MNOTE_CSS.contains(".wolai-sidebar-body {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;"));
assert!(MNOTE_CSS.contains(".wolai-my-pages-section {\n flex: 1 1 auto;\n min-height: 0;\n display: flex;\n flex-direction: column;"));
assert!(MNOTE_CSS.contains(".wolai-sidebar-tab-panels {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n overscroll-behavior: contain;"));
assert!(MNOTE_CSS.contains(".wolai-sidebar-footer {\n flex: 0 0 auto;"));
}
#[test]
fn admin_policy_rows_wrap_long_grant_values() {
assert!(MNOTE_CSS.contains(