Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
💅💅💅
  • Loading branch information
manzt committed Jul 22, 2025
commit 2ea5ef75e3e7fe1b2ed9cf0e6f3e0cfa5fe03054
35 changes: 16 additions & 19 deletions frontend/src/components/editor/chrome/wrapper/minimap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,25 @@ const MinimapCell: React.FC<MinimapCellProps> = (props) => {
<button
data-node-id={cellId}
className={cn(
"bg-transparent text-left w-full flex relative justify-between items-center",
"bg-white border-none rounded pr-0 cursor-pointer",
"h-[21px] pl-[45px] font-inherit",
"text-gray-400",
{
"text-red-400": runtime.errored,
"text-white": isSelected,
},
"group bg-transparent text-left w-full flex relative justify-between items-center",
"bg-white border-none rounded cursor-pointer",
"h-[21px] pl-[51px] font-inherit",
isSelected
? "text-white"
: runtime.errored
? "text-red-400"
: "text-gray-300",
)}
onClick={() => onClick(cellId)}
>
<div
className={cn(
"flex h-full w-full px-1 items-center rounded",
isSelected ? "bg-teal-700" : "bg-transparent",
"group-hover:bg-gray-100 flex h-full w-full px-0.5 items-center rounded",
isSelected && "bg-teal-700 group-hover:bg-teal-700",
)}
>
<div
className={cn(
"truncate px-1 font-mono text-sm flex gap-1",
isSelected ? "opacity-100" : "opacity-80",
)}
className="truncate px-1 font-mono text-sm flex gap-1"
title={cell.code}
>
{graph.variables.length > 0 ? (
Expand Down Expand Up @@ -89,7 +86,7 @@ const MinimapCell: React.FC<MinimapCellProps> = (props) => {
})
) : (
<span className="overflow-hidden text-ellipsis whitespace-nowrap max-w-full">
{codePreview(cell.code)}
{codePreview(cell.code) ?? <span className="italic">empty</span>}
</span>
)}
</div>
Expand All @@ -105,7 +102,7 @@ const MinimapCell: React.FC<MinimapCellProps> = (props) => {
selectedGraph?.parents.has(cellId) ||
selectedGraph?.children.has(cellId)
? "text-teal-700"
: "text-gray-400",
: "text-gray-300",
)}
>
{isSelected ? (
Expand Down Expand Up @@ -145,7 +142,7 @@ export const Minimap: React.FC<{ className?: string }> = ({ className }) => {
<div className="flex items-center justify-between p-4 border-b">
<span className="text-sm font-semibold">Minimap</span>
</div>
<div className="overflow-y-auto overflow-x-hidden pl-3 pr-4 flex-1 scrollbar-none">
<div className="overflow-y-auto overflow-x-hidden py-3 pl-3 pr-4 flex-1 scrollbar-none">
{notebook.cellIds.inOrderIds.map((cellId) => {
return (
<MinimapCell
Expand All @@ -161,8 +158,8 @@ export const Minimap: React.FC<{ className?: string }> = ({ className }) => {
);
};

function codePreview(code: string): string {
return code.split("\n")[0].trim() || "-";
function codePreview(code: string): string | undefined {
return code.split("\n")[0].trim() || undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to trim sql and markdown. Or even color it differently

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of trimming down markdown/sql, but maybe something we could explore outside this PR? I tried a few different designs and didn't really come up with something I like. I worry color could get a little noisy.

}

// Connection paths (for selected)
Expand Down