fix(v2)(ui): finish expanding self-closing q-* tags (rules-attribute corner case)

The earlier mass rewrite in cb19ba3 used a regex with `[^>]*?` to match
attribute spans, which stops at the first `>` it encounters. That broke
on tags with `:rules="[v => ...]"` where the JS arrow function's `>`
character truncated the match short of the actual `/>`. 8 tags survived
the rewrite (mostly form fields in dialog bodies). The Add-machine
dialog was the most visible victim — Vue's compiler tried to make
sense of the partially-malformed q-input and dumped the machine_npub
field plus the next two siblings side-by-side instead of stacked.

Fix: replaced the regex pass with a small stateful scanner that walks
the file tag-by-tag and is quote-aware (treats `>` inside paired
double or single quotes as literal characters, not tag terminators).
The scanner found and expanded the remaining 8 tags + verified zero
self-closing q-* tags remain anywhere in the template. 343 q-* opens
total in the file.

Caught while clicking through the Add-machine dialog in the UI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-05-14 19:25:03 +02:00
commit 8968c0ae07

View file

@ -33,7 +33,7 @@
class="q-mb-md"
:class="superConfig.super_fee_pct > 0 ? 'bg-blue-1 text-grey-9' : 'bg-grey-2 text-grey-9'">
<template v-slot:avatar>
<q-icon name="account_balance" :color="superConfig.super_fee_pct > 0 ? 'blue' : 'grey'" />
<q-icon name="account_balance" :color="superConfig.super_fee_pct > 0 ? 'blue' : 'grey'"></q-icon>
</template>
<span :style="{fontWeight: 500}">
LNbits platform fee:
@ -762,7 +762,7 @@
:rules="[
v => !!v || 'Required',
v => (v && v.length >= 32) || 'Looks too short'
]" />
]"></q-input>
<q-select
v-model="addMachineDialog.data.wallet_id"
@ -771,7 +771,7 @@
emit-value map-options
class="q-mb-md"
dense outlined
:rules="[v => !!v || 'Pick a wallet']" />
:rules="[v => !!v || 'Pick a wallet']"></q-select>
<q-input
v-model.number="addMachineDialog.data.fallback_commission_pct"
@ -1039,7 +1039,7 @@
label="Note"
type="textarea" autogrow
:rules="[v => (v && v.trim().length > 0) || 'Note cannot be empty']"
dense outlined />
dense outlined></q-input>
</q-card-section>
<q-card-actions align="right">
<q-btn flat label="Cancel" v-close-popup></q-btn>
@ -1103,13 +1103,13 @@
label="Liquidity provider"
emit-value map-options
class="q-mb-md" dense outlined
:rules="[v => !!v || 'Pick an LP']" />
:rules="[v => !!v || 'Pick an LP']"></q-select>
<q-input v-model.number="depositDialog.data.amount"
label="Amount (fiat)"
type="number" step="0.01" min="0"
class="q-mb-md" dense outlined
:rules="[v => v > 0 || 'Must be > 0']" />
:rules="[v => v > 0 || 'Must be > 0']"></q-input>
<q-input v-model="depositDialog.data.currency"
label="Currency"
@ -1185,21 +1185,21 @@
emit-value map-options
class="q-mb-md"
dense outlined
:rules="[v => !!v || 'Required']" />
:rules="[v => !!v || 'Required']"></q-select>
<q-input v-if="clientDialog.mode === 'add'"
v-model="clientDialog.data.user_id"
label="LP's LNbits user_id"
hint="The LP shares this from their LNbits account settings"
class="q-mb-md" dense outlined
:rules="[v => !!v || 'Required']" />
:rules="[v => !!v || 'Required']"></q-input>
<q-input v-if="clientDialog.mode === 'add'"
v-model="clientDialog.data.wallet_id"
label="LP's wallet_id (receives DCA)"
hint="The LP's wallet where their sats land"
class="q-mb-md" dense outlined
:rules="[v => !!v || 'Required']" />
:rules="[v => !!v || 'Required']"></q-input>
<q-input v-model="clientDialog.data.username"
label="Display name (optional)"
@ -1275,14 +1275,14 @@
label="Funding wallet (yours)"
emit-value map-options
class="q-mb-md" dense outlined
:rules="[v => !!v || 'Pick a wallet']" />
:rules="[v => !!v || 'Pick a wallet']"></q-select>
<q-input v-model.number="settleBalanceDialog.data.exchange_rate"
label="Exchange rate (sats per 1 fiat unit)"
hint="You set the rate. Use exchange spot, midpoint, or a favourable gesture."
type="number" step="0.0001" min="0"
class="q-mb-md" dense outlined
:rules="[v => v > 0 || 'Must be > 0']" />
:rules="[v => v > 0 || 'Must be > 0']"></q-input>
<q-input v-model.number="settleBalanceDialog.data.amount_fiat"
label="Amount (fiat) — leave blank to settle full remaining"