Last active
February 13, 2026 17:29
-
-
Save sxalexander/92e7aa95898725789f47de89faa2d1bf to your computer and use it in GitHub Desktop.
conflict_viewer.ipynb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "cells": [ | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "# Source Conflict Viewer\n", | |
| "\n", | |
| "**Silver -> Gold** -- Where multiple sources diverge on shared design system entities.\n", | |
| "\n", | |
| "Add conflict JSON file paths to the `CONFLICT_FILES` list and run all cells." | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 2, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000\">Ready</span>\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\u001b[32mReady\u001b[0m\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| } | |
| ], | |
| "source": [ | |
| "# ── Setup ─────────────────────────────────────────────────────────────────────\n", | |
| "try:\n", | |
| " import polars\n", | |
| "except ImportError:\n", | |
| " %pip install -q polars rich\n", | |
| "\n", | |
| "import json, re, io\n", | |
| "from pathlib import Path\n", | |
| "import polars as pl\n", | |
| "from rich.console import Console\n", | |
| "from rich.table import Table\n", | |
| "from rich import box\n", | |
| "\n", | |
| "console = Console(width=120)\n", | |
| "\n", | |
| "SOURCE_STYLES = {\n", | |
| " \"KNAPSACK\": \"bold blue\",\n", | |
| " \"STORYBOOK\": \"bold yellow\",\n", | |
| " \"FIGMA\": \"bold magenta\",\n", | |
| " \"CODE\": \"bold green\",\n", | |
| " \"MDX\": \"bold cyan\",\n", | |
| "}\n", | |
| "\n", | |
| "def styled_source(s: str) -> str:\n", | |
| " style = SOURCE_STYLES.get(s, \"bold white\")\n", | |
| " return f\"[{style}]{s}[/{style}]\"\n", | |
| "\n", | |
| "console.print(\"[green]Ready[/green]\")" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": "# ── Data loading ──────────────────────────────────────────────────────────────\n#\n# Accepts:\n# - A single ConflictBundle JSON object { \"conflict\": ..., \"items\": ..., \"diffs\": ... }\n# - A JSON array of ConflictBundles [ { ... }, { ... } ]\n# - Multi-bundle text output ==== Conflict Bundle ====\\n{ ... }\n\ndef parse_bundles(text: str) -> list[dict]:\n \"\"\"Parse conflict bundles from any supported format.\"\"\"\n text = text.strip()\n if text.startswith(\"{\"):\n return [json.loads(text)]\n if text.startswith(\"[\"):\n return json.loads(text)\n # Multi-bundle text format (\\s* tolerates \\r\\n and missing trailing newline)\n blocks = re.findall(\n r\"==== Conflict Bundle ====\\s*(\\{.*?\\})\\s*(?====|\\Z)\", text, re.DOTALL\n )\n return [json.loads(b) for b in blocks]\n\n\ndef dedupe(bundles: list[dict]) -> list[dict]:\n seen = set()\n out = []\n for b in bundles:\n fp = b[\"conflict\"][\"fingerprint\"]\n if fp not in seen:\n seen.add(fp)\n out.append(b)\n return out" | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 4, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> <span style=\"color: #008000; text-decoration-color: #008000\">+</span> output.txt\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| " \u001b[32m+\u001b[0m output.txt\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| }, | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> <span style=\"color: #008000; text-decoration-color: #008000\">+</span> conflicts.json\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| " \u001b[32m+\u001b[0m conflicts.json\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| }, | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", | |
| "<span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold\">3</span> unique entities loaded\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\n", | |
| "\u001b[1;32m3\u001b[0m unique entities loaded\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| } | |
| ], | |
| "source": [ | |
| "# ── Load conflicts ────────────────────────────────────────────────────────────\n", | |
| "#\n", | |
| "# Supports conflict JSON in any format:\n", | |
| "# - Single bundle: { \"conflict\": ..., \"items\": ..., \"diffs\": ... }\n", | |
| "# - Array: [ { ... }, { ... } ]\n", | |
| "# - output.txt: ==== Conflict Bundle ====\\n{ ... }\n", | |
| "\n", | |
| "# Detect environment\n", | |
| "try:\n", | |
| " from google.colab import files as _colab_files\n", | |
| " _IN_COLAB = True\n", | |
| "except ImportError:\n", | |
| " _IN_COLAB = False\n", | |
| "\n", | |
| "SAMPLE = []\n", | |
| "\n", | |
| "if _IN_COLAB:\n", | |
| " console.print(\"[bold]Upload conflict JSON files:[/bold]\")\n", | |
| " uploaded = _colab_files.upload()\n", | |
| " for name, content in uploaded.items():\n", | |
| " SAMPLE.extend(parse_bundles(content.decode()))\n", | |
| " console.print(f\" [green]+[/green] {name}\")\n", | |
| "else:\n", | |
| " CONFLICT_FILES = [\n", | |
| " Path(\"~/Downloads/output.txt\").expanduser(),\n", | |
| " Path(\"~/Downloads/conflicts.json\").expanduser(),\n", | |
| " # Add more paths here:\n", | |
| " ]\n", | |
| " for f in CONFLICT_FILES:\n", | |
| " if f.exists():\n", | |
| " SAMPLE.extend(parse_bundles(f.read_text()))\n", | |
| " console.print(f\" [green]+[/green] {f.name}\")\n", | |
| "\n", | |
| "BUNDLES = dedupe(SAMPLE)\n", | |
| "console.print(f\"\\n[bold green]{len(BUNDLES)}[/] unique entities loaded\")" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 5, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">44</span> anchor-level diffs across <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span> entities\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\u001b[1;36m44\u001b[0m anchor-level diffs across \u001b[1;36m3\u001b[0m entities\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| } | |
| ], | |
| "source": [ | |
| "# ── Flatten to polars ─────────────────────────────────────────────────────────\n", | |
| "\n", | |
| "def flatten_diffs(bundles: list[dict]) -> pl.DataFrame:\n", | |
| " rows = []\n", | |
| " for b in bundles:\n", | |
| " entity = b[\"conflict\"][\"entityRelPath\"]\n", | |
| " entity_type = b[\"conflict\"][\"entityType\"]\n", | |
| " sources = [item[\"sourceId\"] for item in b[\"items\"]]\n", | |
| " for d in b[\"diffs\"]:\n", | |
| " present = set()\n", | |
| " for defn in d[\"preview\"][\"definitions\"]:\n", | |
| " present.update(defn[\"sources\"])\n", | |
| " diff_kind = d[\"preview\"][\"diff\"][\"kind\"]\n", | |
| " missing = d[\"preview\"][\"diff\"].get(\"missingSourceIds\", [])\n", | |
| " row = {\n", | |
| " \"entity\": entity,\n", | |
| " \"entity_type\": entity_type,\n", | |
| " \"anchor\": d[\"anchor\"],\n", | |
| " \"verdict\": d[\"verdict\"],\n", | |
| " \"delta_count\": d[\"deltaCount\"],\n", | |
| " \"diff_kind\": diff_kind,\n", | |
| " \"summary\": d[\"diffSummary\"],\n", | |
| " \"present_in\": \",\".join(sorted(present)),\n", | |
| " \"missing_in\": \",\".join(sorted(missing)),\n", | |
| " }\n", | |
| " for s in sources:\n", | |
| " row[s] = (s not in missing) if diff_kind == \"MISSING_SOURCES\" else (s in present)\n", | |
| " rows.append(row)\n", | |
| " return pl.DataFrame(rows)\n", | |
| "\n", | |
| "df = flatten_diffs(BUNDLES)\n", | |
| "console.print(f\"[bold]{df.height}[/] anchor-level diffs across [bold]{df['entity'].n_unique()}[/] entities\")" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "---\n", | |
| "## Level 1 — Entity Queue" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 6, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\"> Entity Queue </span>\n", | |
| "╭──────────────┬───────────┬──────────────────────────┬───────┬───────────┬─────────╮\n", | |
| "│<span style=\"font-weight: bold\"> Entity </span>│<span style=\"font-weight: bold\"> Type </span>│<span style=\"font-weight: bold\"> Sources </span>│<span style=\"font-weight: bold\"> Diffs </span>│<span style=\"font-weight: bold\"> DIFFERENT </span>│<span style=\"font-weight: bold\"> MISSING </span>│\n", | |
| "├──────────────┼───────────┼──────────────────────────┼───────┼───────────┼─────────┤\n", | |
| "│<span style=\"font-weight: bold\"> button.react </span>│<span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> component </span>│ <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">KNAPSACK</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">STORYBOOK</span> │ 9 │<span style=\"color: #800000; text-decoration-color: #800000\"> 5 </span>│<span style=\"color: #808000; text-decoration-color: #808000\"> 4 </span>│\n", | |
| "├──────────────┼───────────┼──────────────────────────┼───────┼───────────┼─────────┤\n", | |
| "│<span style=\"font-weight: bold\"> card.react </span>│<span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> component </span>│ <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">KNAPSACK</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">STORYBOOK</span> │ 11 │<span style=\"color: #800000; text-decoration-color: #800000\"> 4 </span>│<span style=\"color: #808000; text-decoration-color: #808000\"> 7 </span>│\n", | |
| "├──────────────┼───────────┼──────────────────────────┼───────┼───────────┼─────────┤\n", | |
| "│<span style=\"font-weight: bold\"> modal.react </span>│<span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> component </span>│ <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">FIGMA</span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">KNAPSACK</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">STORYBOOK</span> │ 24 │<span style=\"color: #800000; text-decoration-color: #800000\"> 3 </span>│<span style=\"color: #808000; text-decoration-color: #808000\"> 21 </span>│\n", | |
| "╰──────────────┴───────────┴──────────────────────────┴───────┴───────────┴─────────╯\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\u001b[3m Entity Queue \u001b[0m\n", | |
| "╭──────────────┬───────────┬──────────────────────────┬───────┬───────────┬─────────╮\n", | |
| "│\u001b[1m \u001b[0m\u001b[1mEntity \u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mType \u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mSources \u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mDiffs\u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mDIFFERENT\u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mMISSING\u001b[0m\u001b[1m \u001b[0m│\n", | |
| "├──────────────┼───────────┼──────────────────────────┼───────┼───────────┼─────────┤\n", | |
| "│\u001b[1m \u001b[0m\u001b[1mbutton.react\u001b[0m\u001b[1m \u001b[0m│\u001b[2m \u001b[0m\u001b[2mcomponent\u001b[0m\u001b[2m \u001b[0m│ \u001b[1;34mKNAPSACK\u001b[0m \u001b[1;33mSTORYBOOK\u001b[0m │ 9 │\u001b[31m \u001b[0m\u001b[31m 5\u001b[0m\u001b[31m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m 4\u001b[0m\u001b[33m \u001b[0m│\n", | |
| "├──────────────┼───────────┼──────────────────────────┼───────┼───────────┼─────────┤\n", | |
| "│\u001b[1m \u001b[0m\u001b[1mcard.react \u001b[0m\u001b[1m \u001b[0m│\u001b[2m \u001b[0m\u001b[2mcomponent\u001b[0m\u001b[2m \u001b[0m│ \u001b[1;34mKNAPSACK\u001b[0m \u001b[1;33mSTORYBOOK\u001b[0m │ 11 │\u001b[31m \u001b[0m\u001b[31m 4\u001b[0m\u001b[31m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m 7\u001b[0m\u001b[33m \u001b[0m│\n", | |
| "├──────────────┼───────────┼──────────────────────────┼───────┼───────────┼─────────┤\n", | |
| "│\u001b[1m \u001b[0m\u001b[1mmodal.react \u001b[0m\u001b[1m \u001b[0m│\u001b[2m \u001b[0m\u001b[2mcomponent\u001b[0m\u001b[2m \u001b[0m│ \u001b[1;35mFIGMA\u001b[0m \u001b[1;34mKNAPSACK\u001b[0m \u001b[1;33mSTORYBOOK\u001b[0m │ 24 │\u001b[31m \u001b[0m\u001b[31m 3\u001b[0m\u001b[31m \u001b[0m│\u001b[33m \u001b[0m\u001b[33m 21\u001b[0m\u001b[33m \u001b[0m│\n", | |
| "╰──────────────┴───────────┴──────────────────────────┴───────┴───────────┴─────────╯\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| } | |
| ], | |
| "source": [ | |
| "t = Table(title=\"Entity Queue\", box=box.ROUNDED, show_lines=True)\n", | |
| "t.add_column(\"Entity\", style=\"bold\")\n", | |
| "t.add_column(\"Type\", style=\"dim\")\n", | |
| "t.add_column(\"Sources\")\n", | |
| "t.add_column(\"Diffs\", justify=\"right\")\n", | |
| "t.add_column(\"DIFFERENT\", justify=\"right\", style=\"red\")\n", | |
| "t.add_column(\"MISSING\", justify=\"right\", style=\"yellow\")\n", | |
| "\n", | |
| "for b in BUNDLES:\n", | |
| " entity = b[\"conflict\"][\"entityRelPath\"]\n", | |
| " etype = b[\"conflict\"][\"entityType\"]\n", | |
| " sources = [item[\"sourceId\"] for item in b[\"items\"]]\n", | |
| " n = len(b[\"diffs\"])\n", | |
| " n_diff = sum(1 for d in b[\"diffs\"] if d[\"verdict\"] == \"DIFFERENT\")\n", | |
| " n_miss = sum(1 for d in b[\"diffs\"] if d[\"verdict\"] == \"MISSING\")\n", | |
| " t.add_row(\n", | |
| " entity, etype.lower(),\n", | |
| " \" \".join(styled_source(s) for s in sources),\n", | |
| " str(n), str(n_diff), str(n_miss),\n", | |
| " )\n", | |
| "\n", | |
| "console.print(t)" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "---\n", | |
| "## Level 2 — Coverage Matrix\n", | |
| "\n", | |
| "For each entity: which anchors exist in which sources?\n", | |
| "\n", | |
| "- `●` present `○` absent" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 7, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| }, | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\"> button.react (2 sources, 9 diffs) </span>\n", | |
| " \n", | |
| " <span style=\"font-weight: bold\">Anchor </span> <span style=\"font-weight: bold\"> KNAPSACK </span> <span style=\"font-weight: bold\"> STORYBOOK </span> <span style=\"font-weight: bold\"> Verdict </span> <span style=\"font-weight: bold\"> Detail </span> \n", | |
| " ─────────────────────────────────────────────────────────────────────────────────────────────────────── \n", | |
| " <span style=\"font-weight: bold\">#props </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">DIFFERENT</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Content differs (STORYBOOK vs KNAPSACK)</span> \n", | |
| " <span style=\"font-weight: bold\">#props.size </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">DIFFERENT</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Content differs (KNAPSACK vs STORYBOOK)</span> \n", | |
| " <span style=\"font-weight: bold\">#props.variant </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">DIFFERENT</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Content differs (STORYBOOK vs KNAPSACK)</span> \n", | |
| " <span style=\"font-weight: bold\">#snippets.default </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">DIFFERENT</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Content differs (STORYBOOK vs KNAPSACK)</span> \n", | |
| " <span style=\"font-weight: bold\">#snippets.with-variant </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">DIFFERENT</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Content differs (STORYBOOK vs KNAPSACK)</span> \n", | |
| " <span style=\"font-weight: bold\">#props.loading </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 1 source </span> \n", | |
| " <span style=\"font-weight: bold\">#slots.icon </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 1 source </span> \n", | |
| " <span style=\"font-weight: bold\">#snippets.disabled </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 1 source </span> \n", | |
| " <span style=\"font-weight: bold\">#snippets.loading </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 1 source </span> \n", | |
| " \n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\u001b[3m button.react (2 sources, 9 diffs) \u001b[0m\n", | |
| " \n", | |
| " \u001b[1mAnchor \u001b[0m\u001b[1m \u001b[0m \u001b[1m \u001b[0m\u001b[1mKNAPSACK\u001b[0m\u001b[1m \u001b[0m \u001b[1m \u001b[0m\u001b[1mSTORYBOOK\u001b[0m\u001b[1m \u001b[0m \u001b[1m \u001b[0m\u001b[1mVerdict \u001b[0m\u001b[1m \u001b[0m \u001b[1m \u001b[0m\u001b[1mDetail \u001b[0m \n", | |
| " ─────────────────────────────────────────────────────────────────────────────────────────────────────── \n", | |
| " \u001b[1m#props \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;31mDIFFERENT\u001b[0m \u001b[2m \u001b[0m\u001b[2mContent differs (STORYBOOK vs KNAPSACK)\u001b[0m \n", | |
| " \u001b[1m#props.size \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;31mDIFFERENT\u001b[0m \u001b[2m \u001b[0m\u001b[2mContent differs (KNAPSACK vs STORYBOOK)\u001b[0m \n", | |
| " \u001b[1m#props.variant \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;31mDIFFERENT\u001b[0m \u001b[2m \u001b[0m\u001b[2mContent differs (STORYBOOK vs KNAPSACK)\u001b[0m \n", | |
| " \u001b[1m#snippets.default \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;31mDIFFERENT\u001b[0m \u001b[2m \u001b[0m\u001b[2mContent differs (STORYBOOK vs KNAPSACK)\u001b[0m \n", | |
| " \u001b[1m#snippets.with-variant \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;31mDIFFERENT\u001b[0m \u001b[2m \u001b[0m\u001b[2mContent differs (STORYBOOK vs KNAPSACK)\u001b[0m \n", | |
| " \u001b[1m#props.loading \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 1 source \u001b[0m \n", | |
| " \u001b[1m#slots.icon \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 1 source \u001b[0m \n", | |
| " \u001b[1m#snippets.disabled \u001b[0m\u001b[1m \u001b[0m \u001b[2m○\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 1 source \u001b[0m \n", | |
| " \u001b[1m#snippets.loading \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 1 source \u001b[0m \n", | |
| " \n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| }, | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| }, | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| }, | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\"> card.react (2 sources, 11 diffs) </span>\n", | |
| " \n", | |
| " <span style=\"font-weight: bold\">Anchor </span> <span style=\"font-weight: bold\"> KNAPSACK </span> <span style=\"font-weight: bold\"> STORYBOOK </span> <span style=\"font-weight: bold\"> Verdict </span> <span style=\"font-weight: bold\"> Detail </span> \n", | |
| " ─────────────────────────────────────────────────────────────────────────────────────────────────────── \n", | |
| " <span style=\"font-weight: bold\">#description </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">DIFFERENT</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Content differs (KNAPSACK vs STORYBOOK)</span> \n", | |
| " <span style=\"font-weight: bold\">#props </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">DIFFERENT</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Content differs (STORYBOOK vs KNAPSACK)</span> \n", | |
| " <span style=\"font-weight: bold\">#props.padding </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">DIFFERENT</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Content differs (KNAPSACK vs STORYBOOK)</span> \n", | |
| " <span style=\"font-weight: bold\">#snippets.default </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">DIFFERENT</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Content differs (STORYBOOK vs KNAPSACK)</span> \n", | |
| " <span style=\"font-weight: bold\">#props.elevation </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 1 source </span> \n", | |
| " <span style=\"font-weight: bold\">#props.interactive </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 1 source </span> \n", | |
| " <span style=\"font-weight: bold\">#slots.footer </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 1 source </span> \n", | |
| " <span style=\"font-weight: bold\">#slots.header </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 1 source </span> \n", | |
| " <span style=\"font-weight: bold\">#snippets.elevated </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 1 source </span> \n", | |
| " <span style=\"font-weight: bold\">#snippets.interactive </span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 1 source </span> \n", | |
| " <span style=\"font-weight: bold\">#snippets.no-border </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 1 source </span> \n", | |
| " \n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\u001b[3m card.react (2 sources, 11 diffs) \u001b[0m\n", | |
| " \n", | |
| " \u001b[1mAnchor \u001b[0m\u001b[1m \u001b[0m \u001b[1m \u001b[0m\u001b[1mKNAPSACK\u001b[0m\u001b[1m \u001b[0m \u001b[1m \u001b[0m\u001b[1mSTORYBOOK\u001b[0m\u001b[1m \u001b[0m \u001b[1m \u001b[0m\u001b[1mVerdict \u001b[0m\u001b[1m \u001b[0m \u001b[1m \u001b[0m\u001b[1mDetail \u001b[0m \n", | |
| " ─────────────────────────────────────────────────────────────────────────────────────────────────────── \n", | |
| " \u001b[1m#description \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;31mDIFFERENT\u001b[0m \u001b[2m \u001b[0m\u001b[2mContent differs (KNAPSACK vs STORYBOOK)\u001b[0m \n", | |
| " \u001b[1m#props \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;31mDIFFERENT\u001b[0m \u001b[2m \u001b[0m\u001b[2mContent differs (STORYBOOK vs KNAPSACK)\u001b[0m \n", | |
| " \u001b[1m#props.padding \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;31mDIFFERENT\u001b[0m \u001b[2m \u001b[0m\u001b[2mContent differs (KNAPSACK vs STORYBOOK)\u001b[0m \n", | |
| " \u001b[1m#snippets.default \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;31mDIFFERENT\u001b[0m \u001b[2m \u001b[0m\u001b[2mContent differs (STORYBOOK vs KNAPSACK)\u001b[0m \n", | |
| " \u001b[1m#props.elevation \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 1 source \u001b[0m \n", | |
| " \u001b[1m#props.interactive \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 1 source \u001b[0m \n", | |
| " \u001b[1m#slots.footer \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 1 source \u001b[0m \n", | |
| " \u001b[1m#slots.header \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 1 source \u001b[0m \n", | |
| " \u001b[1m#snippets.elevated \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 1 source \u001b[0m \n", | |
| " \u001b[1m#snippets.interactive \u001b[0m\u001b[1m \u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 1 source \u001b[0m \n", | |
| " \u001b[1m#snippets.no-border \u001b[0m\u001b[1m \u001b[0m \u001b[2m○\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 1 source \u001b[0m \n", | |
| " \n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| }, | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| }, | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| }, | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\"> modal.react (3 sources, 24 diffs) </span>\n", | |
| " \n", | |
| " <span style=\"font-weight: bold\">Anchor </span> <span style=\"font-weight: bold\"> FIGMA </span> <span style=\"font-weight: bold\"> KNAPSACK </span> <span style=\"font-weight: bold\"> STORYBOOK </span> <span style=\"font-weight: bold\"> Verdict </span> <span style=\"font-weight: bold\"> Detail </span> \n", | |
| " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n", | |
| " <span style=\"font-weight: bold\">#overview </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">●</span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">DIFFERENT</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Content differs across 3 definitions </span> \n", | |
| " <span style=\"font-weight: bold\">#props.size </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">●</span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">DIFFERENT</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Content differs across 3 definitions </span> \n", | |
| " <span style=\"font-weight: bold\">#title </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">●</span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">DIFFERENT</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Content differs (KNAPSACK, STORYBOOK +1)</span> \n", | |
| " <span style=\"font-weight: bold\">#accessibility </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#migration </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#props.danger </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#props.dismissible </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#props.isOpen </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#props.kind </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#props.onClose </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#props.onRequestClose </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#props.open </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">●</span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 1 source </span> \n", | |
| " <span style=\"font-weight: bold\">#props.returnFocus </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#slots </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#slots.body </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#slots.footer </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#slots.title </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#snippets.confirm-delete </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#snippets.destructive </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#snippets.long-content </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#snippets.non-dismissible </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#snippets.scroll </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">●</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " <span style=\"font-weight: bold\">#usage </span> <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">●</span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 1 source </span> \n", | |
| " <span style=\"font-weight: bold\">#usage.do-dont </span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">●</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">○</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">MISSING</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> Missing in 2 sources </span> \n", | |
| " \n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\u001b[3m modal.react (3 sources, 24 diffs) \u001b[0m\n", | |
| " \n", | |
| " \u001b[1mAnchor \u001b[0m\u001b[1m \u001b[0m \u001b[1m \u001b[0m\u001b[1mFIGMA \u001b[0m\u001b[1m \u001b[0m \u001b[1m \u001b[0m\u001b[1mKNAPSACK\u001b[0m\u001b[1m \u001b[0m \u001b[1m \u001b[0m\u001b[1mSTORYBOOK\u001b[0m\u001b[1m \u001b[0m \u001b[1m \u001b[0m\u001b[1mVerdict \u001b[0m\u001b[1m \u001b[0m \u001b[1m \u001b[0m\u001b[1mDetail \u001b[0m \n", | |
| " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n", | |
| " \u001b[1m#overview \u001b[0m\u001b[1m \u001b[0m \u001b[1;35m●\u001b[0m \u001b[1;34m●\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;31mDIFFERENT\u001b[0m \u001b[2m \u001b[0m\u001b[2mContent differs across 3 definitions \u001b[0m \n", | |
| " \u001b[1m#props.size \u001b[0m\u001b[1m \u001b[0m \u001b[1;35m●\u001b[0m \u001b[1;34m●\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;31mDIFFERENT\u001b[0m \u001b[2m \u001b[0m\u001b[2mContent differs across 3 definitions \u001b[0m \n", | |
| " \u001b[1m#title \u001b[0m\u001b[1m \u001b[0m \u001b[1;35m●\u001b[0m \u001b[1;34m●\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;31mDIFFERENT\u001b[0m \u001b[2m \u001b[0m\u001b[2mContent differs (KNAPSACK, STORYBOOK +1)\u001b[0m \n", | |
| " \u001b[1m#accessibility \u001b[0m\u001b[1m \u001b[0m \u001b[2m○\u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#migration \u001b[0m\u001b[1m \u001b[0m \u001b[1;35m●\u001b[0m \u001b[2m○\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#props.danger \u001b[0m\u001b[1m \u001b[0m \u001b[2m○\u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#props.dismissible \u001b[0m\u001b[1m \u001b[0m \u001b[1;35m●\u001b[0m \u001b[2m○\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#props.isOpen \u001b[0m\u001b[1m \u001b[0m \u001b[2m○\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#props.kind \u001b[0m\u001b[1m \u001b[0m \u001b[2m○\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#props.onClose \u001b[0m\u001b[1m \u001b[0m \u001b[2m○\u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#props.onRequestClose \u001b[0m\u001b[1m \u001b[0m \u001b[2m○\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#props.open \u001b[0m\u001b[1m \u001b[0m \u001b[1;35m●\u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 1 source \u001b[0m \n", | |
| " \u001b[1m#props.returnFocus \u001b[0m\u001b[1m \u001b[0m \u001b[1;35m●\u001b[0m \u001b[2m○\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#slots \u001b[0m\u001b[1m \u001b[0m \u001b[2m○\u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#slots.body \u001b[0m\u001b[1m \u001b[0m \u001b[2m○\u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#slots.footer \u001b[0m\u001b[1m \u001b[0m \u001b[2m○\u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#slots.title \u001b[0m\u001b[1m \u001b[0m \u001b[2m○\u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#snippets.confirm-delete \u001b[0m\u001b[1m \u001b[0m \u001b[2m○\u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#snippets.destructive \u001b[0m\u001b[1m \u001b[0m \u001b[1;35m●\u001b[0m \u001b[2m○\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#snippets.long-content \u001b[0m\u001b[1m \u001b[0m \u001b[2m○\u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#snippets.non-dismissible\u001b[0m\u001b[1m \u001b[0m \u001b[1;35m●\u001b[0m \u001b[2m○\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#snippets.scroll \u001b[0m\u001b[1m \u001b[0m \u001b[2m○\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33m●\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \u001b[1m#usage \u001b[0m\u001b[1m \u001b[0m \u001b[1;35m●\u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 1 source \u001b[0m \n", | |
| " \u001b[1m#usage.do-dont \u001b[0m\u001b[1m \u001b[0m \u001b[2m○\u001b[0m \u001b[1;34m●\u001b[0m \u001b[2m○\u001b[0m \u001b[1;33mMISSING\u001b[0m \u001b[2m \u001b[0m\u001b[2mMissing in 2 sources \u001b[0m \n", | |
| " \n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| }, | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| } | |
| ], | |
| "source": [ | |
| "def coverage_table(bundle: dict) -> Table:\n", | |
| " entity = bundle[\"conflict\"][\"entityRelPath\"]\n", | |
| " sources = [item[\"sourceId\"] for item in bundle[\"items\"]]\n", | |
| " diffs = sorted(bundle[\"diffs\"], key=lambda d: (d[\"verdict\"] != \"DIFFERENT\", d[\"anchor\"]))\n", | |
| "\n", | |
| " t = Table(\n", | |
| " title=f\"{entity} ({len(sources)} sources, {len(diffs)} diffs)\",\n", | |
| " box=box.SIMPLE_HEAD, show_lines=False, pad_edge=False,\n", | |
| " )\n", | |
| " t.add_column(\"Anchor\", style=\"bold\", min_width=24)\n", | |
| " for s in sources:\n", | |
| " t.add_column(s, justify=\"center\", min_width=6)\n", | |
| " t.add_column(\"Verdict\", min_width=10)\n", | |
| " t.add_column(\"Detail\", style=\"dim\", max_width=40)\n", | |
| "\n", | |
| " for d in diffs:\n", | |
| " present = set()\n", | |
| " for defn in d[\"preview\"][\"definitions\"]:\n", | |
| " present.update(defn[\"sources\"])\n", | |
| " missing = set(d[\"preview\"][\"diff\"].get(\"missingSourceIds\", []))\n", | |
| "\n", | |
| " dots = []\n", | |
| " for s in sources:\n", | |
| " has_it = (s not in missing) if d[\"preview\"][\"diff\"][\"kind\"] == \"MISSING_SOURCES\" else (s in present)\n", | |
| " style = SOURCE_STYLES.get(s, \"white\")\n", | |
| " dots.append(f\"[{style}]●[/{style}]\" if has_it else \"[dim]○[/dim]\")\n", | |
| "\n", | |
| " vs = \"bold red\" if d[\"verdict\"] == \"DIFFERENT\" else \"bold yellow\"\n", | |
| " t.add_row(d[\"anchor\"], *dots, f\"[{vs}]{d['verdict']}[/{vs}]\", d[\"diffSummary\"])\n", | |
| " return t\n", | |
| "\n", | |
| "\n", | |
| "for b in BUNDLES:\n", | |
| " console.print()\n", | |
| " console.print(coverage_table(b))\n", | |
| " console.print()" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "metadata": {}, | |
| "source": [ | |
| "---\n", | |
| "## Summary" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": "---\n## Level 3 — Diff Detail\n\nPick an entity and anchor to drill into the actual content divergence.", | |
| "metadata": {} | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": "from rich.panel import Panel\nfrom rich.columns import Columns\nfrom rich.text import Text\nfrom rich.syntax import Syntax\n\ndef _lookup(entity: str, anchor: str | None = None):\n \"\"\"Find a bundle by entity name (fuzzy), optionally a diff by anchor.\"\"\"\n bundle = None\n for b in BUNDLES:\n if entity in b[\"conflict\"][\"entityRelPath\"]:\n bundle = b\n break\n if not bundle:\n console.print(f\"[red]Entity not found:[/red] {entity}\")\n return None, None\n if anchor is None:\n return bundle, None\n if not anchor.startswith(\"#\"):\n anchor = \"#\" + anchor\n for d in bundle[\"diffs\"]:\n if d[\"anchor\"] == anchor:\n return bundle, d\n console.print(f\"[red]Anchor not found:[/red] {anchor}\")\n console.print(\" Available:\", \", \".join(d[\"anchor\"] for d in bundle[\"diffs\"]))\n return bundle, None\n\n\ndef show_diff(entity: str, anchor: str):\n \"\"\"Show a rich diff for one entity + anchor.\"\"\"\n bundle, diff = _lookup(entity, anchor)\n if not diff:\n return\n\n sources = [i[\"sourceId\"] for i in bundle[\"items\"]]\n verdict = diff[\"verdict\"]\n vc = \"red\" if verdict == \"DIFFERENT\" else \"yellow\"\n\n console.print()\n console.print(Panel(\n f\"[bold]{bundle['conflict']['entityRelPath']}[/bold] > [bold]{diff['anchor']}[/bold]\"\n f\" [{vc}]{verdict}[/{vc}]\"\n f\"\\n[dim]{diff['diffSummary']}[/dim]\",\n title=\"Diff Detail\", border_style=\"bright_blue\",\n ))\n\n # ── Definitions: what each source says ──\n for defn in diff[\"preview\"][\"definitions\"]:\n src_label = \" \".join(styled_source(s) for s in defn[\"sources\"])\n val = defn.get(\"value\")\n if val is None:\n console.print(Panel(\n f\"[dim]Content not inlined (hash: {defn['hash']})[/dim]\",\n title=src_label, border_style=\"dim\",\n ))\n elif val[\"kind\"] == \"TEXT\":\n lang = val.get(\"lang\", \"\")\n if lang == \"tsx\":\n lang = \"typescript\"\n body = Syntax(val[\"text\"], lang or \"text\", theme=\"monokai\", word_wrap=True) if val[\"text\"].strip() else Text(\"(empty)\", style=\"dim italic\")\n console.print(Panel(body, title=src_label, border_style=\"bright_white\"))\n elif val[\"kind\"] == \"TABLE\":\n tbl = Table(box=box.SIMPLE, show_lines=False, pad_edge=False)\n for col in val[\"table\"][\"columns\"]:\n tbl.add_column(col)\n for row in val[\"table\"][\"rows\"]:\n tbl.add_row(*(row.get(c, \"\") for c in val[\"table\"][\"columns\"]))\n console.print(Panel(tbl, title=src_label, border_style=\"bright_white\"))\n\n # ── Diff payload ──\n payload = diff[\"preview\"][\"diff\"]\n kind = payload[\"kind\"]\n\n if kind == \"MISSING_SOURCES\":\n missing = payload[\"missingSourceIds\"]\n present = set()\n for defn in diff[\"preview\"][\"definitions\"]:\n present.update(defn[\"sources\"])\n t = Text()\n t.append(\"Present: \", style=\"bold\")\n t.append(\", \".join(sorted(present)), style=\"green\")\n t.append(\" Missing: \", style=\"bold\")\n t.append(\", \".join(missing), style=\"red bold\")\n console.print(Panel(t, title=\"Coverage\", border_style=\"yellow\"))\n\n elif kind == \"TEXT_UNIFIED\":\n for patch in payload[\"patches\"]:\n lines = patch[\"text\"].split(\"\\\\n\") if \"\\\\n\" in patch[\"text\"] else patch[\"text\"].splitlines()\n rich_lines = Text()\n for line in lines:\n if line.startswith(\"-\"):\n rich_lines.append(line + \"\\n\", style=\"red\")\n elif line.startswith(\"+\"):\n rich_lines.append(line + \"\\n\", style=\"green\")\n else:\n rich_lines.append(line + \"\\n\", style=\"dim\")\n console.print(Panel(rich_lines, title=\"Unified Diff\", border_style=\"magenta\"))\n\n elif kind == \"TABLE_DELTA\":\n for entry in payload[\"deltas\"]:\n delta = entry[\"delta\"]\n t = Text()\n if delta.get(\"added\"):\n t.append(\"+ Added rows: \", style=\"green bold\")\n t.append(\", \".join(delta[\"added\"]) + \"\\n\", style=\"green\")\n if delta.get(\"removed\"):\n t.append(\"- Removed rows: \", style=\"red bold\")\n t.append(\", \".join(delta[\"removed\"]) + \"\\n\", style=\"red\")\n if delta.get(\"changed\"):\n t.append(\"~ Changed rows: \", style=\"yellow bold\")\n t.append(\", \".join(delta[\"changed\"]) + \"\\n\", style=\"yellow\")\n console.print(Panel(t, title=\"Table Delta\", border_style=\"magenta\"))\n\n\ndef show_entity(entity: str):\n \"\"\"Show all diffs for an entity.\"\"\"\n bundle, _ = _lookup(entity)\n if not bundle:\n return\n for d in bundle[\"diffs\"]:\n show_diff(entity, d[\"anchor\"])", | |
| "metadata": {}, | |
| "execution_count": null, | |
| "outputs": [] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": "# Try it: show_diff(\"modal\", \"#props.size\") or show_diff(\"button\", \"#props\")\nshow_diff(\"modal\", \"#overview\")", | |
| "metadata": {}, | |
| "execution_count": null, | |
| "outputs": [] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 8, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\">Verdict breakdown per entity</span>\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\u001b[1mVerdict breakdown per entity\u001b[0m\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| }, | |
| { | |
| "name": "stdout", | |
| "output_type": "stream", | |
| "text": [ | |
| "shape: (3, 3)\n", | |
| "┌──────────────┬─────────┬───────────┐\n", | |
| "│ entity ┆ MISSING ┆ DIFFERENT │\n", | |
| "│ --- ┆ --- ┆ --- │\n", | |
| "│ str ┆ u32 ┆ u32 │\n", | |
| "╞══════════════╪═════════╪═══════════╡\n", | |
| "│ button.react ┆ 4 ┆ 5 │\n", | |
| "│ card.react ┆ 7 ┆ 4 │\n", | |
| "│ modal.react ┆ 21 ┆ 3 │\n", | |
| "└──────────────┴─────────┴───────────┘\n" | |
| ] | |
| }, | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| }, | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\">Diff kind x verdict</span>\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\u001b[1mDiff kind x verdict\u001b[0m\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| }, | |
| { | |
| "name": "stdout", | |
| "output_type": "stream", | |
| "text": [ | |
| "shape: (3, 3)\n", | |
| "┌─────────────────┬───────────┬─────┐\n", | |
| "│ diff_kind ┆ verdict ┆ len │\n", | |
| "│ --- ┆ --- ┆ --- │\n", | |
| "│ str ┆ str ┆ u32 │\n", | |
| "╞═════════════════╪═══════════╪═════╡\n", | |
| "│ MISSING_SOURCES ┆ MISSING ┆ 32 │\n", | |
| "│ TEXT_UNIFIED ┆ DIFFERENT ┆ 10 │\n", | |
| "│ TABLE_DELTA ┆ DIFFERENT ┆ 2 │\n", | |
| "└─────────────────┴───────────┴─────┘\n" | |
| ] | |
| }, | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| }, | |
| { | |
| "data": { | |
| "text/html": [ | |
| "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\"> Source Richness </span>\n", | |
| "╭───────────┬─────────────╮\n", | |
| "│<span style=\"font-weight: bold\"> Source </span>│<span style=\"font-weight: bold\"> Definitions </span>│\n", | |
| "├───────────┼─────────────┤\n", | |
| "│ <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">KNAPSACK</span> │ 33 │\n", | |
| "│ <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">STORYBOOK</span> │ 18 │\n", | |
| "│ <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">FIGMA</span> │ 10 │\n", | |
| "╰───────────┴─────────────╯\n", | |
| "</pre>\n" | |
| ], | |
| "text/plain": [ | |
| "\u001b[3m Source Richness \u001b[0m\n", | |
| "╭───────────┬─────────────╮\n", | |
| "│\u001b[1m \u001b[0m\u001b[1mSource \u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mDefinitions\u001b[0m\u001b[1m \u001b[0m│\n", | |
| "├───────────┼─────────────┤\n", | |
| "│ \u001b[1;34mKNAPSACK\u001b[0m │ 33 │\n", | |
| "│ \u001b[1;33mSTORYBOOK\u001b[0m │ 18 │\n", | |
| "│ \u001b[1;35mFIGMA\u001b[0m │ 10 │\n", | |
| "╰───────────┴─────────────╯\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| } | |
| ], | |
| "source": [ | |
| "summary = (\n", | |
| " df.group_by(\"entity\", \"verdict\")\n", | |
| " .len()\n", | |
| " .pivot(on=\"verdict\", index=\"entity\", values=\"len\")\n", | |
| " .fill_null(0)\n", | |
| " .sort(\"entity\")\n", | |
| ")\n", | |
| "console.print(\"[bold]Verdict breakdown per entity[/bold]\")\n", | |
| "print(summary)\n", | |
| "console.print()\n", | |
| "\n", | |
| "kind_dist = df.group_by(\"diff_kind\", \"verdict\").len().sort(\"len\", descending=True)\n", | |
| "console.print(\"[bold]Diff kind x verdict[/bold]\")\n", | |
| "print(kind_dist)\n", | |
| "console.print()\n", | |
| "\n", | |
| "source_counts = {}\n", | |
| "for b in BUNDLES:\n", | |
| " for d in b[\"diffs\"]:\n", | |
| " for defn in d[\"preview\"][\"definitions\"]:\n", | |
| " for s in defn[\"sources\"]:\n", | |
| " source_counts[s] = source_counts.get(s, 0) + 1\n", | |
| "\n", | |
| "t = Table(title=\"Source Richness\", box=box.ROUNDED)\n", | |
| "t.add_column(\"Source\")\n", | |
| "t.add_column(\"Definitions\", justify=\"right\")\n", | |
| "for s, c in sorted(source_counts.items(), key=lambda x: -x[1]):\n", | |
| " style = SOURCE_STYLES.get(s, \"white\")\n", | |
| " t.add_row(f\"[{style}]{s}[/{style}]\", str(c))\n", | |
| "console.print(t)" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [] | |
| } | |
| ], | |
| "metadata": { | |
| "kernelspec": { | |
| "display_name": "Python 3 (ipykernel)", | |
| "language": "python", | |
| "name": "python3" | |
| }, | |
| "language_info": { | |
| "codemirror_mode": { | |
| "name": "ipython", | |
| "version": 3 | |
| }, | |
| "file_extension": ".py", | |
| "mimetype": "text/x-python", | |
| "name": "python", | |
| "nbconvert_exporter": "python", | |
| "pygments_lexer": "ipython3", | |
| "version": "3.12.9" | |
| } | |
| }, | |
| "nbformat": 4, | |
| "nbformat_minor": 4 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment