feat: refine AI navigation and accessibility recovery

This commit is contained in:
2026-08-26 22:58:26 +08:00
parent c6f98b5445
commit 9ccbdfead4
15 changed files with 521 additions and 203 deletions
@@ -25,14 +25,6 @@ class _MainShellState extends State<MainShell> {
return AnimatedBuilder(
animation: SessionStore.instance,
builder: (context, _) {
final session = SessionStore.instance;
final aiEnabled = session.aiEnabled;
final showAiEntry = session.isGuest || aiEnabled;
if (!showAiEntry && widget.shell.currentIndex == 2) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted) widget.shell.goBranch(0);
});
}
return Scaffold(
body: AnimatedSwitcher(
duration: const Duration(milliseconds: 200),
@@ -58,12 +50,11 @@ class _MainShellState extends State<MainShell> {
_tab('明细', AppIcons.home, 0),
_tab('统计', AppIcons.chart, 1),
SizedBox(width: 72, child: _fab()),
if (showAiEntry)
ValueListenableBuilder<CompanionDisplay>(
valueListenable: PublicConfigApi.companionNotifier,
builder: (_, companion, __) =>
_tab(companion.name, AppIcons.chat, 2),
),
ValueListenableBuilder<CompanionDisplay>(
valueListenable: PublicConfigApi.companionNotifier,
builder: (_, companion, __) =>
_tab(companion.name, AppIcons.chat, 2),
),
_tab('我的', AppIcons.user, 3),
],
),