refactor(rnetwork): move Open CRM to sub-nav header

Remove standalone "Open CRM" button from graph view body and add
"Open Twenty CRM" as an external link in the module sub-nav bar,
next to Community CRM. Dashed border + margin-left:auto pushes it
to the right edge for visual distinction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-03-15 15:52:10 -07:00
parent e6f78a67e8
commit cab80f30e7
2 changed files with 9 additions and 2 deletions

View File

@ -622,8 +622,7 @@ routes.get("/", (c) => {
spaceSlug: space,
modules: getModuleInfoList(),
head: GRAPH3D_HEAD,
body: `<div class="rapp-nav" style="padding:0 1rem;margin-top:8px"><span class="rapp-nav__title"></span><a href="/${space}/rnetwork/crm" class="rapp-nav__btn--app-toggle">Open CRM</a></div>
<folk-graph-viewer space="${space}"></folk-graph-viewer>`,
body: `<folk-graph-viewer space="${space}"></folk-graph-viewer>`,
scripts: `<script type="module" src="/modules/rnetwork/folk-graph-viewer.js"></script>`,
styles: `<link rel="stylesheet" href="/modules/rnetwork/network.css">`,
}));

View File

@ -1362,6 +1362,13 @@ const SUBNAV_CSS = `
border-color: var(--rs-border);
font-weight: 500;
}
.rapp-nav-pill--external {
margin-left: auto;
color: var(--rs-text-muted);
font-size: 0.75rem;
border: 1px dashed var(--rs-border);
}
.rapp-nav-pill--external:hover { color: var(--rs-text-primary); border-style: solid; }
`;
/** Build the module sub-nav bar from outputPaths + subPageInfos. */
@ -1397,6 +1404,7 @@ function renderModuleSubNav(moduleId: string, spaceSlug: string, modules: Module
...items.map(it =>
`<a class="rapp-nav-pill" href="${base}/${escapeAttr(it.path)}">${it.icon ? escapeHtml(it.icon) + ' ' : ''}${escapeHtml(it.label)}</a>`
),
...(mod.externalApp ? [`<a class="rapp-nav-pill rapp-nav-pill--external" href="${escapeAttr(mod.externalApp.url)}" target="_blank" rel="noopener">Open ${escapeHtml(mod.externalApp.name)} &#8599;</a>`] : []),
];
return `<nav class="rapp-subnav" id="rapp-subnav">${pills.join('')}</nav>