Skip to content

Commit c0187f2

Browse files
committed
fix(ui): prevent long clone paths from breaking report cards
1 parent b2fd74f commit c0187f2

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

codeclone/html_report.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,12 @@ def render_section(
439439

440440
out.append(
441441
'<div class="item">'
442-
f'<div class="item-head">{_escape(item["qualname"])}</div>'
443-
f'<div class="item-file">'
442+
f'<div class="item-head" title="{_escape(item["qualname"])}">'
443+
f"{_escape(item['qualname'])}"
444+
"</div>"
445+
f'<div class="item-file" '
446+
f'title="{_escape(item["filepath"])}:'
447+
f'{item["start_line"]}-{item["end_line"]}">'
444448
f"{_escape(item['filepath'])}:"
445449
f"{item['start_line']}-{item['end_line']}"
446450
f"</div>"

codeclone/templates.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,9 @@
594594
font-weight: 600;
595595
color: var(--accent-primary);
596596
font-family: var(--font-mono);
597+
white-space: nowrap;
598+
overflow: hidden;
599+
text-overflow: ellipsis;
597600
}
598601
599602
.item-file {
@@ -603,6 +606,9 @@
603606
font-family: var(--font-mono);
604607
font-size: var(--text-xs);
605608
color: var(--text-tertiary);
609+
white-space: nowrap;
610+
overflow: hidden;
611+
text-overflow: ellipsis;
606612
}
607613
608614
/* Code Display */

0 commit comments

Comments
 (0)