fix(mobile): address review findings for titlebar touch interactions (#4520)
This commit is contained in:
1 parent
f8af4ecc6d
commit
dee42a89cb
2 files changed
+14
-8
No files matched your search
+13
-7
@@ -152,11 +152,15 @@ function syncAppTitlebar() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mobile touch interactions — wired once per element lifetime.
|
// Dismiss stale popover on session/panel switch
|
||||||
if ('ontouchstart' in window && !titleEl._mobileTouchWired) {
|
const _existingPop = document.querySelector('.app-titlebar-title-popover');
|
||||||
titleEl._mobileTouchWired = true;
|
if (_existingPop) _existingPop.remove();
|
||||||
|
|
||||||
// Tap-to-reveal full title popover
|
// Mobile touch interactions
|
||||||
|
if ('ontouchstart' in window) {
|
||||||
|
// Tap-to-reveal full title popover — wired once per element lifetime
|
||||||
|
if (!titleEl._mobileTouchWired) {
|
||||||
|
titleEl._mobileTouchWired = true;
|
||||||
let _titlePopover = null;
|
let _titlePopover = null;
|
||||||
const _dismissTitlePopover = () => {
|
const _dismissTitlePopover = () => {
|
||||||
if (_titlePopover) { _titlePopover.remove(); _titlePopover = null; }
|
if (_titlePopover) { _titlePopover.remove(); _titlePopover = null; }
|
||||||
@@ -165,7 +169,6 @@ function syncAppTitlebar() {
|
|||||||
if (_renamingAppTitlebar) return;
|
if (_renamingAppTitlebar) return;
|
||||||
if (_titlePopover) {
|
if (_titlePopover) {
|
||||||
_dismissTitlePopover();
|
_dismissTitlePopover();
|
||||||
if (typeof titleEl.ondblclick === 'function') titleEl.ondblclick(e);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
@@ -187,10 +190,13 @@ function syncAppTitlebar() {
|
|||||||
};
|
};
|
||||||
setTimeout(() => document.addEventListener('click', _outside, true), 0);
|
setTimeout(() => document.addEventListener('click', _outside, true), 0);
|
||||||
}, { passive: true });
|
}, { passive: true });
|
||||||
|
}
|
||||||
|
|
||||||
// Long-press → session action menu (mirrors project-chip pattern, sessions.js:5362-5407)
|
// Long-press → session action menu (re-evaluated each sync so late-arriving sessions attach)
|
||||||
if (panel === 'chat' && S && S.session && !S.session.read_only && !S.session.is_read_only &&
|
if (!titleEl._mobileLpWired && panel === 'chat' && S && S.session &&
|
||||||
|
!S.session.read_only && !S.session.is_read_only &&
|
||||||
typeof _openSessionActionMenu === 'function') {
|
typeof _openSessionActionMenu === 'function') {
|
||||||
|
titleEl._mobileLpWired = true;
|
||||||
let _lpTimer = null;
|
let _lpTimer = null;
|
||||||
let _lpHandled = false;
|
let _lpHandled = false;
|
||||||
let _lpStartX = 0, _lpStartY = 0;
|
let _lpStartX = 0, _lpStartY = 0;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ def test_app_titlebar_returns_to_centered_desktop_layout():
|
|||||||
|
|
||||||
|
|
||||||
def test_app_titlebar_subtitle_shows_message_count_again():
|
def test_app_titlebar_subtitle_shows_message_count_again():
|
||||||
assert "subText = t('n_messages', vis.length);" in PANELS_JS
|
assert "subText = String(vis.length);" in PANELS_JS
|
||||||
|
|
||||||
|
|
||||||
def test_queue_updates_do_not_hijack_app_titlebar_subtitle():
|
def test_queue_updates_do_not_hijack_app_titlebar_subtitle():
|
||||||
|
|||||||
Reference in new issue
Block a user