Name:
[IMP] viin_brain,viin_web_editor: UI hardening v1 (token + polish + Odoo-native + v2 seams)
State:
Killed
PR State:
merged
PR Author:
David Tran
PR Author Email:
PR:
#27
Committer:
David Tran
Committer Email:
davidtran.hp@gmail.com
Commit:
7de5441830a80cec113b54f8aca38aa7681c3edf
Description:
[FIX] viin_brain: P8 round 3 — ShareDialog uses dialog.add() service
Pre-existing OwlError "Cannot make the given value reactive" surfaced
in P8 round 3 boil-the-lake captures: clicking Share in the page header
consistently overlayed the full-page Odoo Client Error.
Root cause: <ShareDialog/> was rendered directly inside the BrainApp
template via t-if="state.showShareDialog". Odoo 17 base Dialog.setup()
calls useState(this.env.dialogData), and dialogData is only injected
when a dialog is opened through the dialog service (DialogWrapper +
WithEnv). With direct child rendering, env.dialogData is undefined and
useState(undefined) throws.
Refactor to canonical Odoo 17 pattern (per @web/core/dialog/dialog and
ConfirmationDialog reference): open ShareDialog imperatively via
dialog.add(), let the service inject `close` and provide env.dialogData.
Changes:
- brain_app.js: useService("dialog"); onOpenShare() now calls
this.dialog.add(ShareDialog, {...}); state.showShareDialog and
onCloseShare removed; ShareDialog dropped from static components.
- brain_app.xml: removed <ShareDialog/> render block (replaced with a
comment explaining the imperative-open requirement).
- share_dialog.js: props.onClose -> props.close (service-injected);
prop schema updated.
- share_dialog.xml: <Dialog onClose=...> attribute removed (Dialog
closes itself via env.dialogData); Cancel button calls props.close().
Verified via Visual Evidence MCP session 20260503-1844-brain-ui-p8r3-batch2:
ShareDialog now opens cleanly with public-link toggle visible (shot-004).
Brain v3 CI: 8 PASS / 1 pre-existing WARN (rule2 contenteditable baseline).
AC-1 hex grep: 0 violations.
Refs PR #27.
Branch:
17.0
Instance ID:
0
Age:
Up-time:
Not finished