Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(soup): show block header content in preview panel (#4635)

dev-rb5c7106f461cf
diff --git a/js/app/packages/app/component/PreviewPanel.tsx b/js/app/packages/app/component/PreviewPanel.tsx
index 147b77e863..fefb5af407 100644
--- a/js/app/packages/app/component/PreviewPanel.tsx
+++ b/js/app/packages/app/component/PreviewPanel.tsx
@@ -51,10 +51,6 @@ const PreviewPanelContent: Component<NonNullableFields<PreviewPanel>> = (
const scopedLayoutRefs: SplitPanelContextType['layoutRefs'] = {
...props.splitPanelContext.layoutRefs,
};
- // In preview we intentionally do NOT render the split header/title row.
- // We only provide toolbar slots (Share, etc).
- scopedLayoutRefs.headerLeft = undefined;
- scopedLayoutRefs.headerRight = undefined;
if (props.selectedEntity.type === 'project') {
// Isolate the previewed project's preview state from the outer panel so
@@ -179,14 +175,32 @@ const PreviewPanelContent: Component<NonNullableFields<PreviewPanel>> = (
}}
tabIndex={-1}
>
- {/* Preview-specific toolbar slots so blocks can render the "share" bar (via SplitToolbarLeft/Right) */}
+ {/* Display the split header content here */}
<div
- class="relative w-full flex items-center justify-between shrink-0 h-10 bg-surface px-2"
+ class="relative w-full flex items-center justify-between shrink-0 bg-surface px-2 py-2"
+ data-preview-split-header
+ >
+ <div
+ class="flex h-full items-center gap-1"
+ ref={(ref) => {
+ scopedLayoutRefs.headerLeft = ref;
+ }}
+ />
+ <div
+ class="flex h-full items-center gap-1"
+ ref={(ref) => {
+ scopedLayoutRefs.headerRight = ref;
+ }}
+ />
+ </div>
+
+ {/* Legacy: We've moved to a single top bar in most places but some blocks/places still try to display a toolbar as well.
+ This is for those blocks so we can see their toolbars int eh preview panel */}
+ <div
+ class="relative w-full flex items-center justify-between shrink-0 bg-surface px-2 py-2"
data-preview-split-toolbar
>
<div
- // In preview mode, anchor left-side controls (e.g. file menu) to the top-left
- // so the dropdown doesn't feel like it's "hanging" from the middle of the bar.
class="flex h-full items-center gap-1"
ref={(ref) => {
scopedLayoutRefs.toolbarLeft = ref;