Skip to content

Fix: live-wrap matches a capitalised component to its rendered tag (#875) - #914

Open
abdulwahabone wants to merge 1 commit into
mainfrom
fix/875-live-wrap-component-tag-case
Open

abdulwahabone wants to merge 1 commit into
mainfrom
fix/875-live-wrap-component-tag-case

Conversation

@abdulwahabone

@abdulwahabone abdulwahabone commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

find_opener_line compared the browser's lowercased rendered tag (input) to the source opener (Input) with ==, so live-wrap and live-insert reported "could not locate element" for any same-named component. The comparison now ignores ASCII case; the contract sentence, a unit test, and one oracle case cover it.

Refs #875 (the opener half of Bug A). Merge after or with the #852 fix: with the opener now found, a multi-line or =>-in-prop self-closing component still gets an overshot closing line from find_closing_line, where it used to fail cleanly. Bug B is not reproduced and not touched.

Validation: cargo test -p impeccable-live, release build, IMPECCABLE_BIN=<branch build> bun run test (oracle and framework fixtures green).

AI assistance: Claude Code.

🤖 Generated with Claude Code


Note

Low Risk
Narrow change to tag comparison during source search; slightly broader matching for similarly named tags with different casing only.

Overview
live-wrap / live-insert element location now treats --tag and the source opener as a match when they differ only by ASCII case (e.g. browser input vs source <Input>), instead of failing with "could not locate element."

find_opener_line in wrap_common.rs uses eq_ignore_ascii_case on both the match line and the ≤10-line backwalk path. CLI-CONTRACT.md documents this behavior. Coverage adds a Rust unit test and an oracle case (live-wrap-tsx-component-tag-case) for wrapping a capitalized JSX component with a lowercased --tag.

Reviewed by Cursor Bugbot for commit 6993631. Bugbot is set up for automated code reviews on this repo. Configure here.

)

The browser reports the rendered tag lowercased (`input`), and
find_opener_line compared it to the source opener (`Input`) with ==, so
live-wrap and live-insert reported "could not locate element" for any
same-named component. The comparison now ignores ASCII case.

The closing-line overshoot on multi-line self-closing tags is #852 and is
not touched here.

AI assistance: Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@abdulwahabone
abdulwahabone requested a review from pbakaus as a code owner October 2, 2026 05:00
@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Fixes tag matching to handle capitalized component names.

The PR appears safe to merge after or with the separately tracked closing-line fix identified by the author.

Summary

The PR lets live source search match a capitalized component opener to a lowercased rendered tag. It also updates the CLI contract and adds unit and oracle coverage.

Reviews (2) · Last reviewed commit: "Fix: live-wrap matches a capitalised com..."

Comment thread crates/live/src/wrap_common.rs
Comment thread crates/live/src/wrap_common.rs
@abdulwahabone

Copy link
Copy Markdown
Collaborator Author

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant