Compare commits

...

5 Commits

Author SHA1 Message Date
Adorian Doran
b223b931ab ui/grid view/tables: fix scroll direction 2026-02-25 11:35:39 +02:00
Adorian Doran
6759fef827 ui/grid view/tables: tweak 2026-02-25 11:04:26 +02:00
Adorian Doran
896d50b1f8 ui/grid view: hide the scrollbar of tables 2026-02-25 11:01:45 +02:00
Adorian Doran
2049c49fdb ui/grid view: horizontally scroll tables 2026-02-25 10:58:38 +02:00
Adorian Doran
b3c397e847 ui/grid view: fade out overflowing content 2026-02-25 09:40:05 +02:00
2 changed files with 48 additions and 0 deletions

View File

@@ -355,7 +355,15 @@
.note-book-card .note-book-content {
padding: 0;
flex: 1;
overflow: hidden;
font-size: 0.8rem;
&.note-book-content-overflowing {
mask-image: linear-gradient(to bottom, black calc(100% - 75px), transparent 100%);
mask-repeat: no-repeat;
mask-size: 100% 100%;
}
.ck-content p {
margin-bottom: 0.5em;
@@ -366,6 +374,26 @@
width: 25%;
}
.ck-content .table {
display: flex;
flex-direction: column-reverse;
overflow-x: scroll;
--scrollbar-thickness: 0;
scrollbar-width: none;
table {
width: max-content;
table-layout: auto;
}
figcaption {
display: block;
position: sticky;
left: 0;
width: 100%;
}
}
.rendered-content,
.rendered-content.text-with-ellipsis {
padding: .5rem 1rem 1rem 1rem;

View File

@@ -21,6 +21,8 @@ import ActionButton from "../../react/ActionButton";
import linkContextMenuService from "../../../menus/link_context_menu";
import { ComponentChildren, TargetedMouseEvent } from "preact";
const contentSizeObserver = new ResizeObserver(onContentResized);
export function ListView({ note, noteIds: unfilteredNoteIds, highlightedTokens }: ViewModeProps<{}>) {
const expandDepth = useExpansionDepth(note);
const noteIds = useFilteredNoteIds(note, unfilteredNoteIds);
@@ -212,6 +214,17 @@ export function NoteContent({ note, trim, noChildrenList, highlightedTokens, inc
const [ready, setReady] = useState(false);
const [noteType, setNoteType] = useState<string>("none");
useEffect(() => {
const contentElement = contentRef.current;
if (!contentElement) return;
contentSizeObserver.observe(contentElement);
return () => {
contentSizeObserver.unobserve(contentElement);
}
}, []);
useEffect(() => {
content_renderer.getRenderedContent(note, {
trim,
@@ -298,4 +311,11 @@ function useExpansionDepth(note: FNote) {
}
return parseInt(expandDepth, 10);
}
function onContentResized(entries: ResizeObserverEntry[], observer: ResizeObserver): void {
for (const contentElement of entries) {
const isOverflowing = ((contentElement.target.scrollHeight > contentElement.target.clientHeight))
contentElement.target.classList.toggle("note-book-content-overflowing", isOverflowing);
}
}