Skip to content

Add ID-based element referencing in filesystem paths#2

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-referencing-children-by-id
Draft

Add ID-based element referencing in filesystem paths#2
Copilot wants to merge 3 commits intomainfrom
copilot/add-referencing-children-by-id

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 10, 2025

Elements can now be referenced by their id attribute in filesystem paths instead of only by numeric index.

Changes

Client path resolution (fusedom-client.js):

  • buildDOMTree(): Uses {id}.{tagname} format when element has an id attribute, falls back to {index}.{tagname} otherwise
  • findElementByPath(): Parses selectors as either numeric indices or ID strings, filtering by tag name in both cases

Documentation: Updated README.md, QUICKSTART.md, and index.html with examples of ID-based paths

Usage

# Before: numeric index only
echo "content" > ./mnt/0.html/0.body/0.div/innerHTML

# After: ID-based reference (when element has id="header")
echo "content" > ./mnt/0.html/0.body/header.div/innerHTML

# Backward compatible: numeric indices still work
echo "content" > ./mnt/0.html/0.body/0.div/innerHTML

Elements without IDs continue to use numeric indices. No breaking changes.

Original prompt

add referencing children by id (e.g. ./main.div/ instead of ./0.div)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 10, 2025 21:07
Co-authored-by: 49016 <192273665+49016@users.noreply.github.com>
Co-authored-by: 49016 <192273665+49016@users.noreply.github.com>
Copilot AI changed the title [WIP] Add referencing children by ID instead of index Add ID-based element referencing in filesystem paths Nov 10, 2025
Copilot AI requested a review from 49016 November 10, 2025 21:15
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