Skip to content

Instantly share code, notes, and snippets.

@simonw

simonw/codex.md Secret

Created June 11, 2026 15:09
Show Gist options
  • Select an option

  • Save simonw/12d5e09797072a6807d7b9cfcc8ff6b7 to your computer and use it in GitHub Desktop.

Select an option

Save simonw/12d5e09797072a6807d7b9cfcc8ff6b7 to your computer and use it in GitHub Desktop.

build this

build this

27 previous messages

I’ll inspect the project shape first so I can identify the actual build path and avoid guessing at the tooling.

The repo currently has a single project file, plan.md, so I’m reading that as the build spec rather than assuming an existing app scaffold.

I’m going to implement this as a self-contained index.html with inline CSS and JavaScript, matching the spec’s no-build/no-dependency requirement. After that I’ll do a local visual/runtime check.

I’ve got enough context now. The implementation needs: URL normalization and _extra management, abortable debounced fetches, a checkbox-driven extras list, JSON rendering with top-level key marking, hash persistence, and clear handling for unsupported/CORS/non-200 cases.

Created 1 file
  • Wrote ./index.html (+1096 -0)

The first pass is in place. I’m checking the inline JavaScript for syntax issues now, then I’ll load the page locally and exercise the main UI path.

The inline script parses cleanly. Next I’m going to open the generated page in the in-app browser and verify the empty state plus a mocked Datasette response flow.

I’m connecting to the in-app browser for the visual check.

MCP tool call

node_repl.js

{
  "code": "var browserModulePath = '/Users/simon/.codex/plugins/cache/openai-bundled/browser/26.608.12217/scripts/browser-client.mjs';\nvar browserClient = await import(browserModulePath);\nawait browserClient.setupBrowserRuntime({ globals: globalThis });\nglobalThis.browser = await agent.browsers.get('iab');\nnodeRepl.write(await browser.documentation());",
  "timeout_ms": 30000,
  "title": "Connect browser"
}
Browser is not available: iab

The configured in-app browser endpoint is not available in this session, so I’m falling back to local runtime checks and a small mock endpoint to exercise the fetch/render path.

MCP tool call

node_repl.js

{
  "code": "nodeRepl.write(JSON.stringify(Object.keys(agent.browsers || {})))",
  "timeout_ms": 30000,
  "title": "Inspect browser availability"
}
[]

I’m also checking whether Playwright is already available locally, which would let me verify the UI without relying on the unavailable in-app browser surface.

Playwright is not installed locally, so I’m checking for a headless browser binary that can load the static page directly against a mock Datasette endpoint.

Those first browser checks were split on spaces, so I’m rerunning them with the app paths quoted.

I’m starting a tiny local mock Datasette server for verification. It serves index.html and a /fixtures/facetable.json endpoint that returns an extras list plus selected response keys.

Understood. I won’t use Playwright or browser automation. I’m stopping the temporary mock server and making the blank URL path use the Datasette default.

I’m changing the form so an empty submission is valid, then routing empty input through the requested default endpoint.

The first patch missed one nearby line because of file context, so I’m reading the exact snippets and applying the edit against the current file.

I’m folding in the second change with the default URL edit: when a checkbox row is newly selected, the response will scroll to the matching top-level JSON key after the fetch finishes, and the page hash will carry that focused extra.

Edited 1 file
  • Wrote ./index.html (+62 -8)

I’m adding the small visual target state for the JSON line that receives the jump, then I’ll run a syntax check only.

Edited 1 file
  • Wrote ./index.html (+7 -0)

The requested behavior is implemented. I’m doing a non-browser syntax pass over the inline script and checking the final diff.

One more compatibility fix: the URL field should accept root-relative Datasette paths like /fixtures/facetable.json, so I’m changing it from browser URL validation to a text field with URL input mode.

Edited 1 file
  • Wrote ./index.html (+4 -3)

I’m rerunning the quick syntax check after that form adjustment.

Syntax is still clean. I’m doing one last read of the fetch/render path to catch obvious ordering issues before I hand it over for your manual test.

Built the single-file app at index.html.

Included the follow-up changes:

  • Blank URL now defaults to https://latest.datasette.io/fixtures/facetable.json.
  • Selecting a new extra row stores focus=<extra> in the hash and scrolls the JSON output to that extra’s top-level key when returned.
  • Root-relative paths like /fixtures/facetable.json are accepted.

Verification: inline JavaScript syntax passes. I did not run Playwright/browser automation per your instruction.

On load of the original page it should actively load that default URL

3 previous messages

I’ll make the no-hash startup path populate the default endpoint and immediately fetch it, without adding browser automation.

Edited 1 file
  • Wrote ./index.html (+8 -1)

The startup path is patched. I’m running the inline script syntax check now.

Done. On a fresh load with no hash and no URL entered, index.html now fills in https://latest.datasette.io/fixtures/facetable.json and immediately fetches it.

Verification: inline JavaScript syntax check passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment