Skip to content

Commit e7b6d43

Browse files
authored
Feat/1.4.1 (#7)
* fix(ui): polish CLI summary colors, HTML tab-bar, transitions
1 parent b697804 commit e7b6d43

File tree

11 files changed

+389
-243
lines changed

11 files changed

+389
-243
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## [1.4.1] - 2026-02-15
4+
5+
### CLI
6+
7+
- Semantic summary colors: clone counts → `bold yellow`, file metrics → neutral `bold`
8+
- Phase separator, bold report paths, "Done in X.Xs" timing line
9+
10+
### HTML Report
11+
12+
- HiDPI chart canvas, hit-line markers with Pygments, cross-browser `<select>`
13+
- Platform-aware shortcut labels (`` / `Ctrl+`), color-coded section borders
14+
- Compact code lines, proper tab-bar for novelty filter, polished transitions
15+
- Rounded-rect badges (`6px`), tighter card radii (`10px`), cleaner empty states
16+
17+
---
18+
319
## [1.4.0] - 2026-02-12
420

521
### Overview

codeclone/_cli_summary.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414

1515
from . import ui_messages as ui
1616

17+
_CLONE_LABELS = frozenset(
18+
{
19+
ui.SUMMARY_LABEL_FUNCTION,
20+
ui.SUMMARY_LABEL_BLOCK,
21+
ui.SUMMARY_LABEL_SEGMENT,
22+
}
23+
)
24+
1725

1826
def _summary_value_style(*, label: str, value: int) -> str:
1927
if value == 0:
@@ -22,7 +30,9 @@ def _summary_value_style(*, label: str, value: int) -> str:
2230
return "bold red"
2331
if label == ui.SUMMARY_LABEL_SUPPRESSED:
2432
return "yellow"
25-
return "bold green"
33+
if label in _CLONE_LABELS:
34+
return "bold yellow"
35+
return "bold"
2636

2737

2838
def _build_summary_rows(

codeclone/_html_snippets.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,16 @@ def _render_code_block(
196196
rendered.append(
197197
f'<div class="{cls}">{html.escape(text, quote=False)}</div>'
198198
)
199-
body = "\n".join(rendered)
199+
body = "".join(rendered)
200200
else:
201-
body = highlighted
201+
hit_flags = [hit for hit, _ in numbered]
202+
pyg_lines = highlighted.split("\n")
203+
rendered_pyg: list[str] = []
204+
for i, pyg_line in enumerate(pyg_lines):
205+
hit = hit_flags[i] if i < len(hit_flags) else False
206+
cls = "hitline" if hit else "line"
207+
rendered_pyg.append(f'<div class="{cls}">{pyg_line}</div>')
208+
body = "".join(rendered_pyg)
202209

203210
return _Snippet(
204211
filepath=filepath,

codeclone/cli.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import os
44
import sys
5+
import time
56
from collections.abc import Mapping, Sequence
67
from concurrent.futures import Future, ProcessPoolExecutor, as_completed
78
from dataclasses import asdict, dataclass
@@ -71,7 +72,6 @@
7172
}
7273
)
7374

74-
7575
LEGACY_CACHE_PATH = Path("~/.cache/codeclone/cache.json").expanduser()
7676

7777

@@ -238,6 +238,8 @@ def _main_impl() -> None:
238238
)
239239
sys.exit(ExitCode.CONTRACT_ERROR)
240240

241+
t0 = time.monotonic()
242+
241243
if not args.quiet:
242244
print_banner()
243245

@@ -900,6 +902,10 @@ def _write_report_output(*, out: Path, content: str, label: str) -> None:
900902
if not args.update_baseline and not args.fail_on_new and new_clones_count > 0:
901903
console.print(ui.WARN_NEW_CLONES_WITHOUT_FAIL)
902904

905+
if not args.quiet:
906+
elapsed = time.monotonic() - t0
907+
console.print(f"\n[dim]Done in {elapsed:.1f}s[/dim]")
908+
903909

904910
def main() -> None:
905911
try:

codeclone/html_report.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,10 +760,9 @@ def _meta_value_html(label: str, value: object) -> str:
760760
f'<div class="meta-panel" id="report-meta" {meta_attrs}>'
761761
'<div class="meta-header">'
762762
'<div class="meta-title">'
763-
f"{chevron_icon}"
764763
"Report Provenance"
765764
"</div>"
766-
'<div class="meta-toggle collapsed"></div>'
765+
f'<div class="meta-toggle collapsed">{chevron_icon}</div>'
767766
"</div>"
768767
'<div class="meta-content collapsed">'
769768
f'<div class="meta-grid">{meta_rows_html}</div>'

0 commit comments

Comments
 (0)