Repository navigation
One confirm dialog and one toast region replace every native dialog (#2643) - #2696
Merged
Merged
Conversation
…2643) Every shell includes base/_feedback.html once, outside every block: the house component confirm_dialog (a Bootstrap modal on tokens), a toast region (polite + assertive) with the toast include as a <template>, and the ES module base/static/base/dialogs.js. One htmx:confirm listener routes every hx-confirm through the dialog (issueRequest(true) only on confirm); data-confirm holds a plain button's click back until confirm; window.oep.confirm/toast serve classic scripts and the vite bundles. Replaced: four hx-confirms (factsheet x2, organization delete, member remove), the permission page's two onsubmit confirms and its alert(), the tag editor's onclick confirm, the table view's delete modal (deleted; the wizard's unused one too), the peer review confirm and every alert() in backend.js, metaedit.js and peer review, and the four z-index:11 toast containers. Every modal takes the dialog's look; the dashboard drawers its header. Catalogue entries confirm_dialog and toast; dataedit:table-permission joins the page lint. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Bootstrap's modal ignores show() and hide() while it fades. An answer given during the fade-in left the dialog on screen with no handlers, and a confirmation asked during a fade was lost or answered "no" by the last one's close. Each call now waits for the fade it falls into, a hide counts as pending from when it is decided, and the backdrop "no" is listened for only once that confirmation's own show has happened. Three tests with a fading stand-in; checked in headless Chrome against real Bootstrap. - The factsheet Delete is a <button>: as an <a> without href it could not take focus, so focus never returned to it after the dialog. - The factsheet pages toast "not deleted" only for the delete request, not for any htmx error on the page. - Dropped modal/toast variables that restated Bootstrap's own values. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Conflicts were the shared files only: REUSE.toml, oepstrap.scss, RESTYLED_PAGES and the changelog as unions; bootstrap.min.css rebuilt. #2642's field look reads the same tokens as the dialog's own typed-input rule, so that rule is gone. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jh-RLI
added a commit
that referenced
this pull request
Oct 12, 2026
Conflicts: RESTYLED_PAGES (union; the permission page is listed by #2643 now, so the comment names only the peer review pages) and bootstrap.min.css (rebuilt with npm run build:theme). The catalogue's text snapshot is recaptured from develop's catalogue, which gained the entries #2642, #2643 and #2649 added. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Closes #2643 (sub-issue of #2632).
Every confirmation on the platform now asks through one dialog, and every error a script reports goes to one toast region. Nothing calls the browser's
confirm()oralert()any more.What it builds
confirm_dialog: a house component with an include (base/templates/components/confirm_dialog.html), a partial (theming/scss/components/_confirm_dialog.scss) and a catalogue entry (plain, danger, typed, plus three "Try" buttons).btn-secondary) and a button labelled with the verb.btn-dangerwhen the action cannot be undone,btn-primaryotherwise.toast: a house component with an include, a partial and a catalogue entry. It has the modal's 8px radius and large shadow, and a 4px status bar like the alert's.base/templates/base/_feedback.html. All five shells include it once after the footer, outside every block, so no page can drop it. It holds the dialog, the toast region, the toast<template>and the module.base/static/base/dialogs.js:confirmAction()returns a promise of true or false.showToast()adds one toast to the region.bindDialogs()installs onehtmx:confirmlistener, so everyhx-confirmopens the dialog. It callsissueRequest(true)only on confirm, andtrueskips htmx's ownconfirm().data-confirmon a plain button or link holds its click back until confirm. The click is caught in the capture phase and clicked again on confirm, so a form submits with its submitter and a jQuery handler runs only then.window.oep.confirm(…)andwindow.oep.toast(…).data-confirm-title,-verb,-dangerand-typed.What it replaces
hx-confirm+ nativeconfirm();<a>withouthref<button>, so it can take focus backhx-confirm+ nativeonsubmit="return confirm(…)"data-confirm, dangeralert()onclick="return confirm(…)", only for a tag in usedata-confirm, danger, also for an unused tagdata-confirm, danger; the modal is deletedconfirm("Are you sure?")window.oep.confirm, dangeralert()z-index: 11toast containersshowToastnow forwards to itdataedit:table-permissionjoinsRESTYLED_PAGESand passes the page lint. The lint's docstring now says whyhx-confirmis not a native dialog.For the reviewer: judgement calls
The dialog's typed input reads tokens itselfSettled by One field look and the account forms on house components (#2642) #2695: its field look reads the same tokens, so the dialog's own rule is gone.--dash-*, which Dashboard lists on house tokens #2659 retires.login:organizationsstays off for the reason already listed there (Settings becomes the account page; the dashboard gets one header #2653).Tests
base/static/base/__tests__/dialogs.test.js, 28 tests;base/static/base/**added to the vitest include):htmx:confirmissues its request only on confirm, and withtrue;data-confirmacts only on confirm;show()/hide()mid-transition. Review found that an answer within ~300 ms left a dead dialog on screen; a real-browser check then found a third case. All three are fixed and pinned with a stand-in modal that fades.base/tests/test_confirm_dialog.py, 15 tests):confirm(oralert((comments are stripped; vendored htmx, query builder and jsi18n are named exceptions);hx-confirmnames its title and verb;LightImportTest, the known isolated-settings artefact, which passes under normal settings.Checks
benchmarks/homepage/compare.mjs, whole page, nothing masked): 8/8 byte-identical, before and after, including after the review fixes.check_catalogue: complete, 15 entries, both token modes.theming/literal_scan.mjs: 0 under?tokens=bootstrap.npm run build:theme's pinnedsass@1.77.0+bootstrap@5.2.0. Develop's sources reproduce develop's stylesheet byte for byte.stock_tokens.cssis unchanged, since no token was added.hx-confirmsends no request on Cancel and exactly one on confirm;Not done / not checked
btn-success/btn-info(Table permissions and table view on house components #2657).Took develop after #2695 and #2694 (2026-10-12)
Merged
origin/developase9dcf82e9. The conflicts were all in shared files:REUSE.toml,theming/oepstrap.scss,RESTYLED_PAGESand the changelog: kept both sides.bootstrap.min.css: rebuilt with the pinnedsass+bootstrap, not resolved by hand.#2642's
fieldsets the same text colour and border that this PR's typed-input rule set. That rule is deleted, and the scan still finds 0.Results on the merged tree:
base,modelview,dataeditandlogintests: 1,478, OK.check_catalogue: 17 entries.gh pr view: MERGEABLE.🤖 Generated with Claude Code