feat(editor): sheet landings, history and e2e for the finding layers
« Tout afficher » clears the search and keeps the sort. A landing waits for the dialogs a move closed and for their focus restore. Helpers and shell specs move to the dialog and sheet flow; new finding dialog spec (entries, guards, flip, gone rule, Back and Forward over the layers).
This commit is contained in:
1 parent
18085cecf8
commit
4731a3376a
21 files changed
+782
-474
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { createContext, useContext, useEffect, useRef } from 'react'
|
||||
import type { ElementKey } from '@faunosteo/core-wasm/types'
|
||||
import { afterModalsClosed } from '@/components/ui/afterModalsClosed'
|
||||
import { landAfterModalsClosed } from '@/components/ui/afterModalsClosed'
|
||||
import type {
|
||||
AnnotationSection,
|
||||
EditorTarget,
|
||||
@@ -107,7 +107,7 @@ export function focusRow(key: ElementKey): boolean {
|
||||
*/
|
||||
export function focusRowLater(key: ElementKey): boolean {
|
||||
if (!rowOf(key)) return false
|
||||
afterModalsClosed(() => void focusRow(key))
|
||||
landAfterModalsClosed(() => void focusRow(key))
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { useLocation, useNavigate, useNavigationType } from 'react-router-dom'
|
||||
import { afterModalsClosed } from '@/components/ui/afterModalsClosed'
|
||||
import { landAfterModalsClosed } from '@/components/ui/afterModalsClosed'
|
||||
import { focusActiveTab } from '../focusRequest'
|
||||
import { sameView, type EditorView } from '../navigation'
|
||||
import {
|
||||
@@ -248,7 +248,7 @@ function useLanding(
|
||||
if (!landing || landed.current === landing) return
|
||||
landed.current = landing
|
||||
const { id, view } = landing.entry
|
||||
return afterModalsClosed(() => {
|
||||
return landAfterModalsClosed(() => {
|
||||
window.scrollTo(0, book.scrolls.get(id) ?? 0)
|
||||
landFocus(landing)
|
||||
if (landing.layerChanged && !landing.tabChanged) return
|
||||
|
||||
@@ -9,7 +9,10 @@ import {
|
||||
type RefObject,
|
||||
} from 'react'
|
||||
import type { ElementKey } from '@faunosteo/core-wasm/types'
|
||||
import { afterModalsClosed } from '@/components/ui/afterModalsClosed'
|
||||
import {
|
||||
afterModalsClosed,
|
||||
landAfterModalsClosed,
|
||||
} from '@/components/ui/afterModalsClosed'
|
||||
import { useT } from '@/i18n/useT'
|
||||
import {
|
||||
commitFocusedField,
|
||||
@@ -393,7 +396,7 @@ function useMoveFocus(
|
||||
if (outcome === 'found' || outcome === 'kept') return
|
||||
dispatch({ type: 'focus_consumed', serial })
|
||||
}
|
||||
afterModalsClosed(() => {
|
||||
landAfterModalsClosed(() => {
|
||||
if (move.kind === 'back') backTarget(openers.section.current)?.focus()
|
||||
else landingOf(move, state)?.focus()
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user