Skip to content
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b0e19d5
checkpoint: initial rendering
shrugs Mar 20, 2026
3376bf1
checkpoint: render in-chrome
shrugs Mar 20, 2026
b10469e
checkpoint: mostly working with injected header
shrugs Mar 20, 2026
028dc20
checkpoint: working, finally, with the header
shrugs Mar 20, 2026
209bf29
checkpoint: better loading
shrugs Mar 20, 2026
fc1d687
checkpoint: ready to demo
shrugs Mar 20, 2026
c2ed645
fix: cleanup packages
shrugs Mar 20, 2026
306e78e
Merge branch 'main' into temp/scalar-astro-example
notrab Mar 30, 2026
b917985
fix frozen lock
notrab Mar 30, 2026
b433a3a
clean slate
notrab Mar 30, 2026
633d017
disable dark mode
notrab Mar 30, 2026
9d8c72e
update styles and modal stacking for scalar
notrab Mar 31, 2026
086d732
tidy config
notrab Mar 31, 2026
834f8cf
Merge branch 'main' into temp/scalar-astro-example
notrab Mar 31, 2026
dae5c3b
clean up component in prep for review
notrab Mar 31, 2026
63cf42b
empty line cleanup
notrab Mar 31, 2026
17c8ff1
update lock and deps
notrab Mar 31, 2026
a56eef9
tidy
notrab Apr 2, 2026
b44776b
remove documentDownloadType config
notrab Apr 6, 2026
f51e879
scope section css
notrab Apr 6, 2026
a9996e4
remove old dep
notrab Apr 6, 2026
02fa7e8
update frozen lock
notrab Apr 6, 2026
14ac925
toc updates
notrab Apr 16, 2026
c62e21f
fix mounting
notrab Apr 16, 2026
ada1ea8
remove frontmatter block
notrab Apr 16, 2026
0c7e734
chore: resolve merge conflicts with main - add missing overrides and …
Copilot Apr 16, 2026
39f0ff8
Merge branch 'main' into temp/scalar-astro-example
notrab Apr 16, 2026
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
5 changes: 5 additions & 0 deletions docs/ensnode.io/config/integrations/starlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ export function starlight(): AstroIntegration {
collapsed: false,
autogenerate: { directory: "ensapi/contributing" },
},
{
label: "Reference",
collapsed: false,
autogenerate: { directory: "ensapi/reference" },
},
Comment on lines +110 to +114
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

The PR description notes overriding Starlight’s TwoColumnContent to always render the right sidebar column, but this integration’s components list does not register a TwoColumnContent override and there’s no override file under src/components/overrides. If that override is required for the new reference page layout (e.g., keeping the right sidebar when TOC is disabled), it should be included here; otherwise the PR description should be updated to reflect the actual approach.

Copilot uses AI. Check for mistakes.
],
},
{
Expand Down
1 change: 1 addition & 0 deletions docs/ensnode.io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@namehash/namekit-react": "catalog:",
"@namehash/namehash-ui": "workspace:*",
"@octokit/rest": "^20.1.2",
"@scalar/astro": "^0.2.4",
"@tailwindcss/vite": "^4.1.15",
"astro": "catalog:",
"astro-font": "catalog:",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
---

Comment thread
notrab marked this conversation as resolved.
Outdated
<starlight-toc data-min-h="2" data-max-h="3">
<nav aria-labelledby="scalar__on-this-page">
<h2 id="scalar__on-this-page">On this page</h2>
<ul class="scalar-toc-list"></ul>
</nav>
</starlight-toc>

<script>
function buildToc() {
const list = document.querySelector('.scalar-toc-list');
if (!list) return;

const headings = document.querySelectorAll('h2.section-header-label[id]');
if (headings.length === 0) return false;

list.innerHTML = '';
headings.forEach((h2) => {
const li = document.createElement('li');
const a = document.createElement('a');
a.href = `#${h2.id}`;
const span = document.createElement('span');
span.textContent = h2.textContent?.trim() ?? '';
a.appendChild(span);
li.appendChild(a);

// Find h3s that belong to this h2's section
const section = h2.closest('.section');
if (section) {
const h3s = section.querySelectorAll('h3[id]');
if (h3s.length > 0) {
const subList = document.createElement('ul');
h3s.forEach((h3) => {
const subLi = document.createElement('li');
const subA = document.createElement('a');
subA.href = `#${h3.id}`;
const subSpan = document.createElement('span');
subSpan.textContent = h3.textContent?.trim() ?? '';
subA.appendChild(subSpan);
subLi.appendChild(subA);
subList.appendChild(subLi);
});
li.appendChild(subList);
}
}

list.appendChild(li);
});

return true;
}

// Scalar renders async, so observe for headings to appear
if (!buildToc()) {
const observer = new MutationObserver(() => {
if (buildToc()) observer.disconnect();
});
observer.observe(document.body, { childList: true, subtree: true });
Comment on lines +52 to +57
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

The MutationObserver watches document.body with subtree: true and calls buildToc() on every mutation until headings appear. This can be very expensive during Scalar’s async render, and if the expected headings never render the observer never disconnects. Consider scoping the observer to the Scalar container (instead of the whole body) and adding a hard timeout / lifecycle cleanup (e.g., disconnect on pagehide or after N seconds).

Suggested change
// Scalar renders async, so observe for headings to appear
if (!buildToc()) {
const observer = new MutationObserver(() => {
if (buildToc()) observer.disconnect();
});
observer.observe(document.body, { childList: true, subtree: true });
function getScalarObservationRoot() {
return document.querySelector('main');
}
// Scalar renders async, so observe for headings to appear
if (!buildToc()) {
const observationRoot = getScalarObservationRoot();
if (observationRoot) {
const observer = new MutationObserver(() => {
if (buildToc()) cleanup();
});
const timeoutId = window.setTimeout(() => {
cleanup();
}, 10000);
function cleanup() {
observer.disconnect();
window.clearTimeout(timeoutId);
window.removeEventListener('pagehide', cleanup);
}
window.addEventListener('pagehide', cleanup, { once: true });
observer.observe(observationRoot, { childList: true, subtree: true });
}

Copilot uses AI. Check for mistakes.
}
</script>

<style>
nav :global(ul) {
padding: 0;
list-style: none;
}

nav :global(a) {
--pad-inline: 0.5rem;
display: block;
border-radius: 0.25rem;
padding-block: 0.25rem;
padding-inline: var(--pad-inline);
line-height: 1.25;
color: var(--sl-color-gray-3);
font-size: var(--sl-text-xs);
text-decoration: none;
}

nav :global(a:hover) {
color: var(--sl-color-white);
}

nav :global(a[aria-current='true']) {
color: var(--sl-color-text-accent);
}

nav :global(li > ul > li > a) {
padding-inline-start: calc(1rem + var(--pad-inline));
}
</style>
6 changes: 3 additions & 3 deletions docs/ensnode.io/src/components/molecules/StaticHeader.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import HeaderButtons from "../molecules/HeaderButtons";
<header class="fixed top-0 w-full z-20 h-[56px] py-[9px] sm:h-[70px] sm:py-4 select-none border border-b border-gray-200 bg-white">
<div class="box-border max-w-7xl mx-auto items-center justify-between flex flex-row pl-5 pr-3 sm:px-8">
<div class="flex flex-row lg:gap-2 xl:gap-7 justify-between items-center">
<div class="flex flex-row justify-between items-center gap-2 sm:gap-[14px] cursor-pointer flex-shrink-0 sm:mr-10 lg::mr-[76px]">
<div class="flex flex-row justify-between items-center gap-2 sm:gap-[14px] cursor-pointer flex-shrink-0 sm:mr-10 lg:mr-[76px]">
<a
href="/"
class="flex justify-center items-center text-black not-italic font-bold text-[21.539px] leading-[26.51px] tracking-[-0.907px] sm:text-[26px] sm:leading-8 sm:tracking-[-1.113px]"
href="/"
class="flex justify-center items-center text-black not-italic font-bold text-[21.539px] leading-[26.51px] tracking-[-0.907px] sm:text-[26px] sm:leading-8 sm:tracking-[-1.113px]"
>
<img src={ENSNode2DLight.src} class="h-8 min-[800px]:h-10" alt="ENSNode" />
</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/ensnode.io/src/components/organisms/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import HeaderButtons from "../molecules/HeaderButtons";
<header id="site-header" class="custom_header fixed top-0 w-full z-20 h-[56px] py-[9px] sm:h-[63px] sm:py-3 select-none">
<div class="box-border max-w-7xl mx-auto items-center justify-between flex flex-row pl-5 pr-3 sm:px-8">
<div class="flex flex-row lg:gap-2 xl:gap-7 justify-between items-center">
<div class="flex flex-row justify-between items-center gap-2 sm:gap-[14px] cursor-pointer flex-shrink-0 sm:mr-10 lg::mr-[76px]">
<div class="flex flex-row justify-between items-center gap-2 sm:gap-[14px] cursor-pointer flex-shrink-0 sm:mr-10 lg:mr-[76px]">
<a
href="/"
class="flex justify-center items-center text-black not-italic font-bold text-[21.539px] leading-[26.51px] tracking-[-0.907px] sm:text-[26px] sm:leading-8 sm:tracking-[-1.113px]"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
---
import Default from "@astrojs/starlight/components/TableOfContents.astro";

import ScalarTableOfContents from "../molecules/ScalarTableOfContents.astro";
import TelegramInvite from "../molecules/TelegramInvite.astro";

const { starlightRoute } = Astro.locals;
const isApiReference = starlightRoute.slug === "ensapi/reference/api-reference";
---

<Default />
{isApiReference ? <ScalarTableOfContents /> : <Default />}
<br />
<TelegramInvite />
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: ENSApi API Reference
description: Interactive API reference documentation for ENSApi endpoints.
sidebar:
label: API Reference
tableOfContents:
minHeadingLevel: 6
maxHeadingLevel: 6
Comment on lines +6 to +8
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

PR description mentions the API reference page uses tableOfContents: false, but this frontmatter sets tableOfContents to an options object (min/max heading level 6). If the intent is to disable Starlight TOC for this page, set it explicitly to false; if the object form is intentional as a workaround, please align the PR description (or add a short comment here explaining why).

Copilot uses AI. Check for mistakes.
---
Comment thread
notrab marked this conversation as resolved.

import { ScalarComponent } from "@scalar/astro";
import openapiSpec from "@workspace/docs/docs.ensnode.io/ensapi-openapi.json";

<ScalarComponent
configuration={{
content: openapiSpec,
Comment on lines +12 to +16
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

Importing the full OpenAPI JSON at build time will bundle the entire spec into the page’s JS payload. If Scalar supports loading from a URL or static asset path, consider switching to that approach to reduce client bundle size and improve initial load performance (especially as the spec grows).

Suggested change
import openapiSpec from "@workspace/docs/docs.ensnode.io/ensapi-openapi.json";
<ScalarComponent
configuration={{
content: openapiSpec,
<ScalarComponent
configuration={{
spec: { url: "/ensapi-openapi.json" },

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

@notrab notrab Mar 31, 2026

Choose a reason for hiding this comment

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

Doing so would (URL) mean we can't view in our preview deployments the upcoming API spec changes. Need to investigate the static asset path though... I assume this means just putting it in the public directory, instead of where it is now in the root.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i think not worth optimizing, is a-ok

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I looked to implement this last week but there is a lot more involved that would require changing the CI steps so we output the spec to the public directory. We could change the output directory of the generated spec (and what our CI check looks at), or copy on build to the public folder so we can use the url param of ScalarComponent. Both approaches are fine in my opinion.

I'm more inclined to follow option A to move the output directory to public so that it can be served from the docs site too, but I would do this in a separate PR. Which I can do next week @lightwalker-eth

theme: "none",
agent: { disabled: true },
hideDownloadButton: true,
hiddenClients: true,
telemetry: false,
defaultOpenAllTags: true,
expandAllResponses: true,
hideClientButton: true,
hideSearch: true,
showOperationId: true,
showSidebar: false,
showDeveloperTools: "never",
isEditable: false,
isLoading: false,
hideTestRequestButton: false,
forceDarkModeState: "light",
hideDarkModeToggle: true,
withDefaultFonts: true,
expandAllModelSections: true,
customCss: `
.light-mode {
--scalar-color-1: #121212;
--scalar-color-2: rgba(0, 0, 0, 0.6);
--scalar-color-3: rgba(0, 0, 0, 0.4);
--scalar-color-accent: var(--color-primary);
--scalar-background-1: var(--color-background);
--scalar-background-2: #f6f5f4;
--scalar-background-3: #f1ede9;
--scalar-background-accent: color-mix(in srgb, var(--color-primary) 6%, transparent);
--scalar-border-color: var(--color-border-light);
}
.scalar-mcp-layer { display: none !important; }
.section { padding-inline: 0 !important; }
.main-pane { isolation: auto !important; }
`,
}}
/>
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@
"kysely@>=0.26.0 <0.28.14": ">=0.28.14",
"h3@<1.15.9": ">=1.15.9",
"yaml@>=2.0.0 <2.8.3": ">=2.8.3",
"picomatch@<2.3.2": ">=2.3.2",
"picomatch@<2.3.2": "^2.3.2",
"picomatch@>=4.0.0 <4.0.4": ">=4.0.4",
"smol-toml@<1.6.1": ">=1.6.1",
"brace-expansion@>=4.0.0 <5.0.5": ">=5.0.5"
"brace-expansion@>=4.0.0 <5.0.5": ">=5.0.5",
"dompurify@<3.3.2": ">=3.3.2"
},
"ignoredBuiltDependencies": [
"bun"
Expand Down
Loading
Loading