Repository navigation
Establish UI/UX parity and design consistency across views - #253
Conversation
…views Comprehensive audit and normalization of the user-facing interface: - Clean global stylesheet constraints in style.css (remove rigid min-width: 900px, html padding override, and restrictive form sizing), navbar.css, and signin.css. - Semantic HTML landmarks and accessibility enhancements in base.html (<html lang="en">, <main class="content">, explicit logo dimensions for CLS prevention, aria-labels). - Replace all deprecated <center> tags repo-wide with Bootstrap 5 flexbox/alignment. - Migrate table headers across all views to standard Bootstrap 5 table-light. - Standardize compare drill-down navigation with a shared compare_breadcrumb component. - Fix broken controls: attach CSRF token to column settings AJAX/reset, fix duplicate IDs, properly close <i> icon tags in <th>, and fix orphaned for="block_count" label references. - Redirect unfinished analyze.compare_submit_query route to analyze.query. - Add automated regression guardrails in tests/testUiParity.py.
- Delete the now-unreachable compare_submit_query.html stub: the route renders a redirect to analyze.query since the previous commit. - Apply .btn-clipboard to the clipboard button macro (a 24px touch target instead of the inline 20px style) and drop the unused .mcrit-dropzone rule from style.css. - Give sortable column headers a keyboard handler to match the role="button" tabindex="0" they now carry. - Add a meta description to base.html, closing the meta-description audit on #243; color-contrast in score-tinted rows and one-digit target sizes remain open there. - Document deliberate changes the previous message omitted: the "View profile" dropdown items in the admin user lists linked to cross compare and no profile page exists, so they were removed; the nav-pill and accordion overrides in style.css were dropped in favour of Bootstrap defaults; .gitignore additionally covers .claude/ like CLAUDE.md.
f22bd65 to
67710e0
Compare
The row handler told a button click from a row click by event.target.id,
which only worked while style.css had `a > * { pointer-events: none; }`.
With that rule gone, a click on the edit pencil lands on the <i> icon, so
the row navigated to the family page instead of opening the edit dialog,
and the Malpedia icon opened its tab and also navigated the current one.
Skip any click inside a link or button, as the sample rows now do, and
drop the leftover console.log.
|
Ran this against the live testbed (mcrit 1.13.0, 66 samples, 436 jobs), side by side with master Regression (fixed). Dropping Crawl and browser sweep.
The fixes, clicked through in a browser.
Also seen: logged-out pages no longer load the upload dialog ( Tests 1265 passed / 7 skipped, ruff clean, CI green on |
single_query_sample.html: master stopped printing "None" for a sample without a timestamp; this branch replaced the row's valign attributes with align-middle and closed the header cell with </th> instead of </td>. Kept both. testSampleTimestamp.py located that row by "Timestamp</td>", the mismatched closing tag; it now accepts </th> as well, since what it tests is the cell's value.
|
@danielplohmann the red CI here is not this PR's: please merge #297 first. On the current head (bf77b9b, master 1.6.0 merged in), the unit tests fail on Python 3.12, 3.13 and 3.14 with the same 8 tests, all in #297 fixes the stub for both 1.15 and 1.16. Once it is on master and merged in here, this PR needs no change for it. |
Conflicts in 23 templates and stylesheets, where batch C (#298, #299) changed the same lines as this branch. Master's changes are kept and this branch's are applied on top: - Headings: #244's h2/h3 outline wins over this branch's restyled headings; the delete-job modal title is <h2 class="modal-title h5">. - Job titles: master's job_name filter replaces job_info.parameters in the link hunt, maintenance and function result headings, keeping the breadcrumb this branch added. - Empty states: master's empty_state macro replaces this branch's inline messages; the macro itself now uses a centred div instead of <center>, and so does the job search's no-match line. - Cross compare: master renders one method's matrix and fills the other tabs on click. Its tab loop now shows this branch's labels, looked up by method name; the pane body is a div instead of <center>, and the script finds it by class. - Admin page: the maintenance forms keep master's confirm-before-submit handler and this branch's spacing classes. - Job errors: master's pre.job-error replaces the wrapper div. - Row buttons: this branch's per-item aria-labels stay, with master's titles added where this branch had none. - YARA copy: the button stays and calls master's copyTextAreaToClipboard; testResultPages accepts a button carrying that handler, not only an <i>.
Two CSS lines this branch touched kept trailing spaces, testUiParity.py had three blank lines between two tests, and .gitignore gained an entry for a local tool directory that master does not list.
This branch put a static description into base.html's head, and #244 later gave master a {% block description %} for the same purpose. The batch C merge kept both, so every page carried two descriptions and a crawler could take either one. Master's block stays, since a page can override it, and the static line goes. testAccessibility's page check now reports more than one description, which fails on all 35 rendered pages without this change.
Dropping the tutorial's .content rules also dropped the 1em gap under every field of the result pages' filter forms. At desktop width their checkboxes are under 24px tall and sat flush against the field above and the Filter button below, so Lighthouse's target-size audit failed the 1vN result there. form.form-inline gets the gap back. The sample Analyze buttons carried an aria-label that left out the job count they show (label-content-name-mismatch, WCAG 2.5.3). They are named by their content now: the count, visually hidden words and an icon hidden from assistive technology. testAccessibility's page check now fails on an aria-label that leaves out a word the control shows, and testFilterFormTargetsBrowser measures the spacing WCAG 2.5.8 asks of the filter forms in Chromium.
style.css's `.content form` rule, which this branch drops, gave the zone half the column, 608px on a desktop. In the flex column that replaces <center> a form is as wide as its content instead, and the zone's content is Dropzone's message: 44px wide until Dropzone had attached, 239px after, short of the 600px max-width. Lighthouse counted the widening as a layout shift wherever Dropzone attached after the first paint. Both zones are width: 100% up to 600px now, the import page's too, whose margin: 10% never applied (.content form set 1em).
The conflicts are the filter and server fields #253 relabelled: kept as they are here, with their values quoted.
The conflict is the two new-password fields #253 labelled: kept as they are here, and required.
It aborted static/dropzone.js, which no page loads since #324 serves the minified build, so both of its runs measured the zone with Dropzone in. It holds back that file now, and checks, once the queue has run, that nothing filled the zone.
familiary#253 turned .right-logo from an absolutely positioned corner logo into a flex item, which put it right next to the MCRIT logo instead of at the right edge. Pin it top-right again, as on master, at familiary#253's 40px height. The logo is only shown from 992px (d-lg-block), so narrower layouts are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HERmVhHo4ibp7HSTXr3Ya8
…and its tests familiary#253, now on master, leaves the navbar transparent and the inactive pills, the open accordion header and its focus ring to Bootstrap. The dark sheet gets the pill, accordion and focus rules the light sheet no longer carries, and the dark-theme tests read table-light and a navbar that paints nothing of its own. familiary#253's testUiParity reads <html lang="en"> followed by data-theme, and the logos' sizes as themed_img() arguments.
#253 moved the FKIE logo out of the navbar's top-right corner from 992px up, and every test and Lighthouse check passed: none of them compares where things land. The Testing section now asks for screenshots of the pages a change can affect, before and after, at 390, 820, 1280 and 1920px and in both themes, each pair looked at; a difference is either the intended change, named in the PR, or a regression pinned by a browser test such as testNavbarLogosBrowser.py. A merge that resolves a template or stylesheet conflict counts as a change.
Grew out of the same Lighthouse pass as #244, but is about parity, consistency and broken controls rather than the audits themselves. #244 is merged now (batch C1); where both changed the same element, master's form is kept, as listed under "Merge with batch C" below.
Consistency and parity
<center>tags replaced with Bootstrap 5 flex/alignment;thead-lightmigrated totable-lightacross every view (the old class stays as a CSS alias).compare_breadcrumbcomponent instead of ad-hoc headings.style.css(rigidmin-width: 900pxonbody,htmlpadding, half-width forms), nav-pill and accordion overrides surrendered to Bootstrap defaults.url_forinstead of hardcoded/data/result/…paths.Broken controls fixed
dropdown-menuin every sample row,sample_…_editon family rows), unclosed<i>tags inside<th>, a premature</tr>on the result page, a{ %typo that left a column default unset, a stray</td>in the job column table, and the admins-tab delete button targeting a nonexistenttab='admin'.bs-toggleattribute plus hand-rolled jQuery toggling; they are real Bootstrap dropdowns now, and the row-click navigation skips clicks inside the buttons cell.analyze.compare_submit_queryrendered an empty stub page; it redirects toanalyze.queryand the template is gone..btn-clipboardclass.Guardrails:
tests/testUiParity.pyfails on<center>,thead-light, orphanedfor="block_count", unclosed<i>inside<th>, themin-width: 900px, and:(emoticons.Verified at the time:
python -m pytest1265 passed / 7 skipped,ruff check .clean, and the edited templates compile. The live checks are below.Merge with batch C (2deab96). Master (6564602, #298 and #299) is merged in; 23 templates and stylesheets conflicted. Master's changes are kept and this branch's are applied on top:
<h2 class="modal-title h5">(mcritweb/templates/jobs.html:230).job_namefilter replacesjob_info.parametersin the link hunt, maintenance and function result headings (linkhunt.html:14,result_maintenance.html:9,result_compare_function.html:16), with this branch's breadcrumb kept on the function page.empty_statemacro replaces this branch's inline messages. The macro itself now uses a centreddivinstead of<center>(mcritweb/templates/table/table.html:22), as does the job search's no-match line (jobs.html:213), sotestUiParity.pykeeps holding.score_weighted), looked up by method name (result_cross.html:224). The pane body is adivinstead of<center>, and the script that fills it finds it by class (result_cross.html:304).pre.job-errorreplaces the wrapperdiv.copyTextAreaToClipboard.testResultPages.py's check for that handler accepts abuttonas well as an<i>; a click on the icon bubbles to the button.{% block description %}meta is kept and this branch's static description is gone (mcritweb/templates/base.html:9is the one left). The merge had kept both, so every page carried two; 137b0b5 removes the second, andtests/testAccessibility.pynow reports a page with more than one.9829e95 drops two trailing spaces in CSS lines this branch touched, a third blank line in
testUiParity.py, and an entry for a local tool directory this branch had added to.gitignore, which master does not list.With master merged, two of
testUiParity.py's tests pass on master's code too, because #244 made the same fixes:test_base_html_accessibility_and_semanticsandtest_no_mismatched_block_count_label. They stay as guards. Full suite with Chromium on 2deab96: 2087 passed, 11 skipped;ruff check .clean.137b0b5 removes the second page description described above. Full suite with Chromium on 137b0b5: 2087 passed, 11 skipped;
ruff check .clean.f5bab66: two regressions this branch caused, found by Lighthouse. A run against master (6564602) showed two things this branch got worse:
.contentrules also dropped the 1em gap under every field of the result pages' filter forms. At desktop width their checkboxes are under 24px tall and sat flush against the field above and the Filter button below, sotarget-sizefailed the 1vN result at 1350px: accessibility 96, against master's 100.form.form-inline inputgets the gap back (mcritweb/static/style.css:212). Every control in those forms now has master's computed bottom margin, and the 1vN result scores 100 at desktop width again.label-content-name-mismatch, WCAG 2.5.3). They are now named by their content: the count, visually hidden words, and an icon hidden from assistive technology (table/sample_row.html:141,single_sample.html:111). In the accessibility tree a row's button reads "Analyze sample , matching jobs: ", and the buttons look as before.tests/testAccessibility.py's page check now fails on an aria-label that leaves out a word the control shows.tests/testFilterFormTargetsBrowser.pymeasures WCAG 2.5.8's spacing in Chromium on the nine filter forms of five result pages and link hunt, at Lighthouse's desktop width. Both fail on 137b0b5 and pass on master and on f5bab66. Removing the margin rule, or putting the aria-label back, fails them again.On mobile, without master's 900px minimum width the result tables are as wide as the screen and wrap more, so
target-sizealso fails on a family's matches (?famid=), where master passes. Those are the id and family cells, which #302 keeps on one line. On a local build with both PRs, mobile accessibility is 100 on the 1vN result and its?famid=,?samid=and?funid=views, the 1v1 result and link hunt. Link hunt is about twice master's height at 768px and below, for the same reason.Full suite with Chromium on f5bab66: 2099 passed, none skipped;
ruff check .clean.Live check. On the testbed (mcrit 1.13.0), master (6564602) and this branch as side instances against the live backend, GET only. Headless Chromium over two pages of every route kind, 48 pages each: the same status, script errors, console messages and failed requests on both. Driving the controls:
bs-toggle)6ab3e95a3b24190e88fedbc0: second tab6abcb034595a8fbde663082f: copy an edited YARA ruleNo script errors on either.
check_corpus.py: as in the snapshot.Relation to open PRs. A trial merge (
git merge-tree) with each open PR head:table/family_row.htmlandtable/sample_row.html: both change the row click handlers. Whichever merges later moves its change onto the other's handler.result_compare_*pages andpagination_widget.html, as its description says: it moves this markup into macros.base.htmlandtable/submit_or_query_dropzone.html. Defer jQuery, and run the inline code that needs it from whenReady #304, on Stop the remaining head scripts and help screenshots from delaying first paint (#63, stacked on #126) #245, also conflicts insingle_sample.htmlandtable/links.html; its description gives the resolution.style.css,base.html,result_compare_all.html,result_cross.html,single_sample.html,table/sample_row.html,table/submit_or_query_dropzone.html,table/table.htmlandunique_blocks.html; its description gives the resolutions.<i>in the table headers, adds a check to the same self-test intests/testAccessibility.py, and adds a rule aftertable.table td.buttonsinstyle.css, where f5bab66 adds one too. All three conflict; Pass Lighthouse's table-header and target-size audits #302's description gives the resolution, and bothstyle.cssrules stay.