Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions frontend/src/__mocks__/intersection-observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,25 @@ export function mockIntersectionObservers() {
rootMargin: "0px",
scrollMargin: "0px",
thresholds: [0],
observe: vi.fn(),
observe: vi.fn<(target: Element) => void>(),
unobserve: vi.fn(),
disconnect: vi.fn(),
takeRecords: () => [],
emit(target: Element, visible: boolean) {
observer.emitBatch([[target, visible]]);
},
emitBatch(changes: [Element, boolean][]) {
const rect = new DOMRect();
callback(
[
{
target,
isIntersecting: visible,
intersectionRatio: visible ? 1 : 0,
time: 0,
boundingClientRect: rect,
intersectionRect: rect,
rootBounds: rect,
},
],
changes.map(([target, isIntersecting]) => ({
target,
isIntersecting,
intersectionRatio: isIntersecting ? 1 : 0,
time: 0,
boundingClientRect: rect,
intersectionRect: rect,
rootBounds: rect,
})),
observer,
);
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/editor/Output.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ export const OutputArea = React.memo(
cellId={cellId}
forceExpand={forceExpand}
id={CellOutputId.create(cellId)}
data-cell-role="output"
className={cn(
stale && "marimo-output-stale",
loading && "marimo-output-loading",
Expand Down Expand Up @@ -505,7 +506,6 @@ const ExpandableOutput = React.memo(
</div>
<div
{...props}
data-cell-role="output"
className={cn(
"relative fullscreen:bg-background fullscreen:flex fullscreen:items-center fullscreen:justify-center",
"fullscreen:items-center-safe",
Expand Down
24 changes: 5 additions & 19 deletions frontend/src/components/editor/chrome/panels/outline-panel.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
/* Copyright 2026 Marimo. All rights reserved. */

import { useAtomValue } from "jotai";
import { ScrollTextIcon } from "lucide-react";
import React, { useMemo } from "react";
import { notebookOutline } from "../../../../core/cells/cells";
import React from "react";
import { PanelEmptyState } from "./empty-state";

import "./outline-panel.css";
import { OutlineList } from "./outline/floating-outline";
import {
findOutlineElements,
useActiveOutline,
} from "./outline/useActiveOutline";
import { useActiveOutline } from "./outline/useActiveOutline";

const OutlinePanel: React.FC = () => {
const { items } = useAtomValue(notebookOutline);
const headerElements = useMemo(() => findOutlineElements(items), [items]);
const { activeHeaderId, activeOccurrences } =
useActiveOutline(headerElements);
const outline = useActiveOutline();

if (items.length === 0) {
if (outline.entries.length === 0) {
return (
<PanelEmptyState
title="No outline found"
Expand All @@ -29,13 +21,7 @@ const OutlinePanel: React.FC = () => {
);
}

return (
<OutlineList
items={items}
activeHeaderId={activeHeaderId}
activeOccurrences={activeOccurrences}
/>
);
return <OutlineList {...outline} />;
};

export default OutlinePanel;
Loading
Loading