fix: resolve Hermes-found CLI bugs (wait --url, find role, invalid selector, polish)
Release binaries / Build macOS ARM64 (push) Has been cancelled
Release binaries / Build macOS x64 (push) Has been cancelled
Release binaries / Build Linux ARM64 (push) Has been cancelled
Release binaries / Build Linux musl ARM64 (push) Has been cancelled
Release binaries / Build Linux musl x64 (push) Has been cancelled
Release binaries / Build Linux x64 (push) Has been cancelled
Release binaries / Build Windows x64 (push) Has been cancelled
Release binaries / Attach binaries to GitHub Release (push) Has been cancelled
Release binaries / Build macOS ARM64 (push) Has been cancelled
Release binaries / Build macOS x64 (push) Has been cancelled
Release binaries / Build Linux ARM64 (push) Has been cancelled
Release binaries / Build Linux musl ARM64 (push) Has been cancelled
Release binaries / Build Linux musl x64 (push) Has been cancelled
Release binaries / Build Linux x64 (push) Has been cancelled
Release binaries / Build Windows x64 (push) Has been cancelled
Release binaries / Attach binaries to GitHub Release (push) Has been cancelled
- wait --url: the arg parser never read `--timeout`, so a non-matching pattern waited the large default and wedged the daemon. Parse it. Also: matching was a literal substring (`includes`) so globs never matched — convert `**`/`*`/`?` globs to an anchored regex. And `poll_until_true` now bounds each probe with a timeout and tolerates transient navigation errors, so a hung `Runtime.evaluate` can never block past the deadline (un-wedges the daemon). - find role <role> [--name]: the query was `[role="X"], X`, which matches a literal <X> tag / explicit attribute but NOT implicit-role elements — so `find role link` (<a href>) and `find role heading` (<h1>) never matched. Add a proper ARIA-role → implicit-element map and broaden accessible-name matching (aria-label/title/alt/value/text). - click on a syntactically-invalid selector returned `✓ Done`: querySelector throws, and Runtime.evaluate returned the thrown DOMException as an objectId that was clicked as if it were the element. Check exception_details → error. - output: a title-less page now prints `✓ <url>` instead of an empty title line. - docs(skill): tab refs are `t2`, not `2` (SKILL.md, electron). Verified live (isolated launch): wait --url glob matches instantly; non-matching honors --timeout (2s) and leaves the daemon responsive; find role link/heading match; invalid selector errors. Unit tests added for the glob + role map + parse.
This commit is contained in:
+13
-5
@@ -228,12 +228,20 @@ pub fn print_response_with_opts(resp: &Response, action: Option<&str>, opts: &Ou
|
||||
}
|
||||
// Navigation response
|
||||
if let Some(url) = data.get("url").and_then(|v| v.as_str()) {
|
||||
if let Some(title) = data.get("title").and_then(|v| v.as_str()) {
|
||||
println!("{} {}", color::success_indicator(), color::bold(title));
|
||||
println!(" {}", color::dim(url));
|
||||
return;
|
||||
let title = data
|
||||
.get("title")
|
||||
.and_then(|v| v.as_str())
|
||||
.map(str::trim)
|
||||
.filter(|t| !t.is_empty());
|
||||
match title {
|
||||
Some(t) => {
|
||||
println!("{} {}", color::success_indicator(), color::bold(t));
|
||||
println!(" {}", color::dim(url));
|
||||
}
|
||||
// Title-less page: show the URL with the checkmark instead of an
|
||||
// empty title line.
|
||||
None => println!("{} {}", color::success_indicator(), color::dim(url)),
|
||||
}
|
||||
println!("{}", url);
|
||||
return;
|
||||
}
|
||||
if let Some(cdp_url) = data.get("cdpUrl").and_then(|v| v.as_str()) {
|
||||
|
||||
Reference in New Issue
Block a user