Conversation
✅ Skill review passedReviewed 1 file(s) — no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a419ae1ca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pos = js("(() => { const r = document.querySelector('...faux-selector...').getBoundingClientRect(); return JSON.stringify({x: r.x + r.width/2, y: r.y + r.height/2}); })()") | ||
| click(pos["x"], pos["y"]) # CSS pixels — see below |
There was a problem hiding this comment.
Parse the coordinate payload before indexing it
When users follow this Aura-checkbox snippet, js() returns the raw Runtime.evaluate value, so the JSON.stringify(...) result on the previous line is a Python string, not a dict. Indexing it with pos["x"] therefore raises TypeError: string indices must be integers before the compositor click can happen; either return a plain JS object from js() or wrap the result in json.loads(...) before calling click.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
3 issues found across 1 file
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/salesforce/setup-permission-sets.md">
<violation number="1" location="domain-skills/salesforce/setup-permission-sets.md:1">
P2: Adding this document directly bypasses the repository's skill-generation workflow, so the harness can overwrite it or reject it as an invalid skill artifact. The content should be emitted by the harness rather than maintained as a hand-authored skill file.</violation>
<violation number="2" location="domain-skills/salesforce/setup-permission-sets.md:39">
P2: On pages with more than one accessible iframe, this selects the wrong document, so later `contentDocument` queries can miss the setup controls. Filtering by a classic-page URL/DOM marker or returning candidates for caller-side disambiguation would make the walker reliable.</violation>
<violation number="3" location="domain-skills/salesforce/setup-permission-sets.md:72">
P2: The coordinate example raises a Python `TypeError` when `pos["x"]` is evaluated because `pos` is a JSON string, unless the harness adds an undocumented parse step. Returning the object directly from `js()` or parsing `pos` with `json.loads` before indexing keeps the example executable.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| @@ -0,0 +1,101 @@ | |||
| # Salesforce Setup — permission sets (Lightning + classic-in-iframe) | |||
There was a problem hiding this comment.
P2: Adding this document directly bypasses the repository's skill-generation workflow, so the harness can overwrite it or reject it as an invalid skill artifact. The content should be emitted by the harness rather than maintained as a hand-authored skill file.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At domain-skills/salesforce/setup-permission-sets.md, line 1:
<comment>Adding this document directly bypasses the repository's skill-generation workflow, so the harness can overwrite it or reject it as an invalid skill artifact. The content should be emitted by the harness rather than maintained as a hand-authored skill file.</comment>
<file context>
@@ -0,0 +1,101 @@
+# Salesforce Setup — permission sets (Lightning + classic-in-iframe)
+
+Field-tested on a Lightning Enterprise org with the enhanced setup domain
</file context>
|
|
||
| ```python | ||
| pos = js("(() => { const r = document.querySelector('...faux-selector...').getBoundingClientRect(); return JSON.stringify({x: r.x + r.width/2, y: r.y + r.height/2}); })()") | ||
| click(pos["x"], pos["y"]) # CSS pixels — see below |
There was a problem hiding this comment.
P2: The coordinate example raises a Python TypeError when pos["x"] is evaluated because pos is a JSON string, unless the harness adds an undocumented parse step. Returning the object directly from js() or parsing pos with json.loads before indexing keeps the example executable.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At domain-skills/salesforce/setup-permission-sets.md, line 72:
<comment>The coordinate example raises a Python `TypeError` when `pos["x"]` is evaluated because `pos` is a JSON string, unless the harness adds an undocumented parse step. Returning the object directly from `js()` or parsing `pos` with `json.loads` before indexing keeps the example executable.</comment>
<file context>
@@ -0,0 +1,101 @@
+
+```python
+pos = js("(() => { const r = document.querySelector('...faux-selector...').getBoundingClientRect(); return JSON.stringify({x: r.x + r.width/2, y: r.y + r.height/2}); })()")
+click(pos["x"], pos["y"]) # CSS pixels — see below
+```
+
</file context>
| } | ||
| }; | ||
| walk(document, 0); | ||
| window.__sfFrame = frames[0]; // re-find after EVERY navigation — it is replaced |
There was a problem hiding this comment.
P2: On pages with more than one accessible iframe, this selects the wrong document, so later contentDocument queries can miss the setup controls. Filtering by a classic-page URL/DOM marker or returning candidates for caller-side disambiguation would make the walker reliable.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At domain-skills/salesforce/setup-permission-sets.md, line 39:
<comment>On pages with more than one accessible iframe, this selects the wrong document, so later `contentDocument` queries can miss the setup controls. Filtering by a classic-page URL/DOM marker or returning candidates for caller-side disambiguation would make the walker reliable.</comment>
<file context>
@@ -0,0 +1,101 @@
+ }
+ };
+ walk(document, 0);
+ window.__sfFrame = frames[0]; // re-find after EVERY navigation — it is replaced
+ return frames.length;
+})()"""
</file context>
Field-tested notes from automating permission-set creation/FLS/assignment in a Lightning Enterprise org via CDP:
/lightning/setup/PermSets/home404s on some orgs; the classic address-wrapper route (PermissionSetListView/page?address=%2F0PS) always worksquerySelectorAll('iframe')finds nothing) — includes a reusable shadow-walk snippet, plus the stale-frame-after-navigation trapa.btnedit links), field-permission row targeting viafls_read_ck/fls_edit_ckidsforceVirtualCheckboxrows ignore JS.click()— compositor-click the faux span at itsgetBoundingClientRect()centerPersonEmail) is controlled via Contact → Email, not the Accounts field listNo pixel coordinates, no org-specific data.
🤖 Generated with Claude Code
Summary by cubic
Adds a field-tested guide for automating Salesforce permission set setup in Lightning and classic-in-iframe. Focuses on reliable navigation, element targeting, and HiDPI-safe clicks to avoid pixel-based selectors.
a.btnlinks, FLS row targeting, and properinput/changeevents.getBoundingClientRect(), PersonAccount FLS controlled under Contact → Email, and operational traps (re-login after profile changes, auth wall on login).Written for commit 1a419ae. Summary will update on new commits.