Skip to content

Add notion/db-layout domain skill — read a DB's full layout schematic via the v3 API - #551

Open
optemism wants to merge 3 commits into
browser-use:mainfrom
optemism:notion-db-layout
Open

Add notion/db-layout domain skill — read a DB's full layout schematic via the v3 API#551
optemism wants to merge 3 commits into
browser-use:mainfrom
optemism:notion-db-layout

Conversation

@optemism

@optemism optemism commented Jul 22, 2026

Copy link
Copy Markdown

New domain skill: given any Notion database URL, extract the complete page-layout schematic — pinned properties (display order), standalone property modules, module order, named property groups with ordered membership, property visibility, sub-items wiring, and automation ids. None of this is exposed by the public REST API.

Mechanism: in-browser js() fetch of Notion's internal /api/v3/syncRecordValues from the user's logged-in tab — read-only, and the session cookie never leaves the browser (no token extraction). Documents the internal data model (block → collection.format → layout + automation records), the double .value envelope, ghost property ids for deleted properties, and the js() escaping trap (backslash-n inside the JS string silently returns None).

Verified live 2026-07-22 against a production workspace with a customized layout (pinned chips, a standalone file module, 3 named property groups, 19 automations enumerated).


Summary by cubic

Adds a new Notion domain skill that reads a database’s full page-layout schematic (pinned properties, modules, groups, visibility, sub-items, automations) from the user’s logged-in browser. Also updates docs to use browser-harness -c "..." and clarifies Chrome’s remote debugging consent behavior.

  • New Features

    • Read layout from any Notion DB URL via in-browser js() calling /api/v3/syncRecordValues; resolves block → collection.format → layout, handles ghost property IDs, and lists automation IDs; read-only with no token extraction.
  • Bug Fixes

    • Replace heredoc examples with browser-harness -c "..." and add quoting guidance.
    • Clarify once-per-launch “Allow remote debugging?” dialog and that --remote-debugging-port is ignored on the default profile.

Written for commit b359ebc. Summary will update on new commits.

Review in cubic

optemism and others added 3 commits June 7, 2026 15:46
The installed `browser-harness` binary only accepts `-c "..."` — heredoc
stdin was never supported (run.py exits with usage error on any arg other
than -c or the named flags). Update all three examples and add a quoting
note for single-vs-double quotes inside -c strings.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…default profile

Two field-verified cold-start facts that cost a long debugging detour:

1. The "Allow remote debugging?" dialog is a once-per-Chrome-launch WebSocket
   consent gate, not per-call. /json/version (HTTP) answers while the CDP WS
   handshake 403s until Allow is clicked; after one click the daemon stays
   attached for the rest of that launch. "Asks every time" = Chrome was
   restarted in between.

2. --remote-debugging-port is silently ignored on the default user-data-dir
   since Chrome 136, so launching with the flag does NOT bypass the dialog for
   the user's real profile (port never binds). The flag only works with an
   explicit non-default --user-data-dir (separate automation profile).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
… v3 API

Given a Notion DB URL, extract what the public REST API doesn't expose:
pinned properties in display order, standalone property modules, page module
order, named property groups with ordered membership, property visibility,
sub-items wiring, and automation ids — via an in-browser fetch of
/api/v3/syncRecordValues from the user's logged-in tab (session cookie never
leaves the browser; read-only).

Documents the internal model (block -> collection.format -> layout record,
automation records), the double .value envelope, ghost property ids, and the
escaping trap that makes js() silently return None.
@browser-harness-review

Copy link
Copy Markdown

✅ Skill review passed

Reviewed 2 file(s) — no findings.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="domain-skills/notion/db-layout.md">

<violation number="1" location="domain-skills/notion/db-layout.md:35">
P3: The `collection_pointers` (plural) fallback field used in step 2's JS code is not documented in the data model section — only `collection_pointer` (singular) is listed. Add `collection_pointers` to the block/format docs so someone reading the table can understand both fields.</violation>

<violation number="2" location="domain-skills/notion/db-layout.md:76">
P3: The automation `properties` field is documented in the data model section but omitted from step 4's field list. If `properties` is intentionally excluded (e.g., rarely useful), note why; otherwise add it for consistency.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

"
```

4. Automations detail (optional): `sync([{pointer:{table:'automation',id:<id>,spaceId:SPACE},version:-1}])` → `trigger`, `action_ids`, `status`.

@cubic-dev-ai cubic-dev-ai Bot Jul 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: The automation properties field is documented in the data model section but omitted from step 4's field list. If properties is intentionally excluded (e.g., rarely useful), note why; otherwise add it for consistency.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At domain-skills/notion/db-layout.md, line 76:

<comment>The automation `properties` field is documented in the data model section but omitted from step 4's field list. If `properties` is intentionally excluded (e.g., rarely useful), note why; otherwise add it for consistency.</comment>

<file context>
@@ -0,0 +1,86 @@
+"
+```
+
+4. Automations detail (optional): `sync([{pointer:{table:'automation',id:<id>,spaceId:SPACE},version:-1}])` → `trigger`, `action_ids`, `status`.
+
+## Traps
</file context>
Suggested change
4. Automations detail (optional): `sync([{pointer:{table:'automation',id:<id>,spaceId:SPACE},version:-1}])``trigger`, `action_ids`, `status`.
4. Automations detail (optional): `sync([{pointer:{table:'automation',id:<id>,spaceId:SPACE},version:-1}])``trigger`, `action_ids`, `status`, `properties`.
Fix with cubic

const sync=async(reqs)=>(await fetch('/api/v3/syncRecordValues',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({requests:reqs})})).json();
let j=await sync([{pointer:{table:'block',id:bid},version:-1}]); // spaceId optional for block lookup
const blk=j.recordMap.block[bid].value.value;
return JSON.stringify(blk.format.collection_pointer || (blk.format.collection_pointers||[])[0]);

@cubic-dev-ai cubic-dev-ai Bot Jul 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: The collection_pointers (plural) fallback field used in step 2's JS code is not documented in the data model section — only collection_pointer (singular) is listed. Add collection_pointers to the block/format docs so someone reading the table can understand both fields.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At domain-skills/notion/db-layout.md, line 35:

<comment>The `collection_pointers` (plural) fallback field used in step 2's JS code is not documented in the data model section — only `collection_pointer` (singular) is listed. Add `collection_pointers` to the block/format docs so someone reading the table can understand both fields.</comment>

<file context>
@@ -0,0 +1,86 @@
+  const sync=async(reqs)=>(await fetch('/api/v3/syncRecordValues',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({requests:reqs})})).json();
+  let j=await sync([{pointer:{table:'block',id:bid},version:-1}]);   // spaceId optional for block lookup
+  const blk=j.recordMap.block[bid].value.value;
+  return JSON.stringify(blk.format.collection_pointer || (blk.format.collection_pointers||[])[0]);
+})()''')
+print(r)
</file context>
Fix with cubic

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant