cc-continuity 0.3.73__tar.gz → 0.3.74__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.73 → cc_continuity-0.3.74}/PKG-INFO +1 -1
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/README.md +5 -5
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/__init__.py +1 -1
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/transcript.py +48 -5
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity.egg-info/PKG-INFO +1 -1
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/pyproject.toml +1 -1
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_transcript.py +81 -2
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/LICENSE +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/__main__.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/atomic.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/blink.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/blink_watch.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/bootstrap.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/checkpoint.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/cli.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/config.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/daemon_supervisor.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/doctor.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/gitsnap.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/hooks/__init__.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/hooks/common.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/hooks/pre_compact.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/hooks/pre_tool_use.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/hooks/session_end.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/hooks/session_start.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/hooks/stop.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/hooks/task.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/hooks/tool_use.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/hooks/user_prompt.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/hosting.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/install.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/launch.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/ledger.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/lock.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/managed.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/naming.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/notify.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/overflow.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/paths.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/power_plug.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/progress_pane.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/project.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/redact.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/rotator.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/settings_merge.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/skills.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/state.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/statusline.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/thresholds.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/validate.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/watchdog.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/watchdog_digest.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity/watchdogd.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity.egg-info/SOURCES.txt +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity.egg-info/dependency_links.txt +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity.egg-info/entry_points.txt +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/cc_continuity.egg-info/top_level.txt +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/setup.cfg +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_atomic.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_blink.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_blink_watch.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_bootstrap.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_changelog_notes.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_checkpoint.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_cli.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_cli_ledger.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_cli_log.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_config.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_daemon_supervisor.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_doctor.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_gitsnap.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_hooks_common.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_hooks_pre_compact.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_hooks_pre_tool_use.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_hooks_session_end.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_hooks_session_start.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_hooks_stop.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_hooks_task.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_hooks_tool_use.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_hooks_user_prompt.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_hosting.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_hygiene.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_install.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_integration_phase5.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_integration_phase6.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_integration_phase7.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_launch.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_ledger.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_lock.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_managed.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_naming.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_notify.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_notify_integration.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_overflow.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_paths.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_power_plug.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_progress_pane.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_project.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_readme_badges.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_readme_gif.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_redact.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_rotator.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_settings_merge.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_skills.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_state.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_status.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_statusline.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_statusline_cache.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_thresholds.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_tmux_host.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_transcript_finalize.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_uninstall.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_validate.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_watchdog.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_watchdog_digest.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_watchdog_integration.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_watchdogd.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_wsl_doctor.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.74}/tests/test_wsl_install.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cc-continuity
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.74
|
|
4
4
|
Summary: Zero-touch session rotation for Claude Code (local large-context model)
|
|
5
5
|
Classifier: Development Status :: 5 - Production/Stable
|
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -41,12 +41,12 @@ The five most recent updates, newest first. Each line links to its
|
|
|
41
41
|
commit, so you can see what changed lately without digging through the
|
|
42
42
|
log:
|
|
43
43
|
|
|
44
|
-
- **2026-11-
|
|
45
|
-
- **2026-11-26**:
|
|
46
|
-
- **2026-11-26**:
|
|
47
|
-
- **2026-11-26**:
|
|
44
|
+
- **2026-11-27**: The transcript split view scrolls left and right independently and shows an ephemeral page badge. The 2-column view was one CSS multi-column flow where the whole document scrolled as a unit; it is now two flex panes with their own scroll positions, reading order preserved by a text-length weighted split (image data URIs excluded from the weight), and scrolling a pane flashes a bold page counter (screenful pages: floor(scrollTop/clientHeight)+1 over ceil(scrollHeight/clientHeight)) in that pane's top-right corner which fades out about a second after scrolling stops, an absolute overlay with no layout cost; pane height tracks the viewport minus header and padding across toggles, header collapse and resize, existing viewer controls are untouched, with eight tests written first ([commit](https://github.com/pqant/claude-continuity/commit/073b810)).
|
|
45
|
+
- **2026-11-26**: A hyphenated template heading no longer degrades a handoff draft. The template's seventh heading contains an em dash (U+2014) in its middle; a model obeying a no-em-dash writing rule retypes it with a plain hyphen, and strict matching called the section both missing and unexpected, throwing away a complete nine-section draft and finalizing a deterministic-only (degraded) checkpoint; template matching now folds em and en dashes to the hyphen at every comparison site, the draft text and the printed template stay verbatim, and four tests were written first ([commit](https://github.com/pqant/claude-continuity/commit/4b10570)).
|
|
46
|
+
- **2026-11-26**: The hard-limit brick self-heal now fires in production. v0.3.71 admitted HANDOFF_REQUESTED to the context-400 recovery gates, but the watchdog tick loop only dispatched the scan for sessions its classifier judged ALIVE, TURN_DEAD, STALLED or FROZEN, and the classifier SKIPs everything outside ACTIVE/WARNED, so the hard-limit brick never reached the gate and the fix stayed unreachable code; the SKIP branch now carries HANDOFF_REQUESTED into recovery next to CHECKPOINT_VERIFIED, with one test written first ([commit](https://github.com/pqant/claude-continuity/commit/9e550f1)).
|
|
47
|
+
- **2026-11-26**: A hard-limit context-400 brick now self-heals. The hard-limit gate parks the session in HANDOFF_REQUESTED and the model writes the handoff draft, but when the next API call 400s (input plus requested output over the window) the turn dies without a Stop hook and nothing finalized the draft: the deterministic context-400 recovery refused to run for exactly this state although its own route starts from it; both state gates now include HANDOFF_REQUESTED so the watchdog verifies the draft and restarts the pane on its own, two tests written first ([commit](https://github.com/pqant/claude-continuity/commit/2091404)).
|
|
48
|
+
- **2026-11-26**: An adopted successor no longer keeps the off marking of its abandoned startup. When Claude Code native auto-resume abandons a fresh startup the SessionEnd hook marks that record off (by design, so dead startups stop posing as live); the same record can later be revived as the live session by successor adoption, which refreshed the session id and state but not the off flag, so hooks, the rotator and the watchdog all ignored a real attached pane and the status line showed off instead of the usage segment; both adoption branches now clear off in the same write, abandoned startups stay off exactly as before, and two tests were written first ([commit](https://github.com/pqant/claude-continuity/commit/d61820a)).
|
|
48
49
|
- **2026-11-24**: A claim no longer skips a successor that died after attaching. The dead ACTIVE record used to force a fresh `max(counter)+1` name while the corpse kept looking live in the session list; the claim now probes the candidate's recorded pane (`tmux_session` against `tmux list-sessions`) and, only when that pane is gone, adopts the record at its same index and resets it to BOOTSTRAPPING so the SessionStart hook drives it like a fresh claim; the probe is conservative by construction (no recorded pane, tmux missing or any error means the candidate is treated as live), so a live pane is never hijacked, with eight tests written first ([commit](https://github.com/pqant/claude-continuity/commit/fa9b972)).
|
|
49
|
-
- **2026-11-24**: Resuming now opens with a one-line at-a-glance preview. The SessionStart bootstrap block starts with the checkpoint number, the predecessor session, the VALIDATION result and the first Next Atomic Action item, so you can see what is being resumed without waiting for the first reply; the line is parsed display-only from the handoff text, silently omitted when nothing parses, and the block otherwise stays exactly the old format, with six tests written first ([commit](https://github.com/pqant/claude-continuity/commit/96341cb)).
|
|
50
50
|
## How it works
|
|
51
51
|
|
|
52
52
|
The whole flow in one picture: the automatic session loop, the optional
|
|
@@ -338,8 +338,10 @@ body.split header.mini .hdmini{width:calc(50% - 36px)}
|
|
|
338
338
|
#panelsbtn,#panelbtn{position:absolute;left:50%;transform:translateX(-50%)}
|
|
339
339
|
#panelsbtn,#panelbtn{color:#d1242f}
|
|
340
340
|
[data-theme=dark] #panelsbtn,[data-theme=dark] #panelbtn{color:#ff7b72}
|
|
341
|
-
main.split{max-width:none;
|
|
342
|
-
main.split .
|
|
341
|
+
main.split{max-width:none;display:flex;gap:28px;zoom:.75}
|
|
342
|
+
main.split .pane{flex:1 1 50%;min-width:0;overflow-y:auto;position:relative}
|
|
343
|
+
.pagebadge{position:absolute;top:8px;right:12px;pointer-events:none;opacity:0;transition:opacity .4s ease;background:var(--hdr);color:var(--fg);border:1px solid var(--line);border-radius:8px;padding:3px 12px;font-size:20px;font-weight:700;box-shadow:0 1px 4px rgba(0,0,0,.18)}
|
|
344
|
+
main:not(.split) .pagebadge{display:none}
|
|
343
345
|
main{max-width:1160px;margin:0 auto;padding:10px 28px 80px}
|
|
344
346
|
section.block{padding:6px 14px 12px;margin:10px 0;border-radius:10px}
|
|
345
347
|
section.block.user{background:var(--userbg)}
|
|
@@ -403,14 +405,27 @@ root.dataset.theme=modes[i];bt.textContent='theme: '+modes[i];
|
|
|
403
405
|
bt.onclick=()=>{i=(i+1)%3;root.dataset.theme=modes[i];localStorage.setItem('th',i);bt.textContent='theme: '+modes[i];};
|
|
404
406
|
var hdEl=document.querySelector('header'),pb=document.getElementById('panelbtn'),ps=document.getElementById('panelsbtn');
|
|
405
407
|
function hcGet(){try{return localStorage.getItem('hc')==='1'}catch(e){return false}}
|
|
406
|
-
function hcSet(v){hdEl.classList.toggle('mini',v);try{localStorage.setItem('hc',v?'1':'0')}catch(e){}}
|
|
408
|
+
function hcSet(v){hdEl.classList.toggle('mini',v);try{localStorage.setItem('hc',v?'1':'0')}catch(e){}fitPanes();}
|
|
407
409
|
if(hcGet())hdEl.classList.add('mini');
|
|
408
410
|
ps.onclick=function(){hcSet(!hdEl.classList.contains('mini'))};
|
|
409
411
|
pb.onclick=function(){hcSet(false)};
|
|
410
412
|
var mn=document.querySelector('main'),sp=document.getElementById('sp');
|
|
411
413
|
function spGet(){try{return localStorage.getItem('sp')!=='0'}catch(e){return true}}
|
|
412
414
|
var spOn=spGet();sp.checked=spOn;mn.classList.toggle('split',spOn);document.body.classList.toggle('split',spOn);
|
|
413
|
-
sp.onchange=function(){mn.classList.toggle('split',sp.checked);document.body.classList.toggle('split',sp.checked);try{localStorage.setItem('sp',sp.checked?'1':'0')}catch(e){}};
|
|
415
|
+
sp.onchange=function(){spOn=sp.checked;mn.classList.toggle('split',sp.checked);document.body.classList.toggle('split',sp.checked);try{localStorage.setItem('sp',sp.checked?'1':'0')}catch(e){}fitPanes();};
|
|
416
|
+
var panes=[].slice.call(mn.querySelectorAll('.pane'));
|
|
417
|
+
function fitPanes(){if(!spOn){for(var k=0;k<panes.length;k++)panes[k].style.height='';return;}
|
|
418
|
+
var cs=getComputedStyle(mn),pt=parseFloat(cs.paddingTop)||0,pb=parseFloat(cs.paddingBottom)||0;
|
|
419
|
+
var hh=hdEl.offsetHeight||0,h=Math.max(200,(window.innerHeight-hh-pt-pb)/0.75);
|
|
420
|
+
for(var k=0;k<panes.length;k++)panes[k].style.height=h+'px';}
|
|
421
|
+
function wireBadge(pn){var t;pn.addEventListener('scroll',function(){var ch=pn.clientHeight||1;
|
|
422
|
+
var tot=Math.max(1,Math.ceil(pn.scrollHeight/ch));var cur=Math.min(tot,Math.floor(pn.scrollTop/ch)+1);
|
|
423
|
+
if(!pn._pb){pn._pb=document.createElement('div');pn._pb.className='pagebadge';pn.appendChild(pn._pb);}
|
|
424
|
+
var b=pn._pb;b.textContent=cur+'/'+tot;b.style.opacity='1';clearTimeout(t);
|
|
425
|
+
t=setTimeout(function(){b.style.opacity='0'},1000);},{passive:true});}
|
|
426
|
+
for(var k=0;k<panes.length;k++)wireBadge(panes[k]);
|
|
427
|
+
window.addEventListener('resize',fitPanes);
|
|
428
|
+
fitPanes();
|
|
414
429
|
"""
|
|
415
430
|
|
|
416
431
|
|
|
@@ -704,6 +719,30 @@ def _meta_val(meta: dict, key: str) -> str:
|
|
|
704
719
|
return html.escape(str(val))
|
|
705
720
|
|
|
706
721
|
|
|
722
|
+
def _split_panes(sections: list[str], weights: list[int]) -> tuple[str, str]:
|
|
723
|
+
"""Split block sections into the two split-view panes (issue #102).
|
|
724
|
+
|
|
725
|
+
Reading order is kept: the left pane takes blocks until it holds at
|
|
726
|
+
least half the total weight, the right pane gets the rest. Weight is
|
|
727
|
+
the block's text length (callers must NOT pass rendered section
|
|
728
|
+
length: image data URIs would swallow the whole scale). The CSS
|
|
729
|
+
multi-column flow balanced heights at paint time; this proxy keeps the
|
|
730
|
+
two columns visually even in plain Python. Both panes are always
|
|
731
|
+
emitted (empty strings included) so the split toggle keeps working on
|
|
732
|
+
short transcripts.
|
|
733
|
+
"""
|
|
734
|
+
total = sum(weights)
|
|
735
|
+
left: list[str] = []
|
|
736
|
+
taken = 0
|
|
737
|
+
for section, w in zip(sections, weights):
|
|
738
|
+
left.append(section)
|
|
739
|
+
taken += w
|
|
740
|
+
if taken * 2 >= total:
|
|
741
|
+
break
|
|
742
|
+
cut = len(left)
|
|
743
|
+
return "".join(left), "".join(sections[cut:])
|
|
744
|
+
|
|
745
|
+
|
|
707
746
|
def render_html(blocks: list[Block], meta: dict) -> str:
|
|
708
747
|
"""One complete readable HTML page for the conversation (v5 design).
|
|
709
748
|
|
|
@@ -726,6 +765,7 @@ def render_html(blocks: list[Block], meta: dict) -> str:
|
|
|
726
765
|
f'<select id="s" data-cur="{cur}" data-up="{up}"></select>')
|
|
727
766
|
switch_js = _SWITCH_JS
|
|
728
767
|
sections = []
|
|
768
|
+
weights = []
|
|
729
769
|
galleries = []
|
|
730
770
|
has_chips = False
|
|
731
771
|
for role, text, ts, *rest in blocks:
|
|
@@ -765,6 +805,8 @@ def render_html(blocks: list[Block], meta: dict) -> str:
|
|
|
765
805
|
f'<section class="block {cls}"><h2 class="{cls}">{label} '
|
|
766
806
|
f'<span class="ts">{_ts_hms(ts)}</span></h2>'
|
|
767
807
|
f'<div class="body">{body}</div></section>')
|
|
808
|
+
weights.append(len(text))
|
|
809
|
+
pl, pr = _split_panes(sections, weights)
|
|
768
810
|
return (
|
|
769
811
|
'<!doctype html><html data-theme="auto"><head><meta charset="utf-8">\n'
|
|
770
812
|
'<meta name="viewport" content="width=device-width,initial-scale=1">\n'
|
|
@@ -787,7 +829,8 @@ def render_html(blocks: list[Block], meta: dict) -> str:
|
|
|
787
829
|
f'<button id="t">theme</button><span id="stats"></span><button id="panelsbtn" title="panel up">▲</button></div></div>\n'
|
|
788
830
|
f'<div class="hdmini" hidden><span class="v">› {_meta_val(meta, "name")} (cp-{_meta_val(meta, "nnn")})</span>'
|
|
789
831
|
f'<button id="panelbtn" title="panel down">▼</button></div></header>\n'
|
|
790
|
-
f'<main class="split">{
|
|
832
|
+
f'<main class="split"><div class="pane" id="pl">{pl}</div>'
|
|
833
|
+
f'<div class="pane" id="pr">{pr}</div></main>\n'
|
|
791
834
|
f'{"".join(galleries)}'
|
|
792
835
|
f'{_LIGHTBOX if galleries or has_chips else ""}'
|
|
793
836
|
f'{ext}<script>{_JS}{switch_js}'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cc-continuity
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.74
|
|
4
4
|
Summary: Zero-touch session rotation for Claude Code (local large-context model)
|
|
5
5
|
Classifier: Development Status :: 5 - Production/Stable
|
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import base64
|
|
4
4
|
import json
|
|
5
|
+
import re
|
|
5
6
|
from datetime import datetime
|
|
6
7
|
from pathlib import Path
|
|
7
8
|
|
|
@@ -819,8 +820,8 @@ def test_density_split_checkbox_and_css():
|
|
|
819
820
|
d = transcript.render_html(b, META)
|
|
820
821
|
assert 'id="sp"' in d
|
|
821
822
|
assert "2-column" in d
|
|
822
|
-
assert "main.split{max-width:none;
|
|
823
|
-
assert "main.split .
|
|
823
|
+
assert "main.split{max-width:none;display:flex" in d
|
|
824
|
+
assert "main.split .pane{" in d
|
|
824
825
|
assert "zoom:.75" in d
|
|
825
826
|
assert '<main class="split">' in d
|
|
826
827
|
assert "return localStorage.getItem('sp')!=='0'" in d
|
|
@@ -835,3 +836,81 @@ def test_density_js_persistence_guards():
|
|
|
835
836
|
"localStorage.setItem('hc'", "localStorage.setItem('sp'"):
|
|
836
837
|
assert needle in d
|
|
837
838
|
assert d.count("try{") >= 2
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
# --- issue #102: split view panes scroll independently, ephemeral page badge ----
|
|
842
|
+
|
|
843
|
+
def _panes(d):
|
|
844
|
+
m = re.search(r'<div class="pane" id="pl">(.*?)</div>'
|
|
845
|
+
r'<div class="pane" id="pr">(.*?)</main>', d, re.S)
|
|
846
|
+
assert m, "split view must render two pane divs (issue #102)"
|
|
847
|
+
return m.group(1), m.group(2)
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
def _words(pane):
|
|
851
|
+
return re.findall(r"<p>([^<]*)</p>", pane)
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
def test_split_view_two_panes_keep_reading_order():
|
|
855
|
+
# Equal-length words keep the length-weighted split at exactly 2/2.
|
|
856
|
+
b = [("user", t, None) for t in ("alpha", "bravo", "delta", "oscar")]
|
|
857
|
+
d = transcript.render_html(b, META)
|
|
858
|
+
left, right = _panes(d)
|
|
859
|
+
assert _words(left) == ["alpha", "bravo"]
|
|
860
|
+
assert _words(right) == ["delta", "oscar"]
|
|
861
|
+
assert d.count('<div class="pane"') == 2
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
def test_split_view_odd_block_count_fills_left_first():
|
|
865
|
+
b = [("user", t, None) for t in ("a1", "b2", "c3", "d4", "e5")]
|
|
866
|
+
d = transcript.render_html(b, META)
|
|
867
|
+
left, right = _panes(d)
|
|
868
|
+
assert _words(left) + _words(right) == ["a1", "b2", "c3", "d4", "e5"]
|
|
869
|
+
assert len(_words(left)) == 3 and len(_words(right)) == 2
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
def test_split_view_empty_conversation_keeps_both_panes():
|
|
873
|
+
d = transcript.render_html([], META)
|
|
874
|
+
assert d.count('<div class="pane"') == 2
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
def test_split_panes_own_their_scrollbar():
|
|
878
|
+
d = transcript.render_html([("user", "x", None)], META)
|
|
879
|
+
rule = re.search(r"main\.split \.pane\{([^}]*)\}", d)
|
|
880
|
+
assert rule, "pane rule required (issue #102)"
|
|
881
|
+
body = rule.group(1)
|
|
882
|
+
assert "overflow-y:auto" in body
|
|
883
|
+
assert "position:relative" in body
|
|
884
|
+
assert "flex:1 1 50%" in body
|
|
885
|
+
assert re.search(r"main\.split\{[^}]*display:flex", d), "split mode is flex, not columns"
|
|
886
|
+
assert "columns:2" not in d
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
def test_page_badge_is_an_ephemeral_overlay():
|
|
890
|
+
d = transcript.render_html([("user", "x", None)], META)
|
|
891
|
+
rule = re.search(r"\.pagebadge\{([^}]*)\}", d)
|
|
892
|
+
assert rule, ".pagebadge CSS rule required (issue #102)"
|
|
893
|
+
body = rule.group(1)
|
|
894
|
+
assert "position:absolute" in body
|
|
895
|
+
assert "pointer-events:none" in body
|
|
896
|
+
assert "opacity:0" in body and "transition:opacity" in body
|
|
897
|
+
assert "main:not(.split) .pagebadge{display:none}" in d
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
def test_page_badge_js_computes_pages_and_fades():
|
|
901
|
+
d = transcript.render_html([("user", "x", None)], META)
|
|
902
|
+
js = d[d.index("<script>"):]
|
|
903
|
+
assert "pagebadge" in js
|
|
904
|
+
assert "Math.floor(" in js and "Math.ceil(" in js
|
|
905
|
+
assert "scrollTop" in js and "clientHeight" in js and "scrollHeight" in js
|
|
906
|
+
assert "cur+'/'+tot" in js
|
|
907
|
+
assert "1000" in js # fade about 1s after the last scroll
|
|
908
|
+
assert "passive:true" in js
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
def test_pane_sizing_wired_to_split_toggle():
|
|
912
|
+
d = transcript.render_html([("user", "x", None)], META)
|
|
913
|
+
js = d[d.index("<script>"):]
|
|
914
|
+
assert "fitPanes" in js
|
|
915
|
+
assert js.count("fitPanes") >= 4 # definition + start + toggle + resize
|
|
916
|
+
assert "addEventListener('resize'" in js
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|