mirror of
https://github.com/docmost/docmost.git
synced 2026-08-31 10:55:29 +08:00
fix(base): keep inline embed left edge at page-content, extend right only
Removing the leftward extension. With negative margin-left, the grid grew leftward past page-content and the first column appeared near the sidebar edge on load — wrong; Notion keeps the first column aligned with page text. Drop margin-left and the extendLeft calculation; only extend rightward toward AppShell.Main's right edge. Leftward viewport extension (so frozen columns can lock at the sidebar edge during scroll) becomes meaningful once we add frozen columns. Deferred until that feature lands.
This commit is contained in:
@@ -315,14 +315,14 @@ export function BaseTable({ pageId, embedded }: BaseTableProps) {
|
||||
if (!base) return null;
|
||||
|
||||
// When embedded inline in a doc page, the parent <NodeViewWrapper>
|
||||
// exposes --embed-extend-l / --embed-extend-r (positive px values).
|
||||
// We pull the grid's left/right edges outward via negative margin —
|
||||
// box-model: width: auto becomes parent_width + extend, so the box
|
||||
// physically grows past its parent's bounds. The toolbar keeps the
|
||||
// parent-constrained width so it stays in line with the page text.
|
||||
// exposes --embed-extend-r (positive px). We pull the grid's right
|
||||
// edge outward via negative margin-right — box-model: width: auto
|
||||
// becomes parent_width + |margin|, so the box physically grows past
|
||||
// its parent's bounds. Left edge stays at the wrapper's natural
|
||||
// (page-content) position so the table aligns with page text on
|
||||
// load. Toolbar is unchanged.
|
||||
const gridExtendStyle = embedded
|
||||
? ({
|
||||
marginLeft: "calc(-1 * var(--embed-extend-l, 0px))",
|
||||
marginRight: "calc(-1 * var(--embed-extend-r, 0px))",
|
||||
} as const)
|
||||
: undefined;
|
||||
|
||||
Reference in New Issue
Block a user