mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-03 13:18:58 +00:00
fix: recover native dialog modal placement
Issue: #463 User-Visible: yes
This commit is contained in:
@@ -514,6 +514,50 @@ const MUTANT_DEFINITIONS = [
|
||||
+ ' "confirm.unlock_title": "Unlock?",',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'dialog-native-surface-stretches-to-viewport',
|
||||
guard: 'node demo/smoke_dialog_modal_recovery.mjs',
|
||||
because: 'the native top-layer shell must shrink-wrap its surface; restoring width:auto '
|
||||
+ 'reproduces the left-pinned confirmation from #463 even though :modal remains true',
|
||||
patches: [{
|
||||
file: 'src/hp-dialog.ts',
|
||||
find: ' width: fit-content;\n height: fit-content;',
|
||||
replace: ' width: auto;\n height: fit-content;',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'dialog-native-update-recovery-disabled',
|
||||
guard: 'node demo/smoke_dialog_modal_recovery.mjs',
|
||||
because: 'an open-but-nonmodal native shell must be reconciled on a later Lit update without '
|
||||
+ 'a duplicate or hp-close event; firstUpdated alone cannot recover that #463 state',
|
||||
patches: [{
|
||||
file: 'src/hp-dialog.ts',
|
||||
find: ' protected updated(changed: PropertyValues): void {\n'
|
||||
+ ' super.updated(changed);\n'
|
||||
+ ' this._ensureNativeModal();\n'
|
||||
+ ' }',
|
||||
replace: ' protected updated(changed: PropertyValues): void {\n'
|
||||
+ ' super.updated(changed);\n'
|
||||
+ ' // mutant: update reconciliation removed\n'
|
||||
+ ' }',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'dialog-native-reconnect-recovery-disabled',
|
||||
guard: 'node demo/smoke_dialog_modal_recovery.mjs',
|
||||
because: 'detaching a modal drops it from the browser top layer while its rendered shell '
|
||||
+ 'survives; reconnect must schedule one bounded reconciliation for the same node (#463)',
|
||||
patches: [{
|
||||
file: 'src/hp-dialog.ts',
|
||||
find: ' queueMicrotask(() => {\n'
|
||||
+ ' // Re-entering the top layer lets the UA choose a default focus target.\n'
|
||||
+ ' // Restore our deterministic initial target only on a real reconnect\n'
|
||||
+ ' // recovery; ordinary updates must never steal focus from a live field.\n'
|
||||
+ ' if (this._ensureNativeModal()) this._focusInitial();\n'
|
||||
+ ' });',
|
||||
replace: ' // mutant: reconnect reconciliation removed',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'confirm-dialog-loses-alertdialog',
|
||||
guard: 'node demo/smoke_danger_confirm_branches.mjs',
|
||||
|
||||
@@ -27,6 +27,13 @@
|
||||
|
||||
/** @type {SmokeLink[]} */
|
||||
export const SMOKE_LINKS = [
|
||||
{
|
||||
symbols: ['HpDialog', '_ensureNativeModal', '_useHaDialog', '_usesHaDialog'],
|
||||
smokes: ['smoke_dialog_modal_recovery.mjs'],
|
||||
because: 'the #463 production-bundle scenario observes native top-layer state, geometric '
|
||||
+ 'centring, ::backdrop, update/reconnect recovery and late ha-dialog registration; none '
|
||||
+ 'of those browser lifecycle effects can be proved from the Lit source alone',
|
||||
},
|
||||
{
|
||||
symbols: [
|
||||
'commitDraftSegmentGeometry', 'draftLiveCandidateSpace', 'draftLiveSeed',
|
||||
|
||||
Reference in New Issue
Block a user