Skip to content

Commit cbca913

Browse files
ehsan6shaclaude
andcommitted
apps/box: replace Loyal Agent tab with top-level Blox AI tab
The bottom-tab "Loyal Agent" pointed at ChatAIScreen — a freeform chat surface that posted to the container's chat endpoint with a hardcoded 'deepseek-chat' model name (cosmetic only since the container now runs Qwen) and short-circuited iOS users with "iOS is not currently supported." Meanwhile the new structured Blox AI flow (the marquee feature: verdict + tool-call + approve) was buried under Settings then Diagnostics, hidden from anyone who didn't know to look there. Promote Diagnostics to a top-level tab and retire the freeform-chat surface entirely: - navigationConfig.ts: - Add Routes.DiagnosticsTab = 'DiagnosticsTab' (follows *Tab convention for top-level tabs). - Remove Routes.ChatAI, Routes.ChatAITab, Routes.Diagnostics (the SettingsStack child route, now unreachable since the tab is the only entry). - Add to MainTabsParamList, remove from RootStackParamList and SettingsStackParamList. - MainTabs.navigator.tsx: - Replace the ChatAITab tab block with DiagnosticsTab pointing at DiagnosticsScreen, label "Blox AI", icon FxSearchIcon (magnifying glass — best fit for "diagnose / investigate" in the existing palette). - Drop the ChatAIScreen import and FxScanCodeIcon import. - Remove the now-redundant SettingsStack.Screen for Diagnostics. - Diagnostics.test.tsx: - Update the route-registered assertion from Routes.Diagnostics (== 'Diagnostics') to Routes.DiagnosticsTab (== 'DiagnosticsTab'). - Delete ChatAI.screen.tsx (434 lines, fully obsolete). What this does NOT remove: - The container's chat endpoint stays (kept per the plan as backward-compat for any future freeform-chat surface). If we ever re-add freeform chat, it should be cross-platform (the deleted ChatAIScreen was Android-only) and not hardcode an old model name. Test posture: - 23 Diagnostics jest tests pass (including the updated route-id check). - A pre-existing ApprovalModal.test.tsx module-resolve failure for @functionland/component-library is unrelated (jest moduleNameMapper infra issue; predates this work; ApprovalModal not touched here). - Pre-existing tsc jest-typedef errors in components.test.tsx also predate this work; not affected by these edits. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 6eab6d3 commit cbca913

4 files changed

Lines changed: 14 additions & 453 deletions

File tree

apps/box/src/navigation/MainTabs.navigator.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import {
44
FxBottomSheetModalMethods,
55
FxArrowUpIcon,
66
useFxTheme,
7-
FxScanCodeIcon,
7+
FxSearchIcon,
88
} from '@functionland/component-library';
99
import { createNativeStackNavigator } from '@react-navigation/native-stack';
1010
import { BloxScreen } from '../screens/Blox/Blox.screen';
1111
import { PluginScreen } from '../screens/Plugin.screen';
1212
import { DevicesScreen } from '../screens/Devices.screen';
1313
import { UsersScreen } from '../screens/Users/Users.screen';
14-
import ChatAIScreen from '../screens/ChatAI.screen';
1514
import {
1615
BloxIcon,
1716
UserIcon,
@@ -268,12 +267,12 @@ export const MainTabsNavigator = () => {
268267
})}
269268
/>
270269
<MainTabs.Screen
271-
name={Routes.ChatAITab}
272-
component={ChatAIScreen}
270+
name={Routes.DiagnosticsTab}
271+
component={DiagnosticsScreen}
273272
options={{
274273
// eslint-disable-next-line react/no-unstable-nested-components
275-
tabBarIcon: ({ color }) => <FxScanCodeIcon fill={color} />,
276-
tabBarLabel: 'Loyal Agent',
274+
tabBarIcon: ({ color }) => <FxSearchIcon fill={color} />,
275+
tabBarLabel: 'Blox AI',
277276
}}
278277
/>
279278
<MainTabs.Screen
@@ -349,10 +348,6 @@ const SettingsNavigator = () => {
349348
name={Routes.AutoPinPairing}
350349
component={AutoPinPairingScreen}
351350
/>
352-
<SettingsStack.Screen
353-
name={Routes.Diagnostics}
354-
component={DiagnosticsScreen}
355-
/>
356351

357352
<SettingsStack.Screen
358353
options={() => ({

apps/box/src/navigation/navigationConfig.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export enum Routes {
1111
MainTabs = 'MainTabs',
1212
Hub = 'Hub',
1313
Plugin = 'Plugin',
14-
ChatAI = 'ChatAI',
1514

1615
// Initial Setup
1716
Welcome = 'Welcome',
@@ -31,7 +30,7 @@ export enum Routes {
3130
PluginTab = 'PluginTab',
3231
DevicesTab = 'DevicesTab',
3332
SettingsTab = 'SettingsTab',
34-
ChatAITab = 'ChatAITab',
33+
DiagnosticsTab = 'DiagnosticsTab',
3534

3635
// Blox Manager
3736
BloxManager = 'BloxManager',
@@ -50,7 +49,6 @@ export enum Routes {
5049
BloxLogs = 'BloxLogs',
5150
BluetoothCommands = 'BluetoothCommands',
5251
AutoPinPairing = 'AutoPinPairing',
53-
Diagnostics = 'Diagnostics',
5452

5553
// Component Gallery
5654
Avatars = 'Avatars',
@@ -72,7 +70,6 @@ export type RootStackParamList = {
7270
[Routes.MainTabs]: NavigatorScreenParams<MainTabsParamList>;
7371
[Routes.Hub]: undefined;
7472
[Routes.Plugin]: undefined;
75-
[Routes.ChatAI]: undefined;
7673
[Routes.BloxManager]: undefined;
7774
};
7875

@@ -84,7 +81,7 @@ export type MainTabsParamList = {
8481
[Routes.DevicesTab]: undefined;
8582
[Routes.SettingsTab]: NavigatorScreenParams<SettingsStackParamList>;
8683
[Routes.InitialSetup]: undefined;
87-
[Routes.ChatAITab]: undefined;
84+
[Routes.DiagnosticsTab]: undefined;
8885
};
8986

9087
export type SettingsStackParamList = {
@@ -110,7 +107,6 @@ export type SettingsStackParamList = {
110107
endpoint?: string;
111108
returnUrl?: string;
112109
};
113-
[Routes.Diagnostics]: undefined;
114110
[Routes.ComponentGallery]: NavigatorScreenParams<ComponentGalleryStackParamList>;
115111
};
116112

0 commit comments

Comments
 (0)