feat(mobile): ruban d'edition style Obsidian + correctifs mobile (#83, BUG-017 a BUG-020)
CI / lint (push) Successful in 1m13s
CI / security (push) Successful in 47s
CI / test (push) Successful in 2m41s
CI / build (push) Successful in 43s
CI / e2e (push) Successful in 11m14s

- #83: ruban horizontal defilable ancre au-dessus du clavier, commandes
  etendues (titres, barre, surligne, code bloc, citation, listes, cases,
  wikilinks, tags, pieces jointes, undo/redo, colle, police) et
  personnalisation persistee via l'icone engrenage
- BUG-017: cartes du tableau de bord compressibles (min-width:0)
- BUG-018: en-tete editeur mobile compact, boutons Annuler/Sauvegarder
  accessibles, barre IA plus tactile
- BUG-019: ancrage du ruban via visualViewport (--kb-offset)
- BUG-020: suppression de la double barre de defilement

Tests: mobile-editor 35/35, ai 50/50, 9 suites JSDOM, validate-imports,
pytest 961 passed / 6 skipped, ruff + mypy 0.
This commit is contained in:
2026-09-13 11:49:45 -04:00
parent 162a5b4acc
commit 520059d866
11 changed files with 841 additions and 126 deletions
+199 -42
View File
@@ -3440,23 +3440,62 @@ select {
height: 36px;
min-width: 36px;
}
/* BUG-018: keep the Save / Cancel / Delete buttons reachable on small
screens by shrinking the inputs and hiding secondary header items. */
.editor-brand,
.editor-sep,
.editor-spacer,
.collab-presence {
display: none !important;
}
.editor-title-input {
flex: 1 1 60px;
min-width: 0;
font-size: 13px;
}
.editor-filename-input {
width: auto;
flex: 0 1 84px;
min-width: 0;
font-size: 11px;
}
.editor-save-dot {
margin-right: 2px;
padding: 0;
}
#editor-save-label {
display: none;
}
.editor-header .editor-btn {
flex: 0 0 auto;
}
.editor-body {
flex: 1;
min-height: 0;
overflow: auto;
/* BUG-020: only the CodeMirror scroller scrolls — no double scrollbar. */
overflow: hidden;
display: flex;
flex-direction: column;
}
#ai-toolbar-container {
flex: 0 0 auto;
}
.cm-editor {
flex: 1 1 auto;
height: auto;
min-height: 100%;
min-height: 0;
}
.cm-scroller {
overflow: auto !important;
height: auto;
min-height: 100%;
overflow-y: auto !important;
overflow-x: hidden !important;
/* BUG-019: keep the caret clear of the fixed ribbon. */
padding-bottom: 72px;
}
.fallback-editor {
min-height: 100%;
height: auto;
flex: 1 1 auto;
min-height: 0;
overflow-y: auto;
padding-bottom: 72px;
}
.search-results-header {
align-items: flex-start;
@@ -6102,6 +6141,10 @@ body.popup-mode .content-area {
gap: 4px;
animation: fadeSlideIn 0.3s ease forwards;
opacity: 0;
/* BUG-017: allow the card to shrink inside the grid instead of overflowing
the viewport because of long nowrap titles/paths. */
min-width: 0;
overflow: hidden;
}
.dashboard-card:hover {
@@ -6160,6 +6203,7 @@ body.popup-mode .content-area {
align-items: flex-start;
justify-content: space-between;
gap: 8px;
min-width: 0;
}
.dashboard-card-icon {
@@ -6253,6 +6297,7 @@ body.popup-mode .content-area {
margin-top: 4px;
padding-top: 6px;
border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
min-width: 0;
}
.dashboard-card-time {
@@ -9482,64 +9527,176 @@ body.bookslm-resizing { cursor: ew-resize; user-select: none; }
shortcuts and distraction-free reading mode.
══════════════════════════════════════════ */
/* ── Floating formatting toolbar (inside editor modal) ── */
/* ── Obsidian-style editing ribbon (ROADMAP #83) ── */
.me-toolbar {
display: none;
}
.me-btn {
.me-ribbon {
--kb-offset: 0px;
}
.me-ribbon-scroll {
display: flex;
align-items: center;
gap: 4px;
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
padding: 2px 2px;
min-width: 0;
flex: 1;
}
.me-ribbon-scroll::-webkit-scrollbar {
display: none;
}
.me-ribbon-btn {
flex: 0 0 auto;
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 40px;
height: 40px;
padding: 0 10px;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--bg-secondary);
min-width: 42px;
height: 42px;
padding: 0 8px;
border: 1px solid transparent;
border-radius: 10px;
background: transparent;
color: var(--text-primary);
font-size: 15px;
font-size: 14px;
font-weight: 600;
font-family: var(--font-mono);
cursor: pointer;
-webkit-tap-highlight-color: transparent;
transition: background 120ms ease, transform 120ms ease;
}
.me-btn:active {
transform: scale(0.94);
background: var(--bg-hover, rgba(128, 128, 128, 0.18));
.me-ribbon-btn:active {
transform: scale(0.92);
background: rgba(128, 128, 128, 0.22);
}
.me-btn-format {
font-family: var(--font-mono);
.me-ribbon-gear {
flex: 0 0 auto;
display: inline-flex;
align-items: center;
justify-content: center;
width: 42px;
height: 42px;
border: none;
border-left: 1px solid var(--border);
border-radius: 0;
background: transparent;
color: var(--text-muted);
font-size: 18px;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
}
.me-btn-paste {
margin-left: auto;
background: var(--accent);
color: #fff;
border-color: var(--accent);
.me-ribbon-gear:active {
color: var(--accent);
}
.me-sep {
width: 1px;
height: 26px;
background: var(--border);
flex-shrink: 0;
/* Ribbon customiser rows */
.me-ribbon-customizer-list {
max-height: 50vh;
overflow-y: auto;
}
.me-ribbon-cmd-row {
display: flex;
align-items: center;
gap: 6px;
padding: 8px 10px;
border-bottom: 1px solid var(--border);
}
.me-ribbon-cmd-row.disabled {
opacity: 0.75;
}
.me-ribbon-cmd-label {
flex: 1;
font-size: 0.85rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.me-ribbon-cmd-move,
.me-ribbon-cmd-remove,
.me-ribbon-cmd-add {
flex: 0 0 auto;
width: 34px;
height: 34px;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--bg-primary);
color: var(--text-primary);
font-size: 14px;
cursor: pointer;
}
.me-ribbon-cmd-move:disabled {
opacity: 0.35;
}
.me-ribbon-cmd-remove {
color: var(--danger);
}
.me-ribbon-cmd-divider {
padding: 10px;
font-size: 0.72rem;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--text-muted);
}
.me-ribbon-customizer-actions {
display: flex;
justify-content: flex-end;
gap: 8px;
padding: 10px;
border-top: 1px solid var(--border);
}
/* BUG-018: the in-editor AI toolbar was too dense on small screens. */
@media (max-width: 768px) {
.ai-toolbar {
gap: 4px !important;
padding: 6px 8px !important;
}
.ai-toolbar-btn {
min-height: 34px;
padding: 6px 10px !important;
font-size: 0.78rem !important;
}
}
@media (max-width: 768px) {
.editor-modal.active .me-toolbar {
.editor-modal.active .me-ribbon {
display: flex;
position: fixed;
left: 0;
right: 0;
bottom: 0;
left: 8px;
right: 8px;
/* BUG-019: sit just above the on-screen keyboard. */
bottom: calc(var(--kb-offset, 0px) + 8px + env(safe-area-inset-bottom, 0));
z-index: 30;
gap: 6px;
align-items: center;
padding: 8px 10px;
padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
background: var(--bg-primary);
border-top: 1px solid var(--border);
overflow-x: auto;
-webkit-overflow-scrolling: touch;
gap: 4px;
padding: 4px;
background: #1c1c1e;
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 14px;
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
.me-ribbon-btn {
color: #e8e8ea;
}
.me-ribbon-gear {
color: #b8b8bd;
}
[data-theme="light"] .me-ribbon {
background: #f1f1f4;
border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .me-ribbon-btn {
color: #1c1c1e;
}
[data-theme="light"] .me-ribbon-gear {
color: #5a5a60;
}
}