Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## [1.4.1] - 2026-02-15

### CLI

- Semantic summary colors: clone counts → `bold yellow`, file metrics → neutral `bold`
- Phase separator, bold report paths, "Done in X.Xs" timing line

### HTML Report

- HiDPI chart canvas, hit-line markers with Pygments, cross-browser `<select>`
- Platform-aware shortcut labels (`⌘` / `Ctrl+`), color-coded section borders
- Compact code lines, proper tab-bar for novelty filter, polished transitions
- Rounded-rect badges (`6px`), tighter card radii (`10px`), cleaner empty states

---

## [1.4.0] - 2026-02-12

### Overview
Expand Down
12 changes: 11 additions & 1 deletion codeclone/_cli_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@

from . import ui_messages as ui

_CLONE_LABELS = frozenset(
{
ui.SUMMARY_LABEL_FUNCTION,
ui.SUMMARY_LABEL_BLOCK,
ui.SUMMARY_LABEL_SEGMENT,
}
)


def _summary_value_style(*, label: str, value: int) -> str:
if value == 0:
Expand All @@ -22,7 +30,9 @@ def _summary_value_style(*, label: str, value: int) -> str:
return "bold red"
if label == ui.SUMMARY_LABEL_SUPPRESSED:
return "yellow"
return "bold green"
if label in _CLONE_LABELS:
return "bold yellow"
return "bold"


def _build_summary_rows(
Expand Down
11 changes: 9 additions & 2 deletions codeclone/_html_snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,16 @@ def _render_code_block(
rendered.append(
f'<div class="{cls}">{html.escape(text, quote=False)}</div>'
)
body = "\n".join(rendered)
body = "".join(rendered)
else:
body = highlighted
hit_flags = [hit for hit, _ in numbered]
pyg_lines = highlighted.split("\n")
rendered_pyg: list[str] = []
for i, pyg_line in enumerate(pyg_lines):
hit = hit_flags[i] if i < len(hit_flags) else False
cls = "hitline" if hit else "line"
rendered_pyg.append(f'<div class="{cls}">{pyg_line}</div>')
body = "".join(rendered_pyg)

return _Snippet(
filepath=filepath,
Expand Down
8 changes: 7 additions & 1 deletion codeclone/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os
import sys
import time
from collections.abc import Mapping, Sequence
from concurrent.futures import Future, ProcessPoolExecutor, as_completed
from dataclasses import asdict, dataclass
Expand Down Expand Up @@ -71,7 +72,6 @@
}
)


LEGACY_CACHE_PATH = Path("~/.cache/codeclone/cache.json").expanduser()


Expand Down Expand Up @@ -238,6 +238,8 @@ def _main_impl() -> None:
)
sys.exit(ExitCode.CONTRACT_ERROR)

t0 = time.monotonic()

if not args.quiet:
print_banner()

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

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


def main() -> None:
try:
Expand Down
3 changes: 1 addition & 2 deletions codeclone/html_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,9 @@ def _meta_value_html(label: str, value: object) -> str:
f'<div class="meta-panel" id="report-meta" {meta_attrs}>'
'<div class="meta-header">'
'<div class="meta-title">'
f"{chevron_icon}"
"Report Provenance"
"</div>"
'<div class="meta-toggle collapsed"></div>'
f'<div class="meta-toggle collapsed">{chevron_icon}</div>'
"</div>"
'<div class="meta-content collapsed">'
f'<div class="meta-grid">{meta_rows_html}</div>'
Expand Down
Loading