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
85 changes: 85 additions & 0 deletions src/renderer/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1346,6 +1346,91 @@ body.ana-ruler-dragging .ana-ruler-view {
border-radius: 5px;
}

/* Fold bar: a full-width separator that stands in for a run of collapsed
(non-highlighted) lines, or sits above/below an expanded run. Its height is
set inline to match the virtualized line height exactly. */
.ana-foldrow {
display: flex;
align-items: center;
min-width: 100%;
cursor: pointer;
user-select: none;
-webkit-user-select: none;
background: color-mix(in srgb, var(--accent) 5%, transparent);
box-shadow: inset 0 1px 0 color-mix(in srgb, var(--accent) 22%, transparent);
}
.ana-foldrow.foot {
box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--accent) 22%, transparent);
}
.ana-foldrow:hover {
background: color-mix(in srgb, var(--accent) 11%, transparent);
}
.ana-fold-bar {
display: inline-flex;
align-items: center;
gap: 5px;
height: 1.35em;
margin-left: 14px;
padding: 0 8px;
border-radius: 5px;
background: color-mix(in srgb, var(--accent) 16%, transparent);
color: var(--accent);
font-size: 0.82em;
font-weight: 700;
line-height: 1;
}
.ana-fold-ic::before {
content: '+';
font-weight: 800;
}
.ana-foldrow.open .ana-fold-ic::before {
content: '\2212'; /* minus sign */
}
.ana-fold-n {
font-variant-numeric: tabular-nums;
opacity: 0.95;
}
.ana-fold-jump {
display: inline-flex;
align-items: center;
justify-content: center;
margin-left: 8px;
padding: 1px 4px;
border: none;
border-radius: 4px;
background: transparent;
color: var(--accent);
cursor: pointer;
}
.ana-fold-jump:hover {
background: color-mix(in srgb, var(--accent) 20%, transparent);
}

/* Toolbar fold toggle active state (mirrors the other ghost toggles). */
#btnAnaFold.on {
color: var(--accent);
background: color-mix(in srgb, var(--accent) 14%, transparent);
}

/* Pulse a just-expanded run's background once, slowly, to point it out. */
@keyframes anaFoldFlash {
0% {
background: transparent;
}
50% {
background: color-mix(in srgb, var(--accent) 34%, transparent);
}
100% {
background: transparent;
}
}
.ana-line.foldflash {
animation: anaFoldFlash 1.2s ease-in-out;
}
.ana-foldrow.foldflash {
animation: anaFoldFlash 1.2s ease-in-out;
}

.hl-error {
color: #ff6b81;
font-weight: 700;
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@
"ana.highlight": "Highlight",
"ana.hl.auto": "Auto",
"ana.hl.none": "Off",
"ana.fold": "Fold",
"ana.fold.title": "Fold lines without highlights, showing only highlighted lines",
"ana.fold.lines": "{n} hidden lines — click to expand",
"ana.fold.toBottom": "Jump to the bottom of this section",
"ana.fold.toTop": "Jump to the top of this section",
"ana.copy": "Copy",
"ana.zoomIn.title": "Zoom in (Ctrl +)",
"ana.zoomOut.title": "Zoom out (Ctrl -)",
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/i18n/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
"ana.tab.copied": "已複製路徑",
"ana.tab.copyFail": "複製失敗",
"ana.highlight": "標記",
"ana.fold": "收折",
"ana.fold.title": "收折未標記的內容,只顯示被標記的行",
"ana.fold.lines": "已收折 {n} 行,點擊展開",
"ana.fold.toBottom": "跳到此段最下練",
"ana.fold.toTop": "跳到此段最上練",
"ana.hl.auto": "自動",
"ana.hl.none": "關閉",
"ana.copy": "複製",
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ <h2 id="anaViewName" data-i18n="ana.viewer">檢視</h2>
<label class="ana-hl-label" for="anaHlSelect" data-i18n="ana.highlight">標記</label>
<select id="anaHlSelect" class="ana-hl-select"></select>
</div>
<button class="btn btn-ghost btn-sm ana-foldtoggle" id="btnAnaFold" type="button" data-i18n-title="ana.fold.title" title="收折未標記的內容,只顯示被標記的行">
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="4" width="16" height="16" rx="2"/><line x1="9" y1="12" x2="15" y2="12"/><line x1="12" y1="9" x2="12" y2="15"/></svg>
<span data-i18n="ana.fold">收折</span>
</button>
<div class="ana-levels" id="anaLevels"></div>
<div class="ana-nav" id="anaNav">
<span class="ana-nav-count" id="anaNavCount">0</span>
Expand Down
Loading
Loading