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.

fix(layout): add tab titles to split view, fix tab title reconcile bug (#2713)

Seamusba20abf647f3
diff --git a/infra/stacks/web-app/appRouteLambda/index.mjs b/infra/stacks/web-app/appRouteLambda/index.mjs
index 46bcb64e13..c14cafd840 100644
--- a/infra/stacks/web-app/appRouteLambda/index.mjs
+++ b/infra/stacks/web-app/appRouteLambda/index.mjs
@@ -8,6 +8,13 @@ const __dirname = dirname(__filename);
const template = readFileSync(join(__dirname, 'index.html'), 'utf-8');
const PREVIEW_URL = process.env.PREVIEW_URL;
+function escapeHtmlText(value) {
+ return String(value ?? '')
+ .replace(/&/g, '&')
+ .replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;');
+}
+
export const handler = async (event) => {
const rawPath = event.rawPath;
const fileName = rawPath.split('/').pop();
@@ -51,7 +58,7 @@ export const handler = async (event) => {
// Update the html page title with the document name
const body = template.replace(
/<head[^>]*>/i,
- `<head><title>Macro - ${documentTitle}</title>`
+ `<head><title data-sm="">Macro - ${escapeHtmlText(documentTitle)}</title>`
);
// Return the response
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
index 85bc39d338..50f48361cb 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
@@ -203,6 +203,10 @@ export const SoupView = (props: SoupViewProps) => {
const soup = useSoup();
const panel = useSplitPanelOrThrow();
+ createEffect(() => {
+ panel.handle.setDisplayName(props.viewName);
+ });
+
useSoupNotificationInvalidators();
const component = createMemo(() => {
diff --git a/js/app/packages/app/component/split-layout/layoutManager.ts b/js/app/packages/app/component/split-layout/layoutManager.ts
index 128a9c6676..062657e47e 100644
--- a/js/app/packages/app/component/split-layout/layoutManager.ts
+++ b/js/app/packages/app/component/split-layout/layoutManager.ts
@@ -968,6 +968,12 @@ export function createSplitLayout(
if (splitAtSameIndex) {
newSplit.id = splitAtSameIndex.id;
usedIds.add(splitAtSameIndex.id);
+ setSplitNamesById(
+ produce((map) => {
+ delete map[splitAtSameIndex.id];
+ return map;
+ })
+ );
}
resultSplits.push(newSplit);
}