aboutsummaryrefslogtreecommitdiff
path: root/src/domains/form.ts
diff options
context:
space:
mode:
authoramankumarsingh77 <amankumarsingh7702@gmail.com>2026-07-28 20:30:49 +0530
committerAman Kumar <145339995+amankumarsingh77@users.noreply.github.com>2026-08-02 19:12:46 +0530
commitb67faca60b21b0cf74d5c967f0f8d215ad601e93 (patch)
tree12e8580e1b88c3ce6a2d9157cfa678cb7a55a73c /src/domains/form.ts
parenta6ec1d0915106b127affbd6b5fcc9efec48ef712 (diff)
refactor(domains): strip comment noise
Removes module banners, step markers, and comments restating the code. Keeps one-line notes for safeJs's trust boundary, the select-match null sentinels, the TUI width clamp, the single-window tab rule, the input synthesis quirks (char events, keyCode, mousemove, focus, compositor), the stale AX value, ignored-wrapper recursion, and isolated-tab routing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'src/domains/form.ts')
-rw-r--r--src/domains/form.ts15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/domains/form.ts b/src/domains/form.ts
index 78e3db1..b97b22d 100644
--- a/src/domains/form.ts
+++ b/src/domains/form.ts
@@ -18,16 +18,6 @@ const FillArgs = Type.Object({
value: Type.String({ description: "Value to set in the field" }),
});
-/**
- * Run an element-scoped function either against a CSS selector (querySelector +
- * apply) or a ref (resolve to objectId, callFunctionOn with element as `this`).
- * The shared `fnBody` is a function body where `this` is the target element and
- * the single argument is the value — identical logic on both paths. Returns the
- * function's return value (parsed) or a ToolErr.
- *
- * On the ref path a detached node yields a stale-ref error; on the selector path
- * a missing element returns { status: "not_found" } from the function body.
- */
const runOnElement = async (
client: BrowserClient,
opts: {
@@ -60,9 +50,7 @@ const runOnElement = async (
if (opts.selector === undefined) {
return err({ kind: "invalid_state", message: "Provide either `ref` or `selector`." });
}
- // Selector path: bind the same trusted function body to the matched element
- // via .call(). fnBody is harness-authored (not user input); only the selector
- // and value are interpolated, and those go through safeJs.
+ // fnBody is harness-authored, not user input; only the selector and value are interpolated, and those go through safeJs.
const prelude = safeJs`
(() => {
const el = document.querySelector(${opts.selector});
@@ -232,7 +220,6 @@ const isSelectResult = (v: unknown): v is SelectResult => {
return false;
};
-// `this` is the <select>; `arg` is { wv, wl, wi } (null = not provided).
const SELECT_FN = `
const el = this;
if (el.tagName !== "SELECT") return { status: "not_select", tag: el.tagName };