Skip to content

Add link mapping #648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 11, 2025
Merged

Add link mapping #648

merged 8 commits into from
Apr 11, 2025

Conversation

seanmcguire12
Copy link
Member

@seanmcguire12 seanmcguire12 commented Apr 8, 2025

why

  • we need to be able to extract links

what changed

  • added an idToUrl map on the TreeResult type which holds node IDs as keys and URLs as values
  • for example, on a wikipedia page this would look something like:
Screenshot 2025-04-08 at 3 20 40 PM

test plan

  • evals

Copy link

changeset-bot bot commented Apr 8, 2025

🦋 Changeset detected

Latest commit: 8de2fc0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@browserbasehq/stagehand Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds link mapping to the accessibility tree by updating type definitions and integrating URL extraction directly into the tree building process.

  • Updated /types/context.ts to include the idToUrl map in the TreeResult interface, enabling node-to-URL associations.
  • Modified /lib/a11y/utils.ts to extract URLs using extractUrlFromAXNode during the tree’s first pass.
  • Combined URL extraction with tree construction, improving link mapping without affecting overall node processing.

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@seanmcguire12 seanmcguire12 merged commit 169e7ea into main Apr 11, 2025
13 checks passed
@github-actions github-actions bot mentioned this pull request Apr 11, 2025
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.

2 participants