cc-continuity 0.3.73__tar.gz → 0.3.75__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.75}/PKG-INFO +1 -1
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/README.md +5 -6
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/__init__.py +1 -1
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/transcript.py +52 -5
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity.egg-info/PKG-INFO +1 -1
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/pyproject.toml +1 -1
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_transcript.py +92 -2
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/LICENSE +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/__main__.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/atomic.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/blink.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/blink_watch.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/bootstrap.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/checkpoint.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/cli.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/config.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/daemon_supervisor.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/doctor.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/gitsnap.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/hooks/__init__.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/hooks/common.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/hooks/pre_compact.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/hooks/pre_tool_use.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/hooks/session_end.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/hooks/session_start.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/hooks/stop.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/hooks/task.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/hooks/tool_use.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/hooks/user_prompt.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/hosting.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/install.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/launch.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/ledger.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/lock.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/managed.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/naming.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/notify.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/overflow.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/paths.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/power_plug.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/progress_pane.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/project.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/redact.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/rotator.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/settings_merge.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/skills.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/state.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/statusline.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/thresholds.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/validate.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/watchdog.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/watchdog_digest.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity/watchdogd.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity.egg-info/SOURCES.txt +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity.egg-info/dependency_links.txt +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity.egg-info/entry_points.txt +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/cc_continuity.egg-info/top_level.txt +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/setup.cfg +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_atomic.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_blink.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_blink_watch.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_bootstrap.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_changelog_notes.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_checkpoint.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_cli.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_cli_ledger.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_cli_log.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_config.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_daemon_supervisor.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_doctor.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_gitsnap.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_hooks_common.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_hooks_pre_compact.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_hooks_pre_tool_use.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_hooks_session_end.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_hooks_session_start.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_hooks_stop.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_hooks_task.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_hooks_tool_use.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_hooks_user_prompt.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_hosting.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_hygiene.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_install.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_integration_phase5.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_integration_phase6.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_integration_phase7.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_launch.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_ledger.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_lock.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_managed.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_naming.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_notify.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_notify_integration.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_overflow.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_paths.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_power_plug.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_progress_pane.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_project.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_readme_badges.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_readme_gif.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_redact.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_rotator.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_settings_merge.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_skills.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_state.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_status.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_statusline.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_statusline_cache.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_thresholds.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_tmux_host.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_transcript_finalize.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_uninstall.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_validate.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_watchdog.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_watchdog_digest.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_watchdog_integration.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_watchdogd.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/tests/test_wsl_doctor.py +0 -0
- {cc_continuity-0.3.73 → cc_continuity-0.3.75}/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.75
|
|
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,11 @@ 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-
|
|
46
|
-
- **2026-11-26**: A
|
|
47
|
-
- **2026-11-26**:
|
|
48
|
-
- **2026-11-
|
|
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)).
|
|
44
|
+
- **2026-11-27**: The split-view page badge numbers one global sequence and always reaches the last page. v0.3.74 numbered each pane's own pages so the right half restarted at 1 while visually continuing the left, and when a pane's content height was not an exact multiple of its client height the floor(scrollTop/clientHeight)+1 formula never produced the final page, leaving the counter frozen near the bottom of short panes; the badge now adds each pane's page-count offset over one shared total (left reads 1/N..k/N, right continues k+1/N..N/N) and treats reaching the bottom (scrollTop+clientHeight >= scrollHeight-2) as the pane's last page so the right pane at bottom always reads N/N, independent scrolling, the one-second fade and every viewer control untouched, with two tests written first ([commit](https://github.com/pqant/claude-continuity/commit/744bea7)).
|
|
45
|
+
- **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)).
|
|
46
|
+
- **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)).
|
|
47
|
+
- **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)).
|
|
48
|
+
- **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)).
|
|
50
49
|
## How it works
|
|
51
50
|
|
|
52
51
|
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,31 @@ 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 panePages(pn){var ch=pn.clientHeight||1;return Math.max(1,Math.ceil(pn.scrollHeight/ch));}
|
|
422
|
+
function wireBadge(pn,k){var t;pn.addEventListener('scroll',function(){var ch=pn.clientHeight||1,all=0,off=0,mine=1;
|
|
423
|
+
for(var j=0;j<panes.length;j++){var v=panePages(panes[j]);all+=v;if(j<k){off+=v;}else if(j===k)mine=v;}
|
|
424
|
+
var cur=Math.min(mine,Math.floor(pn.scrollTop/ch)+1);
|
|
425
|
+
if(pn.scrollTop+ch>=pn.scrollHeight-2)cur=mine;
|
|
426
|
+
var g=Math.min(all,Math.max(1,cur+off));
|
|
427
|
+
if(!pn._pb){pn._pb=document.createElement('div');pn._pb.className='pagebadge';pn.appendChild(pn._pb);}
|
|
428
|
+
var b=pn._pb;b.textContent=g+'/'+all;b.style.opacity='1';clearTimeout(t);
|
|
429
|
+
t=setTimeout(function(){b.style.opacity='0'},1000);},{passive:true});}
|
|
430
|
+
for(var k=0;k<panes.length;k++)wireBadge(panes[k],k);
|
|
431
|
+
window.addEventListener('resize',fitPanes);
|
|
432
|
+
fitPanes();
|
|
414
433
|
"""
|
|
415
434
|
|
|
416
435
|
|
|
@@ -704,6 +723,30 @@ def _meta_val(meta: dict, key: str) -> str:
|
|
|
704
723
|
return html.escape(str(val))
|
|
705
724
|
|
|
706
725
|
|
|
726
|
+
def _split_panes(sections: list[str], weights: list[int]) -> tuple[str, str]:
|
|
727
|
+
"""Split block sections into the two split-view panes (issue #102).
|
|
728
|
+
|
|
729
|
+
Reading order is kept: the left pane takes blocks until it holds at
|
|
730
|
+
least half the total weight, the right pane gets the rest. Weight is
|
|
731
|
+
the block's text length (callers must NOT pass rendered section
|
|
732
|
+
length: image data URIs would swallow the whole scale). The CSS
|
|
733
|
+
multi-column flow balanced heights at paint time; this proxy keeps the
|
|
734
|
+
two columns visually even in plain Python. Both panes are always
|
|
735
|
+
emitted (empty strings included) so the split toggle keeps working on
|
|
736
|
+
short transcripts.
|
|
737
|
+
"""
|
|
738
|
+
total = sum(weights)
|
|
739
|
+
left: list[str] = []
|
|
740
|
+
taken = 0
|
|
741
|
+
for section, w in zip(sections, weights):
|
|
742
|
+
left.append(section)
|
|
743
|
+
taken += w
|
|
744
|
+
if taken * 2 >= total:
|
|
745
|
+
break
|
|
746
|
+
cut = len(left)
|
|
747
|
+
return "".join(left), "".join(sections[cut:])
|
|
748
|
+
|
|
749
|
+
|
|
707
750
|
def render_html(blocks: list[Block], meta: dict) -> str:
|
|
708
751
|
"""One complete readable HTML page for the conversation (v5 design).
|
|
709
752
|
|
|
@@ -726,6 +769,7 @@ def render_html(blocks: list[Block], meta: dict) -> str:
|
|
|
726
769
|
f'<select id="s" data-cur="{cur}" data-up="{up}"></select>')
|
|
727
770
|
switch_js = _SWITCH_JS
|
|
728
771
|
sections = []
|
|
772
|
+
weights = []
|
|
729
773
|
galleries = []
|
|
730
774
|
has_chips = False
|
|
731
775
|
for role, text, ts, *rest in blocks:
|
|
@@ -765,6 +809,8 @@ def render_html(blocks: list[Block], meta: dict) -> str:
|
|
|
765
809
|
f'<section class="block {cls}"><h2 class="{cls}">{label} '
|
|
766
810
|
f'<span class="ts">{_ts_hms(ts)}</span></h2>'
|
|
767
811
|
f'<div class="body">{body}</div></section>')
|
|
812
|
+
weights.append(len(text))
|
|
813
|
+
pl, pr = _split_panes(sections, weights)
|
|
768
814
|
return (
|
|
769
815
|
'<!doctype html><html data-theme="auto"><head><meta charset="utf-8">\n'
|
|
770
816
|
'<meta name="viewport" content="width=device-width,initial-scale=1">\n'
|
|
@@ -787,7 +833,8 @@ def render_html(blocks: list[Block], meta: dict) -> str:
|
|
|
787
833
|
f'<button id="t">theme</button><span id="stats"></span><button id="panelsbtn" title="panel up">▲</button></div></div>\n'
|
|
788
834
|
f'<div class="hdmini" hidden><span class="v">› {_meta_val(meta, "name")} (cp-{_meta_val(meta, "nnn")})</span>'
|
|
789
835
|
f'<button id="panelbtn" title="panel down">▼</button></div></header>\n'
|
|
790
|
-
f'<main class="split">{
|
|
836
|
+
f'<main class="split"><div class="pane" id="pl">{pl}</div>'
|
|
837
|
+
f'<div class="pane" id="pr">{pr}</div></main>\n'
|
|
791
838
|
f'{"".join(galleries)}'
|
|
792
839
|
f'{_LIGHTBOX if galleries or has_chips else ""}'
|
|
793
840
|
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.75
|
|
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,92 @@ 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 "g+'/'+all" 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_page_badge_js_numbers_one_global_sequence():
|
|
912
|
+
# issue #103: both panes share a single page sequence, so the right pane
|
|
913
|
+
# continues the left instead of restarting at 1.
|
|
914
|
+
d = transcript.render_html([("user", "x", None)], META)
|
|
915
|
+
js = d[d.index("<script>"):]
|
|
916
|
+
assert "panePages" in js # per-pane page counts feed one shared total
|
|
917
|
+
assert "off+=" in js # a pane offsets by the page counts before it
|
|
918
|
+
assert "scrollHeight-2" in js # bottom clamp makes the last page reachable
|
|
919
|
+
assert "g+'/'+all" in js # badge text is the global page over the total
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
def test_pane_sizing_wired_to_split_toggle():
|
|
923
|
+
d = transcript.render_html([("user", "x", None)], META)
|
|
924
|
+
js = d[d.index("<script>"):]
|
|
925
|
+
assert "fitPanes" in js
|
|
926
|
+
assert js.count("fitPanes") >= 4 # definition + start + toggle + resize
|
|
927
|
+
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
|