transcript-viewer 0.11.2__tar.gz → 0.11.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/PKG-INFO +1 -1
  2. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/pyproject.toml +1 -1
  3. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/src/transcript_viewer/page.html +17 -3
  4. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/tests/page.test.js +51 -0
  5. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/uv.lock +1 -1
  6. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/.coverage +0 -0
  7. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/.github/workflows/publish.yml +0 -0
  8. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/.github/workflows/test.yml +0 -0
  9. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/.gitignore +0 -0
  10. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/README.md +0 -0
  11. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/design/Anchor.dc.html +0 -0
  12. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/design/Dense.dc.html +0 -0
  13. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/design/Hover.dc.html +0 -0
  14. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/design/Main.dc.html +0 -0
  15. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/design/Quiet.dc.html +0 -0
  16. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/design/canvas.json +0 -0
  17. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/design/delegation-timeline.html +0 -0
  18. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/src/transcript_viewer/__init__.py +0 -0
  19. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/src/transcript_viewer/ai.py +0 -0
  20. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/src/transcript_viewer/cli.py +0 -0
  21. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/src/transcript_viewer/config.py +0 -0
  22. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/src/transcript_viewer/corpus.py +0 -0
  23. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/src/transcript_viewer/fetch.py +0 -0
  24. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/src/transcript_viewer/library.py +0 -0
  25. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/src/transcript_viewer/store.py +0 -0
  26. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/src/transcript_viewer/viewer.py +0 -0
  27. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/tests/fixtures/big-command.json +0 -0
  28. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/tests/test_ai.py +0 -0
  29. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/tests/test_cli.py +0 -0
  30. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/tests/test_config.py +0 -0
  31. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/tests/test_corpus.py +0 -0
  32. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/tests/test_fetch.py +0 -0
  33. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/tests/test_library.py +0 -0
  34. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/tests/test_page.py +0 -0
  35. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/tests/test_readme.py +0 -0
  36. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/tests/test_store.py +0 -0
  37. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/tests/test_stream.py +0 -0
  38. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/tests/test_style.py +0 -0
  39. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/tests/test_tidiness.py +0 -0
  40. {transcript_viewer-0.11.2 → transcript_viewer-0.11.3}/tests/test_viewer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: transcript-viewer
3
- Version: 0.11.2
3
+ Version: 0.11.3
4
4
  Summary: Browse agent transcripts in a local, dependency-free web viewer.
5
5
  License: MIT
6
6
  Requires-Python: >=3.12
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "transcript-viewer"
3
- version = "0.11.2"
3
+ version = "0.11.3"
4
4
  description = "Browse agent transcripts in a local, dependency-free web viewer."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -2750,6 +2750,18 @@ function laneCard(ev, id) {
2750
2750
  first. A lane from a record where nothing spawned it is found in the block
2751
2751
  after the run instead — which only exists in the plain view, so a lens or a
2752
2752
  search is cleared to get back to it rather than failing quietly. */
2753
+ /* Put an element at the top of the reading area, with room to breathe. */
2754
+ function laneScroll(el) {
2755
+ const main = document.getElementById("main");
2756
+ if (!main || !el.getBoundingClientRect || !main.getBoundingClientRect) {
2757
+ if (el.scrollIntoView) el.scrollIntoView({ behavior: "smooth", block: "start" });
2758
+ return;
2759
+ }
2760
+ const top =
2761
+ main.scrollTop + el.getBoundingClientRect().top - main.getBoundingClientRect().top - 16;
2762
+ main.scrollTo({ top: Math.max(0, top), behavior: "smooth" });
2763
+ }
2764
+
2753
2765
  function openLane(id) {
2754
2766
  laneCard(null);
2755
2767
  const lane = LANES.find((l) => l.id === id);
@@ -2783,9 +2795,11 @@ function openLane(id) {
2783
2795
  box.classList.add("found");
2784
2796
  // After the fold, not before: opening changes the height, and scrolling to
2785
2797
  // where the box used to end leaves the reader above what they asked for.
2786
- requestAnimationFrame(() =>
2787
- box.scrollIntoView({ behavior: "smooth", block: "center" }),
2788
- );
2798
+ //
2799
+ // To the top of it, not the middle. Centring a box puts a subagent of any
2800
+ // length halfway through itself, when what was asked for was the subagent —
2801
+ // which starts at its first step.
2802
+ requestAnimationFrame(() => laneScroll(box));
2789
2803
  setTimeout(() => box.classList.remove("found"), 1400);
2790
2804
  }
2791
2805
 
@@ -2124,3 +2124,54 @@ test("a lane whose box is filtered away brings the view back rather than failing
2124
2124
  assert.strictEqual(out.query, "");
2125
2125
  assert.strictEqual(out.found, true);
2126
2126
  });
2127
+
2128
+ test("a lane lands on the top of what it opened, not the middle of it", () => {
2129
+ // Centring put a long subagent halfway through itself. What was asked for is
2130
+ // the subagent, which starts at its first step.
2131
+ const moved = [];
2132
+ const box = {
2133
+ open: false,
2134
+ classList: { add() {}, remove() {} },
2135
+ getBoundingClientRect: () => ({ top: 900 }),
2136
+ };
2137
+ const main = {
2138
+ scrollTop: 200,
2139
+ getBoundingClientRect: () => ({ top: 60 }),
2140
+ scrollTo: (opts) => moved.push(opts),
2141
+ };
2142
+ global.__el = { main, box };
2143
+
2144
+ run(`
2145
+ document.getElementById = (id) => (id === "main" ? globalThis.__el.main : null);
2146
+ laneScroll(globalThis.__el.box);
2147
+ `);
2148
+
2149
+ assert.strictEqual(moved.length, 1, "it should scroll the reading area itself");
2150
+ // 200 + 900 - 60 - 16 of breathing room.
2151
+ assert.strictEqual(moved[0].top, 1024);
2152
+ assert.strictEqual(moved[0].behavior, "smooth");
2153
+ });
2154
+
2155
+ test("landing does not scroll above the top of the run", () => {
2156
+ const moved = [];
2157
+ global.__el2 = {
2158
+ main: {
2159
+ scrollTop: 0,
2160
+ getBoundingClientRect: () => ({ top: 60 }),
2161
+ scrollTo: (o) => moved.push(o),
2162
+ },
2163
+ box: { getBoundingClientRect: () => ({ top: 10 }) },
2164
+ };
2165
+ run(`
2166
+ document.getElementById = (id) => (id === "main" ? globalThis.__el2.main : null);
2167
+ laneScroll(globalThis.__el2.box);
2168
+ `);
2169
+ assert.strictEqual(moved[0].top, 0, "never a negative offset");
2170
+ });
2171
+
2172
+ test("the box a lane opened is marked, and the mark is a real rule", () => {
2173
+ const style = page.slice(page.indexOf("<style>"), page.indexOf("</style>"));
2174
+ assert.match(style, /\.branch\.found\{/, "the class must style something");
2175
+ const script = page.slice(page.indexOf("<script>"), page.lastIndexOf("</script>"));
2176
+ assert.match(script, /classList\.add\("found"\)/, "and something must set it");
2177
+ });
@@ -388,7 +388,7 @@ wheels = [
388
388
 
389
389
  [[package]]
390
390
  name = "transcript-viewer"
391
- version = "0.11.2"
391
+ version = "0.11.3"
392
392
  source = { editable = "." }
393
393
  dependencies = [
394
394
  { name = "atif-make" },