diff --git a/SQLLinter/Infrastructure/Reporters/Formatters/Html/v2/HtmlFormatter_v2.css b/SQLLinter/Infrastructure/Reporters/Formatters/Html/v2/HtmlFormatter_v2.css index 6a264d4..ca9ff1e 100644 --- a/SQLLinter/Infrastructure/Reporters/Formatters/Html/v2/HtmlFormatter_v2.css +++ b/SQLLinter/Infrastructure/Reporters/Formatters/Html/v2/HtmlFormatter_v2.css @@ -1868,3 +1868,21 @@ svg .flowchart-link { background-color: var(--color-primary); color: #ffffff; } + + .file-card.clickable:hover { + transform: translateY(-2px); + box-shadow: var(--shadow-8); + border-color: var(--primary-color); + } + + .file-card.clickable:active { + transform: translateY(0); + } + +.file-card-footer { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: var(--spacing-xs); + font-size: var(--font-size-xs); +} \ No newline at end of file diff --git a/SQLLinter/Infrastructure/Reporters/Formatters/Html/v2/HtmlFormatter_v2.js b/SQLLinter/Infrastructure/Reporters/Formatters/Html/v2/HtmlFormatter_v2.js index 2852f71..39042cd 100644 --- a/SQLLinter/Infrastructure/Reporters/Formatters/Html/v2/HtmlFormatter_v2.js +++ b/SQLLinter/Infrastructure/Reporters/Formatters/Html/v2/HtmlFormatter_v2.js @@ -37,6 +37,25 @@ class ReportRenderer { // Блок с closeBtn полностью удалён — он больше не нужен }); + document.addEventListener('click', (e) => { + const cardBtn = e.target.closest('.file-card.clickable'); + if (cardBtn) { + e.preventDefault(); + const targetId = cardBtn.dataset.target; + if (targetId) { + this.activateTabById(targetId); + + // Обновляем активный таб визуально + this.tabsList.querySelectorAll('.tab').forEach(tab => { + tab.classList.toggle('active', tab.dataset.target === targetId); + }); + + // Прокрутка вверх (опционально) + window.scrollTo({ top: 0, behavior: 'smooth' }); + } + } + }); + // Переключение табов (делегирование) this.tabsList.addEventListener('click', (e) => { const tab = e.target.closest('.tab'); @@ -398,7 +417,7 @@ class ReportRenderer { percents[maxIdx] = 100 - percents.reduce((a, b, i) => i !== maxIdx ? a + b : a, 0); } - const fileCards = this.files.map(file => { + const fileCards = this.files.map((file, index) => { const c = file.v?.c?.length || 0; const w = file.v?.w?.length || 0; const i = file.v?.i?.length || 0; @@ -409,8 +428,12 @@ class ReportRenderer { const maxI = fp.indexOf(Math.max(...fp)); fp[maxI] = 100 - fp.reduce((a, b, j) => j !== maxI ? a + b : a, 0); } - return `
-
${this.escapeHtml(file.n)}
+ const fileId = `file_${index}`; // ID вкладки файла + + return `
+
+ ${this.escapeHtml(file.n)} +