feat(mobile): the assistant is an entry of the dock, sorted like the pages

The home assistant sat behind the More button on every page outside a
trip, so a dock with free slots showed "..." for a single entry. It is now
an entry of the dock list while its addon is on and it can run for the
user: an account that never sorted its dock gets it in a slot the addons
leave free, and Settings > Appearance > Mobile can move it between the bar
and More like any page.
This commit is contained in:
Maurice
2026-11-13 08:27:31 +01:00
parent fdb2095ced
commit ccfa92f650
5 changed files with 145 additions and 40 deletions
@@ -1,4 +1,4 @@
import { useNavItems, splitMobileNav, MOBILE_NAV_MAX_BAR, type NavItemDef } from '../Layout/navItems'
import { useDockNavItems, splitMobileNav, MOBILE_NAV_MAX_BAR, type NavItemDef } from '../Layout/navItems'
export interface MobileNavValue {
bar: string[]
@@ -36,7 +36,7 @@ export function useMobileNavEditor(
value: MobileNavValue,
onChange: (next: MobileNavValue) => void,
): MobileNavEditor {
const items = useNavItems()
const items = useDockNavItems()
const split = splitMobileNav(items, value)
const dashboard = split.bar.find((i) => i.id === 'dashboard')
const barItems = split.bar.filter((i) => i.id !== 'dashboard')