cc-continuity 0.3.32__tar.gz → 0.3.34__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.
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/PKG-INFO +1 -1
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/README.md +2 -2
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/__init__.py +1 -1
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/transcript.py +49 -8
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity.egg-info/PKG-INFO +1 -1
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/pyproject.toml +1 -1
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_transcript.py +58 -5
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/LICENSE +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/__main__.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/atomic.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/blink.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/blink_watch.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/bootstrap.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/checkpoint.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/cli.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/config.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/daemon_supervisor.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/doctor.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/gitsnap.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/hooks/__init__.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/hooks/common.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/hooks/pre_compact.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/hooks/pre_tool_use.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/hooks/session_end.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/hooks/session_start.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/hooks/stop.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/hooks/task.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/hooks/tool_use.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/hooks/user_prompt.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/hosting.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/install.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/launch.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/ledger.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/lock.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/managed.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/naming.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/notify.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/paths.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/power_plug.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/progress_pane.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/project.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/redact.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/rotator.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/settings_merge.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/skills.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/state.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/statusline.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/thresholds.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/validate.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/watchdog.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/watchdog_digest.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity/watchdogd.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity.egg-info/SOURCES.txt +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity.egg-info/dependency_links.txt +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity.egg-info/entry_points.txt +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/cc_continuity.egg-info/top_level.txt +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/setup.cfg +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_atomic.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_blink.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_blink_watch.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_bootstrap.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_checkpoint.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_cli.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_cli_ledger.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_config.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_daemon_supervisor.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_doctor.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_gitsnap.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_hooks_common.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_hooks_pre_compact.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_hooks_pre_tool_use.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_hooks_session_end.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_hooks_session_start.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_hooks_stop.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_hooks_task.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_hooks_tool_use.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_hooks_user_prompt.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_hosting.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_hygiene.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_install.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_integration_phase5.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_integration_phase6.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_integration_phase7.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_launch.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_ledger.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_lock.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_managed.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_naming.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_notify.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_notify_integration.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_paths.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_power_plug.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_progress_pane.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_project.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_redact.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_rotator.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_settings_merge.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_skills.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_state.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_status.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_statusline.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_thresholds.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_tmux_host.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_transcript_finalize.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_uninstall.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_validate.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_watchdog.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_watchdog_digest.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_watchdog_integration.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_watchdogd.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_wsl_doctor.py +0 -0
- {cc_continuity-0.3.32 → cc_continuity-0.3.34}/tests/test_wsl_install.py +0 -0
|
@@ -26,11 +26,11 @@ The five most recent updates, newest first. Each line links to its
|
|
|
26
26
|
commit, so you can see what changed lately without digging through the
|
|
27
27
|
log:
|
|
28
28
|
|
|
29
|
+
- **2026-11-14**: The dark icon chip (the trace a pruned image leaves behind) is finally static: clicking it no longer popped the lightbox open with a stale image from an earlier gallery on the page, because the click handler un-hid the overlay before it noticed the chip carries no gallery. The chip is now a plain span (no button semantics, no gallery data) and the lightbox handler bails out for gallery-less chips, while numbered thumbnails still open at the exact clicked index ([commit](https://github.com/pqant/claude-continuity/commit/a1cf55e)).
|
|
30
|
+
- **2026-11-14**: The `image` text chip in the transcript export is no more: every embeddable image renders inline as a small thumbnail with a numbered badge (1, 2, 3, ...), and all thumbnails pulse in sync through a tiny JS timer, so a turn containing screenshots announces itself at a glance. An image that could not be embedded shows a solid dark photo icon instead of the old emoji-plus-word trace, and clicking a thumbnail opens the lightbox at that very image ([commit](https://github.com/pqant/claude-continuity/commit/722749a)).
|
|
29
31
|
- **2026-11-14**: Tab-completion for the whole command tree: `cc-continuity completion zsh|bash` prints a completion script generated from the very argparse tree the CLI builds, so a subcommand added upstream shows up on the next Tab for free. Install it with one eval line in `~/.zshrc`: `eval "$(cc-continuity completion zsh)"`; unsupported shells exit 1 with a clear stderr line instead of a half-script ([commit](https://github.com/pqant/claude-continuity/commit/2d7ddfe)).
|
|
30
32
|
- **2026-11-12**: `cc-continuity configure --show` prints the effective config as the code sees it: one sorted `key value` line per setting, defaults filled in where the file omits them, the installer stamp block left out of the noise, and `--json` for scripts. No config file is no longer a dead end: the defaults-only view prints with a one-line note instead of failing, and the command never writes anything ([commit](https://github.com/pqant/claude-continuity/commit/2ae1243)).
|
|
31
33
|
- **2026-11-12**: A `cc-continuity signal needs-human` fired while the session idles now lights up the animated pane too: in progress mode 1 the animator owns the blink but only consulted the rendered status-line text, the reply flag and the pane capture, never `ledger.blocked_reason`, so the push reached the phone while the tab stayed dark. The animator's ~1 s blink poll now reads the ledger and paints the blocked chip with a reason-carrying gate key, mirroring the reply-flag pattern ([commit](https://github.com/pqant/claude-continuity/commit/055c824)).
|
|
32
|
-
- **2026-11-12**: The tab blink and the Dock bounce no longer die behind a backgrounded iTerm2: iTerm2 answers the frontmost-session query even while backgrounded, so the focus watcher kept believing the user was still on the tab and, worse, a selection prompt (AskUserQuestion) vanished from the pane region whenever the input box held a draft, so the wait never even armed. The frontmost-tty probe now checks which app is actually in the foreground first (any other app means "no reader present"), and a live selection footer anchors its own region regardless of the draft below it, so prompts gate again and the bounce survives until the wait is answered or read ([commit](https://github.com/pqant/claude-continuity/commit/97c5227)).
|
|
33
|
-
- **2026-11-12**: The Dock bounce can no longer be swallowed by macOS: a bounce written while the terminal app is frontmost (the system only bounces backgrounded apps) is re-fired the moment iTerm2 goes to the background: the poller and the animator watch the frontmost app on their ~1 s tick and re-write a still-armed bounce exactly once per foreground-to-background transition, never per tick ([commit](https://github.com/pqant/claude-continuity/commit/fe215b4)).
|
|
34
34
|
|
|
35
35
|
## How it works
|
|
36
36
|
|
|
@@ -53,6 +53,13 @@ _NOISE_PREFIXES = ("<local-command", "Caveat:", "<command-name>",
|
|
|
53
53
|
#: into a single chip so the image trace survives without the bulk.
|
|
54
54
|
_IMAGE_PREFIXES = ("[Image: source:", "[Image: original")
|
|
55
55
|
_IMAGE_CHIP = "\U0001f5bc image"
|
|
56
|
+
#: Dark filled photo glyph for chips whose image could not be embedded
|
|
57
|
+
#: (issue #64): it replaces the old emoji+"image" text trace with a solid
|
|
58
|
+
#: icon that is obvious at a glance. The pulse comes from _CHIP_PULSE_JS.
|
|
59
|
+
_IMG_ICON = ('<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 4h16'
|
|
60
|
+
'a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1'
|
|
61
|
+
'2-2zm0 2v9.6l4.3-4.3 4.2 4.2L16 9l4 4V6H4zm11 2.5A1.5 1.5 0 '
|
|
62
|
+
'1 1 13.5 9 1.5 1.5 0 0 1 15 8.5z" fill="#1b1f24"/></svg>')
|
|
56
63
|
#: Embeddable image bounds (issue #55): whitelisted media types and a
|
|
57
64
|
#: per-image base64 cap. Anything outside keeps a plain (non-clickable)
|
|
58
65
|
#: chip so the single-file export stays sane.
|
|
@@ -331,8 +338,11 @@ ul,ol{margin:.45em 0;padding-left:1.5em}li{margin:.15em 0}
|
|
|
331
338
|
table{border-collapse:collapse;margin:10px 0}th,td{border:1px solid var(--line);padding:5px 10px}th{background:var(--hdr)}
|
|
332
339
|
mark{background:var(--mark);color:inherit;border-radius:2px;padding:0 1px}
|
|
333
340
|
.block.hidden{display:none}
|
|
334
|
-
.chipbtn{cursor:pointer;border:0;background:none;font:inherit;color:inherit;padding:0;
|
|
335
|
-
.chipbtn:
|
|
341
|
+
.chipbtn{cursor:pointer;border:0;background:none;font:inherit;color:inherit;padding:0;margin:2px 8px 2px 2px;position:relative;display:inline-flex;vertical-align:middle}
|
|
342
|
+
.chipbtn img.chipimg{width:76px;height:auto;border-radius:7px;border:1px solid var(--line);display:block}
|
|
343
|
+
.chipbtn.imgicon{width:76px;height:54px;align-items:center;justify-content:center;background:#e6edf3;border:1px solid #b1bac4;border-radius:7px}
|
|
344
|
+
.chipbtn.imgicon svg{width:26px;height:26px;display:block}
|
|
345
|
+
.imgbadge{position:absolute;top:-7px;left:-7px;min-width:18px;height:18px;padding:0 3px;border-radius:9px;background:#1b1f24;color:#fff;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;border:2px solid var(--bg);box-shadow:0 1px 3px rgba(0,0,0,.4)}
|
|
336
346
|
.lb{position:fixed;inset:0;background:rgba(0,0,0,.85);z-index:60;display:flex;align-items:center;justify-content:center}
|
|
337
347
|
.lb[hidden]{display:none}
|
|
338
348
|
.lbb{display:flex;flex-direction:column;align-items:center;gap:10px;max-width:92vw}
|
|
@@ -420,7 +430,9 @@ n=(n+a.length)%a.length;img.src=a[n].getAttribute('src');
|
|
|
420
430
|
ctr.textContent=(n+1)+' / '+a.length;}
|
|
421
431
|
document.addEventListener('click',function(e){var t=e.target;
|
|
422
432
|
var b=t.closest?t.closest('.chipbtn'):null;
|
|
423
|
-
if(b){
|
|
433
|
+
if(b){var gid=b.getAttribute('data-g');if(!gid)return;
|
|
434
|
+
g=document.getElementById(gid);if(!g)return;
|
|
435
|
+
n=parseInt(b.getAttribute('data-i')||'0',10)||0;
|
|
424
436
|
lb.hidden=false;show();return;}
|
|
425
437
|
if(t.id==='lbp'){n--;show();return;}
|
|
426
438
|
if(t.id==='lbn'){n++;show();return;}
|
|
@@ -431,6 +443,19 @@ else if(e.key==='ArrowLeft'){n--;show();}
|
|
|
431
443
|
else if(e.key==='ArrowRight'){n++;show();}});})();
|
|
432
444
|
"""
|
|
433
445
|
|
|
446
|
+
#: Continuous pulse for every image chip (issue #64): a JS timer keeps the
|
|
447
|
+
#: thumbnails blinking even when the OS "reduce motion" setting suppresses
|
|
448
|
+
#: CSS keyframe animations. The phase lives in the closure so all chips
|
|
449
|
+
#: pulse in sync. Injected whenever the export contains at least one chip.
|
|
450
|
+
#: ASCII only.
|
|
451
|
+
_CHIP_PULSE_JS = r"""
|
|
452
|
+
(function(){var els=document.querySelectorAll('.chipbtn');if(!els.length)return;
|
|
453
|
+
var ph=0;setInterval(function(){ph+=0.11;var s=0.5+0.5*Math.sin(ph);
|
|
454
|
+
var o=(0.32+0.68*s).toFixed(3),sc=(0.94+0.06*s).toFixed(3);
|
|
455
|
+
for(var i=0;i<els.length;i++){els[i].style.opacity=o;
|
|
456
|
+
els[i].style.transform='scale('+sc+')';}},45);})();
|
|
457
|
+
"""
|
|
458
|
+
|
|
434
459
|
|
|
435
460
|
def _session_entry(html_path: Path, project_dir: Path) -> dict:
|
|
436
461
|
"""One manifest entry; ``_k`` is the private sort key (datetime)."""
|
|
@@ -657,6 +682,7 @@ def render_html(blocks: list[Block], meta: dict) -> str:
|
|
|
657
682
|
switch_js = _SWITCH_JS
|
|
658
683
|
sections = []
|
|
659
684
|
galleries = []
|
|
685
|
+
has_chips = False
|
|
660
686
|
for role, text, ts, *rest in blocks:
|
|
661
687
|
images = rest[0] if rest else ()
|
|
662
688
|
cls = "user" if role == "user" else "asst"
|
|
@@ -664,15 +690,29 @@ def render_html(blocks: list[Block], meta: dict) -> str:
|
|
|
664
690
|
if images:
|
|
665
691
|
# Issue #55: the chip opens a lightbox of the real pasted
|
|
666
692
|
# images; data URIs keep the export a single HTML file.
|
|
693
|
+
# Issue #64: the gallery shows as one thumbnail per image
|
|
694
|
+
# (numbered to match the lightbox counter), all pulsing via
|
|
695
|
+
# _CHIP_PULSE_JS so they are obvious at a glance.
|
|
667
696
|
gid = f"lb-{len(galleries)}"
|
|
668
697
|
galleries.append(
|
|
669
698
|
f'<div class="lbg" id="{gid}" hidden>'
|
|
670
699
|
+ "".join(f'<img src="{html.escape(u, quote=True)}" alt="">'
|
|
671
700
|
for u in images) + "</div>")
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
701
|
+
thumbs = "".join(
|
|
702
|
+
f'<button class="chipbtn" data-g="{gid}" data-i="{k}"'
|
|
703
|
+
f' aria-label="image {k + 1} of {len(images)}">'
|
|
704
|
+
f'<img class="chipimg" src="{html.escape(u, quote=True)}"'
|
|
705
|
+
f' alt=""><span class="imgbadge">{k + 1}</span></button>'
|
|
706
|
+
for k, u in enumerate(images))
|
|
707
|
+
has_chips = True
|
|
708
|
+
body = thumbs if text == _IMAGE_CHIP else (
|
|
709
|
+
md_to_html(text) + f"<p>{thumbs}</p>")
|
|
710
|
+
elif text == _IMAGE_CHIP:
|
|
711
|
+
# Issue #64: a pruned image's trace is a dark icon chip,
|
|
712
|
+
# never the emoji+"image" wording.
|
|
713
|
+
has_chips = True
|
|
714
|
+
body = (f'<span class="chipbtn imgicon" role="img" aria-label="image">'
|
|
715
|
+
f'{_IMG_ICON}</span>')
|
|
676
716
|
else:
|
|
677
717
|
body = md_to_html(text)
|
|
678
718
|
sections.append(
|
|
@@ -702,7 +742,8 @@ def render_html(blocks: list[Block], meta: dict) -> str:
|
|
|
702
742
|
f'{"".join(galleries)}'
|
|
703
743
|
f'{_LIGHTBOX if galleries else ""}'
|
|
704
744
|
f'{ext}<script>{_JS}{switch_js}'
|
|
705
|
-
f'{_LIGHTBOX_JS if galleries else ""}
|
|
745
|
+
f'{_LIGHTBOX_JS if galleries else ""}'
|
|
746
|
+
f'{_CHIP_PULSE_JS if has_chips else ""}</script></body>')
|
|
706
747
|
|
|
707
748
|
|
|
708
749
|
def resolve_transcript_path(metric: dict | None, root: Path, sid: str | None,
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cc-continuity"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.34"
|
|
8
8
|
description = "Zero-touch session rotation for Claude Code (local large-context model)"
|
|
9
9
|
requires-python = ">=3.11"
|
|
10
10
|
dependencies = [] # stdlib only at runtime (PRD §0.5)
|
|
@@ -138,17 +138,70 @@ def test_render_html_chip_clickable_with_images():
|
|
|
138
138
|
assert d.index("metin") < d.rindex('class="chipbtn"') # mixed chip trails text
|
|
139
139
|
|
|
140
140
|
|
|
141
|
-
def
|
|
141
|
+
def test_render_html_plain_chip_is_dark_icon_without_text():
|
|
142
|
+
# Issue #64: the trace of a pruned image is a dark icon button, never
|
|
143
|
+
# the old "🖼 image" wording; nothing opens so no lightbox is injected.
|
|
142
144
|
d = transcript.render_html([("user", "🖼 image", None)], META)
|
|
143
|
-
assert
|
|
145
|
+
assert "chipbtn" in d
|
|
146
|
+
assert "🖼" not in d and "🖼 image" not in d
|
|
147
|
+
assert "<svg" in d
|
|
148
|
+
assert 'id="lb"' not in d
|
|
144
149
|
|
|
145
150
|
|
|
146
|
-
def
|
|
151
|
+
def test_render_html_folded_run_one_thumbnail_per_image():
|
|
152
|
+
# Issue #64: a merged gallery renders one thumbnail per image, numbered
|
|
153
|
+
# to match the lightbox "i / n" counter (user: "3 image varsa 3 tane").
|
|
147
154
|
b = [("user", "🖼 image", None,
|
|
148
155
|
("data:image/png;base64,QQ==", "data:image/png;base64,Qg=="))]
|
|
149
156
|
d = transcript.render_html(b, META)
|
|
150
|
-
assert d.count('class="chipbtn"') ==
|
|
151
|
-
assert d
|
|
157
|
+
assert d.count('class="chipbtn"') == 2
|
|
158
|
+
assert 'data-i="0"' in d and 'data-i="1"' in d
|
|
159
|
+
assert '<span class="imgbadge">1</span>' in d
|
|
160
|
+
assert '<span class="imgbadge">2</span>' in d
|
|
161
|
+
assert d.count('src="data:image/png;base64') == 4 # thumbs + hidden gallery
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def test_render_html_embed_chip_is_a_thumbnail():
|
|
165
|
+
# Issue #64: the inline element shows the real image (data URI), not text.
|
|
166
|
+
b = [("user", "🖼 image", None, ("data:image/png;base64,QUJD",))]
|
|
167
|
+
d = transcript.render_html(b, META)
|
|
168
|
+
assert '<img class="chipimg" src="data:image/png;base64,QUJD"' in d
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def test_render_html_plain_icon_chip_not_clickable():
|
|
172
|
+
# Issue #65: the dark icon chip is a static trace. On a page that also
|
|
173
|
+
# has an embedded gallery (lightbox injected), it must not be a button
|
|
174
|
+
# and must carry no data-g/data-i that could open the lightbox.
|
|
175
|
+
b = [("user", "🖼 image", None, ("data:image/png;base64,QUJD",)),
|
|
176
|
+
("assistant", "🖼 image", None)]
|
|
177
|
+
d = transcript.render_html(b, META)
|
|
178
|
+
assert 'id="lb"' in d # page has a lightbox (the tempting stale source)
|
|
179
|
+
assert '<span class="chipbtn imgicon" role="img"' in d
|
|
180
|
+
assert '<button class="chipbtn imgicon"' not in d
|
|
181
|
+
frag = d[d.index('<span class="chipbtn imgicon"'):]
|
|
182
|
+
frag = frag[:frag.index(">")]
|
|
183
|
+
assert "data-g" not in frag and "data-i" not in frag
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def test_lightbox_js_guards_icon_chip_clicks():
|
|
187
|
+
# Issue #65: the click handler must bail out before un-hiding the
|
|
188
|
+
# overlay when the chip has no data-g, and when the gallery element
|
|
189
|
+
# cannot be found (otherwise the stale img.src flashes on screen).
|
|
190
|
+
js = transcript._LIGHTBOX_JS
|
|
191
|
+
assert "if(!gid)return" in js
|
|
192
|
+
assert "getElementById(gid);if(!g)return" in js
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def test_render_html_pulse_timer_tracks_chips():
|
|
196
|
+
# Issue #64: the pulse runs from a JS setInterval (OS "reduce motion"
|
|
197
|
+
# kills CSS keyframes but not a timer); no chips -> no timer code.
|
|
198
|
+
b = [("user", "🖼 image", None, ("data:image/png;base64,QUJD",))]
|
|
199
|
+
d = transcript.render_html(b, META)
|
|
200
|
+
assert "setInterval" in d
|
|
201
|
+
d_plain = transcript.render_html([("user", "selam", None)], META)
|
|
202
|
+
assert "setInterval" not in d_plain
|
|
203
|
+
d_icon = transcript.render_html([("user", "🖼 image", None)], META)
|
|
204
|
+
assert "setInterval" in d_icon
|
|
152
205
|
|
|
153
206
|
|
|
154
207
|
def test_render_markdown_ignores_images():
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|