Repository navigation
Conversation
mcrit now keeps tags on families, samples and functions (familiary/mcrit#53), and nothing here showed them. Each page shows its record's tags under the heading, each linking to the search for what carries it, and the statistics page lists the tags in use. Contributors edit them in the family and sample edit dialogs and in a new tags dialog on the function page; saving removes and adds the difference, so a tag someone added meanwhile is kept. No mcrit release has the tag methods yet, so the requirement is not raised: with an older mcrit package, or against a backend that answers the tag routes with 404, nothing about tags is shown or offered.
The /api passthrough follows the client's new tag methods on mcrit's own paths: POST and DELETE on /api/<families|samples|functions>/<id>/tags add and remove tags, contributor-only as editing them in the UI is, and GET /api/tags counts the tags in use. DELETE is accepted on those paths only; with a client that has no tag methods they answer 501.
# Conflicts: # docs/manual/README.md # mcritweb/templates/single_sample.html # mcritweb/templates/statistics.html # mcritweb/templates/table/family_row.html # mcritweb/templates/table/sample_row.html # mcritweb/views/api.py # mcritweb/views/explore.py
The statistics page now heads its sections with h4 and sets each table in a half-width column with a hidden caption. The tags table follows: an h4, a col-lg-6 column instead of an inline width, and a caption.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The MCRITweb side of familiary/mcrit#53, on the API of familiary/mcrit#237: tags on families, samples and functions, added and removed rather than replaced (
POST/DELETE /{families|samples|functions}/{id}/tags), found with the paginated searchtags:"x", and counted withGET /tags.What the pages show.
tags:"<tag>"across families, samples and functions, which lists them in the existing paginated tables. Tag names come from the corpus and are escaped.Editing (2bf9768). Contributors edit tags in the family and sample edit dialogs, and in a new tags dialog beside Rename on the function page (
explore.modify_function_tags, POST, CSRF as the other edits). Saving removes and adds only the difference against what the page showed, so a tag someone else added meanwhile is kept. Tags go in before the queued rename or move job, an invalid tag refuses the whole form before anything is written, and a form without the tags field changes no tags.API (2696349).
/apipasses the client's tag methods through on mcrit's own paths:POSTandDELETEon/api/<families|samples|functions>/<id>/tags, contributor-only as editing in the UI is, andGET /api/tags.DELETEis accepted on those paths only. With a client that has no tag methods they answer 501.Statistics page (d7aaecf). The tags table is laid out like the page's others since #301: an h4 heading, a
col-lg-6column instead ofwidth:50%, and a hidden caption.Against an mcrit without tags. No mcrit release has the tag methods yet, so the requirement is not raised. With an installed mcrit package without them, nothing about tags is shown or offered. With a package that has them and a backend that does not (version strings do not tell: #237's branch and 1.16.0 both report 1.16.0), the web asks the backend once per page, for contributors only; a 404 means nothing is offered. Checked end to end with the real
McritClientagainst servers built from #237 and from 1.16.0: tags saved, shown, counted, found through search and cleared; both combinations without tags render as before. Once mcrit ships tags, the requirement can be raised and the hiding becomes a fallback.Master e7e75fa is merged in.
Tests.
tests/testTags.py, 57 tests: the badges and links on the three pages, escaping, the statistics section, the dialogs and the function route (contributor-only, CSRF, the add-and-remove difference, an invalid tag writes nothing, a form without the field writes nothing, ordering before the rename or move job), the/apiroutes and their roles, and both no-tags cases.tests/testTagsBrowser.py, 6 Chromium tests: editing in each dialog and the result on the page.ruff check .is clean.Lighthouse on the tagged pages: Accessibility, Best Practices and SEO are 100, layout shift and contrast as on master, and no new script.
With the open PRs.
ref/web-guidance-combined-5isref/web-guidance-combined-4(all open PRs, #316's comment has the order) with this branch merged. What this PR needs once those have landed, as commits there:rounded-pill,text-whiteandtext-decoration-none(regenerated withscripts/subset_bootstrap.py); 19ed54a: the Font Awesome subset keeps the tags icon (scripts/subset_fontawesome.py, 96 bytes).CHANGELOG.md.<button>, its icon is hidden from screen readers and its title is anh2; the fields turn autocorrect and autocapitalisation off; the statistics table has a caption, now on this PR itself in d7aaecf (Label every form field, keep what was typed on a refusal, and check inputs before they are sent #333's and Make every dialog, table, picker, tab list, ordering and the cross-compare matrix work from the keyboard #335's patterns)..table-scrollbox (Lay out tables, the matrix, the CFG panes and long text for every screen width and text size #337).The full suite passes there: 5300 tests. No
<script>is added, so #330's nonce test and policy walk pass unchanged.