Name:
[ADD/FIX] viin_ai: Phase 3.5 hardening + Phase 3.7 features (SRS v1.1 follow-up)
State:
Failed
finished in 15m
PR State:
merged
PR Author:
David Tran
PR Author Email:
PR:
#23
Committer:
David Tran
Committer Email:
davidtran.hp@gmail.com
Commit:
abcb66ea779fbbde1bce6d11842d187729ce4b36
Description:
[IMP] cluster ai17: PR23 round 3 follow-up — Chrome timeout mixin, QUnit guard, tour bugs, prettier
Round 3 follow-up after PR #23's first 9 fixes shipped — addresses 2 issues
exposed by reviewer round 2 plus a batch of tour bugs that became visible
once Chrome devtools port detection had enough time to start in the local
heavy-bundle environment.
T1 — BrowserTimeoutBoostMixin (viin_brain/tests/common.py)
* Module-level snapshot of odoo.tests.common.CHECK_BROWSER_ITERATIONS,
setUpClass bumps to 200 (=20s budget), tearDownClass restores. Folded
into TourCaseBase MRO so all viin_brain tour tests inherit the boost;
TestBrainAccountReportTour also picks up the mixin via direct subclass.
TestBrainAiBlockTour now inherits TourCaseBase to gain mixin + the
Welcome-page seed it was missing.
* Why: cluster ai17 ships heavy bundles (viin_brain + viin_ai_brain +
viin_web_editor); first-tour Chrome headless boot needs 12-15s. The
Odoo 17 default BROWSER_WAIT=10s caused silent ``skipped`` results
that hid real product bugs.
T2 — QUnit guard for BacklinkPanel.isEmpty AI-authored branch
* New file viin_brain/static/tests/components/backlink_panel_isempty_tests.js
exercising 3 cases (AI page empty / non-AI empty / AI with backlink)
via stub-instance pattern. Registered in __manifest__.py.
* Why: the ``&& !this.state.isAiAuthored`` guard added in WI-14 had no
unit test; the only coverage was the brain_ai_review tour, which had
been silently skipping due to T1's underlying root cause.
T3 + T4 — chatgpt_dialog tour comment + docstring clarification
* Reworded innerHTML wipe comment to focus on test-only fixture isolation
rather than demo-content geometry.
* Updated TestBrainChatGptDialogTour docstring to reflect the live
selector (.o_brain_sidebar) and explicit MockedProviderMixin wiring.
Prettier 2.x batch (~76 files)
* Cosmetic-only via ``prettier --write`` then ``eslint --fix`` against
the Odoo upstream eslintrc (plugin:prettier/recommended). No logic
changes — eslint v8 strict mode would have failed without these.
Real tour-bug fixes (10 bugs surfaced by T1)
* brain_collab_activation_tour, brain_content_type_tokens, brain_floating
_toolbar (mouse-sequence run handler), brain_slash_autosave (autosave
race + dismiss step), brain_slash_focus (innerHTML trigger + dismiss),
brain_ux_batch_a (anchor parent), brain_ux_high (collapsed-state
selector + jQuery :contains workaround), ai_block (sidebar selector +
inheritance switch), chatgpt_dialog (slash menu wait sequence).
* Production source fixes (root-cause, not workaround):
- brain_form_sidebar_compiler.js: ``compile(key, params)`` — ``key``
is a string identifier, not a DOM node. Old ``key.querySelector``
was a silent no-op so chatter detection always returned false.
Now scans the compiled ``res`` DOM for ``.o-mail-Form-chatter``
(mirrors mail's own compiler).
- page_editor.js: first-save versionToken=false to skip optimistic
concurrency check when the token computed at page-read time can
diverge from the server-side recompute (microsecond rounding).
FIXME marker tracks restore once compute determinism is fixed.
- page_context_menu.js: ``useExternalListener`` import path —
``@odoo/owl`` (not ``@web/core/utils/hooks``).
- ai_bridge_service.js: static import of brain_ai_write_dialog —
dynamic import was not resolving inside the Odoo asset bundle.
* 5 partial fixes / newly visible tours documented as follow-up
(TestBrainDatabaseViewTour, TestBrainFloatingToolbarTour underline
formatBlock, TestBrainUxBatchATour P13-1, TestBrainAiBlockTour OWL
auto-mount, TestBrainChatGptDialogTour mocked-LLM autosave).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Branch:
17.0
Instance ID:
0
Age:
Up-time: