Skip to content

Commit c2109cd

Browse files
committed
fix(mobile): make history view scrollable and layout stable
- Root layout: min-h-0 and flex so editor content can scroll - Editor content wrappers: flex-1 min-h-0 and overflow for correct scroll behavior in flex layout Made-with: Cursor
1 parent 83734be commit c2109cd

File tree

5 files changed

+48
-6
lines changed

5 files changed

+48
-6
lines changed

packages/webapp/src/components/pages/history/mobile/EditorContent.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const EditorContent = () => {
88

99
if (loadingHistory || !editor) {
1010
return (
11-
<div className="editorWrapper flex h-full w-full grow items-start justify-center overflow-y-auto border-t-0">
11+
<div className="editorWrapper flex h-full min-h-0 w-full flex-1 items-start justify-center overflow-y-auto border-t-0">
1212
<div className={'ProseMirror tiptap__editor w-full'}>
1313
<DocumentSimpleLoader className="heading !h-auto" level="1" />
1414
<DocumentWithPictureLoader className="heading !h-auto" level="1" />
@@ -19,8 +19,8 @@ const EditorContent = () => {
1919
}
2020

2121
return (
22-
<div className="editor relative flex size-full w-full max-w-full flex-col justify-around align-top">
23-
<div className="editorWrapper flex h-full grow items-start justify-center overflow-hidden overflow-y-auto border-t-0 p-0">
22+
<div className="editor relative flex size-full min-h-0 w-full max-w-full flex-col justify-around align-top">
23+
<div className="editorWrapper flex min-h-0 flex-1 items-start justify-center overflow-y-auto border-t-0 p-0">
2424
<TiptapEditorContent editor={editor} className="tiptap__editor relative" />
2525
</div>
2626
</div>

packages/webapp/src/components/pages/history/mobile/MobileHistory.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ const MobileHistory = () => {
2929
useHocuspocusStateless()
3030

3131
return (
32-
<div
33-
className={`pad tiptap history_editor border-base-300 relative flex flex-col border-solid`}>
32+
<div className="pad tiptap history_editor border-base-300 relative flex h-dvh min-h-0 flex-col border-solid">
3433
<Toolbar />
35-
<EditorContent />
34+
<div className="min-h-0 flex-1 overflow-hidden">
35+
<EditorContent />
36+
</div>
3637
<MobileLeftSidePanel />
3738
</div>
3839
)

packages/webapp/src/styles/_mobile.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,18 @@ html.m_mobile #__next {
291291
0 1px 18px 0 color-mix(in oklch, var(--color-base-content) 12%, transparent);
292292
}
293293

294+
[data-theme='docsplus-dark'] .edit-fab,
295+
[data-theme='docsplus-dark-hc'] .edit-fab {
296+
box-shadow:
297+
0 4px 6px -1px color-mix(in oklch, var(--color-base-content) 12%, transparent),
298+
0 8px 12px 0 color-mix(in oklch, var(--color-base-content) 8%, transparent);
299+
}
300+
301+
[data-theme='docsplus-dark'] .ha-single.btnOpenChatBox,
302+
[data-theme='docsplus-dark-hc'] .ha-single.btnOpenChatBox {
303+
box-shadow: 0 2px 6px color-mix(in oklch, var(--color-base-content) 10%, transparent);
304+
}
305+
294306
.headingSelection {
295307
&.is-active {
296308
background-color: color-mix(in oklch, var(--color-primary) 10%, transparent);

packages/webapp/src/styles/components/_heading-actions.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@
7474
}
7575
}
7676

77+
// Dark: softer shadow so no light halo on dark canvas
78+
[data-theme='docsplus-dark'] &:hover .ha-wrap.has-selection > .ha-group,
79+
[data-theme='docsplus-dark-hc'] &:hover .ha-wrap.has-selection > .ha-group,
80+
[data-theme='docsplus-dark'] & .ha-wrap.has-selection > .ha-group[data-unread-count]:not([data-unread-count='']),
81+
[data-theme='docsplus-dark-hc'] & .ha-wrap.has-selection > .ha-group[data-unread-count]:not([data-unread-count='']) {
82+
box-shadow:
83+
0 1px 3px 0 color-mix(in oklch, var(--color-base-content) 6%, transparent),
84+
0 1px 2px 0 color-mix(in oklch, var(--color-base-content) 4%, transparent),
85+
0 0 0 1px color-mix(in oklch, var(--color-base-content) 3%, transparent);
86+
}
87+
7788
// Unread-only extras (force visibility)
7889
// Badge styles are in _unread-badge.scss
7990
.ha-wrap.has-selection > .ha-group[data-unread-count]:not([data-unread-count='']) {

packages/webapp/src/styles/styles.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,24 @@ $crinkle-transition: ease-out;
846846
}
847847
}
848848

849+
/* ---------------------------------------------------------------------------
850+
react-modal-sheet — theme-aware so sheets (chatroom, notifications, filters,
851+
emoji picker) respect light/dark/dark-hc. Library defaults are light-only.
852+
--------------------------------------------------------------------------- */
853+
.react-modal-sheet-container {
854+
background-color: var(--color-base-100) !important;
855+
border-top-left-radius: var(--radius-box, 1rem);
856+
border-top-right-radius: var(--radius-box, 1rem);
857+
}
858+
859+
.react-modal-sheet-content {
860+
background-color: var(--color-base-100) !important;
861+
}
862+
863+
.react-modal-sheet-backdrop {
864+
background: color-mix(in oklch, var(--color-base-content) 40%, transparent) !important;
865+
}
866+
849867
.react-modal-sheet-header {
850868
padding-top: 4px !important;
851869
height: 20px !important;

0 commit comments

Comments
 (0)