diff --git a/main.py b/main.py index cfe49ae..4e274c3 100644 --- a/main.py +++ b/main.py @@ -555,7 +555,7 @@ MAX_MESSAGE_LEN = 10_000 # ⚠️ Версия UI — единый источник. БАМПАТЬ ПРИ КАЖДОМ ДЕПЛОЕ (формат: YYYY-MM-DD + буква). # Фронт берёт её через GET /api/version (chat.html + admin.html, элемент .app-version). -APP_VERSION = "2026-12-04h" +APP_VERSION = "2026-12-05a" # Audit: path → action name mapping _AUDIT_MAP = [ diff --git a/static/changelog.json b/static/changelog.json index b487798..09d3630 100644 --- a/static/changelog.json +++ b/static/changelog.json @@ -1,4 +1,11 @@ [ + { + "version": "2026-12-05a", + "date": "2026-12-05", + "changes": [ + "На экранах от 1280 px все колонки подбора норм видны без прокрутки; каталог разделов открывается кнопкой над таблицей" + ] + }, { "version": "2026-12-04h", "date": "2026-12-04", @@ -27,12 +34,5 @@ "changes": [ "Выбор региона в подборе норм теперь умещается на экране телефона при длинных названиях" ] - }, - { - "version": "2026-12-04d", - "date": "2026-12-04", - "changes": [ - "После обновления подбора норм браузер сразу получает новую версию интерфейса" - ] } ] diff --git a/static/norm-finder.html b/static/norm-finder.html index 976cd9f..575b6b5 100644 --- a/static/norm-finder.html +++ b/static/norm-finder.html @@ -71,8 +71,8 @@ .draft-row input { width:110px; } .quote-controls label { min-width:140px; } .quote-controls #qty { width:125px; } - .workspace { display:grid; grid-template-columns:minmax(230px,280px) minmax(0,1fr); gap:16px; align-items:start; } - .catalog-tree { max-height:72vh; overflow:auto; position:sticky; top:12px; } + .workspace { display:block; } + .catalog-tree { max-height:45vh; overflow:auto; margin-bottom:12px; } .catalog-tree h2 { font-size:1.05rem; } .tree-list { list-style:none; margin:0; padding:0 0 0 12px; border-left:1px solid var(--line); } .tree-list button { width:100%; text-align:left; border:0; border-radius:5px; background:transparent; @@ -85,7 +85,7 @@ .table-panel h2 { margin:0; } .table-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; } .norm-scroll { max-width:100%; overflow-x:auto; } - .norm-table { min-width:1420px; table-layout:fixed; font-size:.78rem; line-height:1.28; } + .norm-table { min-width:1060px; table-layout:fixed; font-size:.78rem; line-height:1.28; } .norm-table th,.norm-table td { border:1px solid #d9e0e2; padding:4px 6px; vertical-align:middle; } .norm-table th { background:#eef2f4; position:sticky; top:0; z-index:1; } .norm-table tr > :first-child { position:sticky; left:0; z-index:2; background:#fff; } @@ -125,16 +125,13 @@ .rate-panel input { width:100%; min-width:88px; } .table-scroll-hint { margin:2px 0 8px; } .breadcrumb { color:var(--muted); font-size:.84rem; overflow-wrap:anywhere; } - .catalog-mobile { display:none; } + .catalog-mobile { display:block; margin-bottom:10px; } [hidden] { display:none !important; } @media (max-width:760px) { .wrap { padding:18px 14px 40px; } header { margin-bottom:24px; } .detail-grid,.comparison { grid-template-columns:minmax(0,1fr); } .panel,.card { padding:15px; } .search-row > *, .controls > label { flex:1 1 100%; } .search-row button { width:100%; } .quote-controls label { min-width:0; } .workspace { display:block; } - .catalog-mobile { display:block; margin-bottom:10px; } - .catalog-tree { position:static; max-height:45vh; margin-bottom:12px; } .catalog-tree[hidden] { display:none !important; } - .norm-table { min-width:1420px; } } @@ -158,7 +155,7 @@
- +

Нормы сборника

@@ -182,8 +179,8 @@
-

Прокрутите таблицу вправо для разбивки затрат; шифр останется виден. ОТм входит в ЭМ. В ГЭСН указаны нормы расхода без готовой единичной цены. Суммы ФЕР-2020 — базис на 01.01.2000, не текущие цены.

-
ШифрНаименованиеЕд. изм.РасходПЗ, руб.ОТ, руб.ЭМ, руб.ОТм, руб.МАТ, руб.
+

В узком окне таблицу можно прокручивать вправо; шифр останется виден. ОТм входит в ЭМ. В ГЭСН указаны нормы расхода без готовой единичной цены. Суммы ФЕР-2020 — базис на 01.01.2000, не текущие цены.

+
ШифрНаименованиеЕд. изм.РасходПЗ, руб.ОТ, руб.ЭМ, руб.ОТм, руб.МАТ, руб.
@@ -214,6 +211,6 @@ - + diff --git a/static/norm-finder.js b/static/norm-finder.js index 0182f31..0f2d050 100644 --- a/static/norm-finder.js +++ b/static/norm-finder.js @@ -728,7 +728,6 @@ tree.hidden = !tree.hidden; $('catalog-mobile').setAttribute('aria-expanded', String(!tree.hidden)); }); - if (matchMedia('(max-width:760px)').matches) $('catalog-tree').hidden = true; document.querySelectorAll('[data-query]').forEach(button => button.addEventListener('click', () => { $('query').value = button.dataset.query; $('search-form').requestSubmit(); })); diff --git a/tests/test_norm_finder_ui.py b/tests/test_norm_finder_ui.py index 018d563..4863dde 100644 --- a/tests/test_norm_finder_ui.py +++ b/tests/test_norm_finder_ui.py @@ -103,6 +103,10 @@ def test_catalog_tree_opens_norm_composition_in_the_same_table(browser, site): }; })()""") page.goto(site) + assert page.locator('#catalog-tree').is_hidden() + assert page.locator('#catalog-mobile').get_attribute('aria-expanded') == 'false' + page.locator('#catalog-mobile').click() + assert page.locator('#catalog-mobile').get_attribute('aria-expanded') == 'true' tree = page.locator('#tree-root button', has_text='Земляные работы').first assert tree.locator('.tree-arrow').inner_text() == '▸' tree.click() @@ -124,6 +128,28 @@ def test_catalog_tree_opens_norm_composition_in_the_same_table(browser, site): page.close() +@pytest.mark.parametrize('width', [1280, 1440, 1545]) +def test_desktop_shows_all_cost_columns_without_horizontal_scroll(browser, site, width): + page = browser.new_page(viewport={"width": width, "height": 900}) + page.add_init_script("""(() => { + const item = {base:'ГЭСН-2022',base_type:'ГЭСН',code:'37-01-001-01', + name:'Укладка бетонной смеси',unit:'100 м3',section_path:'Бетонные работы'}; + window.fetch = async url => { + const path = new URL(url, location.href).pathname; + const value = path.endsWith('/catalog') + ? {bases:[{base:'ГЭСН-2022',base_type:'ГЭСН',count:1}]} + : {items:[item],children:[],has_more:false}; + return new Response(JSON.stringify(value),{status:200,headers:{'Content-Type':'application/json'}}); + }; + })()""") + page.goto(site) + page.locator('#results .norm-row').first.wait_for() + assert page.locator('.norm-scroll').evaluate('el => el.scrollWidth <= el.clientWidth + 1') + assert page.locator('#results .norm-row td').first.evaluate('el => el.scrollWidth <= el.clientWidth + 1') + assert page.locator('#catalog-mobile').is_visible() + page.close() + + def test_video_table_has_two_triangle_toggles_and_inline_grid_rows(browser, site): page = browser.new_page(viewport={"width": 1360, "height": 800}) page.add_init_script("""(() => {