feat(mobile): bouton assistant AI central dans la barre du bas
CI / lint (push) Successful in 57s
CI / security (push) Successful in 39s
CI / test (push) Successful in 1m16s
CI / build (push) Successful in 43s
CI / e2e (push) Successful in 19m16s
Desktop Build / build-windows (push) Canceled after 0s
Desktop Build / build-linux (push) Canceled after 0s

Sur mobile, la pastille flottante etait masquee par la barre d'outils.

- Masque .ai-fab sur mobile
- Ajoute un bouton rond sureleve #mt-ai au centre de la barre (5 items)
- Extrait openAssistant() dans ai-fab.js (reutilise par la FAB et le bouton mobile)
- mobile-toolbar.js : branche le bouton sur openAssistant()
This commit is contained in:
2026-09-11 09:58:04 -04:00
parent 84bda90065
commit 50b823e76d
4 changed files with 50 additions and 1 deletions
+8
View File
@@ -5041,6 +5041,14 @@ curl -X POST https://votre-serveur.com/webhook \
<i data-lucide="search" style="width: 20px; height: 20px"></i> <i data-lucide="search" style="width: 20px; height: 20px"></i>
<span class="mt-label" data-i18n="settings.search">Recherche</span> <span class="mt-label" data-i18n="settings.search">Recherche</span>
</button> </button>
<button
class="mt-btn mt-btn-ai"
id="mt-ai"
title="Assistant AI"
aria-label="Ouvrir l'assistant AI"
>
<i data-lucide="bot" style="width: 24px; height: 24px"></i>
</button>
<button <button
class="mt-btn mt-btn-primary" class="mt-btn mt-btn-primary"
id="mt-palette" id="mt-palette"
+8 -1
View File
@@ -23,7 +23,10 @@ function syncVisibility() {
_fab.setAttribute('aria-label', label); _fab.setAttribute('aria-label', label);
} }
async function onClick() { // Shared entry point used by the floating FAB and the mobile toolbar button.
// Reopens a collapsed panel, otherwise opens (or re-focuses) the assistant
// for the current application context.
export async function openAssistant() {
const panel = document.querySelector('.bookslm-panel'); const panel = document.querySelector('.bookslm-panel');
// Collapsed panel: reveal it instead of reopening. // Collapsed panel: reveal it instead of reopening.
if (panel && panel.classList.contains('open') && panel.classList.contains('hidden')) { if (panel && panel.classList.contains('open') && panel.classList.contains('hidden')) {
@@ -34,6 +37,10 @@ async function onClick() {
await booksLM.openForCurrentContext(); await booksLM.openForCurrentContext();
} }
async function onClick() {
await openAssistant();
}
export function initAIFab() { export function initAIFab() {
if (_fab) return; if (_fab) return;
+3
View File
@@ -2,6 +2,7 @@
Phases 1-5: fixed bar, vault home, file palette, commands, tab switcher */ Phases 1-5: fixed bar, vault home, file palette, commands, tab switcher */
import { state } from './state.js'; import { state } from './state.js';
import { TabManager } from './ui.js'; import { TabManager } from './ui.js';
import { openAssistant } from './ai-fab.js';
// ── Open file palette (search files) ── // ── Open file palette (search files) ──
function openFilePalette() { function openFilePalette() {
@@ -109,6 +110,7 @@ function toggleExplorer() {
export function initMobileToolbar() { export function initMobileToolbar() {
const explorerBtn = document.getElementById('mt-explorer'); const explorerBtn = document.getElementById('mt-explorer');
const searchBtn = document.getElementById('mt-search'); const searchBtn = document.getElementById('mt-search');
const aiBtn = document.getElementById('mt-ai');
const paletteBtn = document.getElementById('mt-palette'); const paletteBtn = document.getElementById('mt-palette');
const tabsBtn = document.getElementById('mt-tabs'); const tabsBtn = document.getElementById('mt-tabs');
const sheetClose = document.getElementById('mt-sheet-close'); const sheetClose = document.getElementById('mt-sheet-close');
@@ -117,6 +119,7 @@ export function initMobileToolbar() {
if (explorerBtn) explorerBtn.addEventListener('click', toggleExplorer); if (explorerBtn) explorerBtn.addEventListener('click', toggleExplorer);
if (searchBtn) searchBtn.addEventListener('click', openFilePalette); if (searchBtn) searchBtn.addEventListener('click', openFilePalette);
if (aiBtn) aiBtn.addEventListener('click', () => { openAssistant(); });
if (paletteBtn) paletteBtn.addEventListener('click', openCommandPalette); if (paletteBtn) paletteBtn.addEventListener('click', openCommandPalette);
if (tabsBtn) tabsBtn.addEventListener('click', openTabSwitcher); if (tabsBtn) tabsBtn.addEventListener('click', openTabSwitcher);
if (sheetClose) sheetClose.addEventListener('click', closeTabSwitcher); if (sheetClose) sheetClose.addEventListener('click', closeTabSwitcher);
+31
View File
@@ -7786,6 +7786,37 @@ body.popup-mode .content-area {
color: var(--accent); color: var(--accent);
} }
/* Hide the floating AI pastille on mobile — the assistant lives in the
centre of the bottom toolbar instead (below). */
.ai-fab {
display: none !important;
}
/* AI assistant — raised central button, stands out from the 4 other items */
.mt-btn-ai {
flex: 0 0 auto;
width: 56px;
height: 56px;
min-height: 56px;
margin: -18px 2px 0;
border-radius: 50%;
background: var(--accent);
color: #fff;
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 0 4px var(--bg-secondary);
z-index: 2;
}
.mt-btn-ai:active {
background: var(--accent);
transform: scale(0.94);
}
.mt-btn-ai svg {
width: 26px;
height: 26px;
}
.mt-btn-ai .mt-label {
display: none;
}
/* Tab count badge */ /* Tab count badge */
.mt-badge { .mt-badge {
position: absolute; position: absolute;