feat(replay-ui): render idPrefix targets as a prefix tag

This commit is contained in:
pj committed 2026-08-13 00:05:18 +05:30
1 parent 0122f241dc
commit a5d358e24e
2 files changed
+6

No files matched your search

@@ -15,6 +15,10 @@ describe("parseSelector", () => {
{ input: "id:login", out: { kind: "id", value: "login" } }, { input: "id:login", out: { kind: "id", value: "login" } },
{ input: "text:Sign In", out: { kind: "text", value: "Sign In" } }, { input: "text:Sign In", out: { kind: "text", value: "Sign In" } },
{ input: "textPrefix:Hello", out: { kind: "textPrefix", value: "Hello" } }, { input: "textPrefix:Hello", out: { kind: "textPrefix", value: "Hello" } },
{
input: "idPrefix:customer_row_",
out: { kind: "idPrefix", value: "customer_row_" },
},
{ input: "id:com.app:id/btn", out: { kind: "id", value: "com.app:id/btn" } }, { input: "id:com.app:id/btn", out: { kind: "id", value: "com.app:id/btn" } },
{ input: "bogus:x", out: null }, { input: "bogus:x", out: null },
{ input: ":leading", out: null }, { input: ":leading", out: null },
@@ -30,6 +34,7 @@ describe("parseSelector", () => {
describe("tagFromSelector", () => { describe("tagFromSelector", () => {
it("appends ellipsis only for prefix selectors", () => { it("appends ellipsis only for prefix selectors", () => {
expect(tagFromSelector("textPrefix:Hel")).toBe("Hel..."); expect(tagFromSelector("textPrefix:Hel")).toBe("Hel...");
expect(tagFromSelector("idPrefix:customer_row_")).toBe("customer_row_...");
expect(tagFromSelector("text:Hello")).toBe("Hello"); expect(tagFromSelector("text:Hello")).toBe("Hello");
expect(tagFromSelector("plain")).toBe("plain"); expect(tagFromSelector("plain")).toBe("plain");
}); });
+1
View File
@@ -8,6 +8,7 @@ export interface FormattedRow {
const SELECTOR_PREFIXES = [ const SELECTOR_PREFIXES = [
"id", "id",
"idPrefix",
"text", "text",
"textPrefix", "textPrefix",
"desc", "desc",