From 0a889ebfed8d952fc23dc26e44b390e1401258a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Kooijmans?= Date: Fri, 9 Oct 2026 16:41:21 +0200 Subject: [PATCH] feat(features): auth, accounts, home, repositories, issues, notifications - auth: welcome/connect screens, shared connect form, connect flow, app lock - accounts: session hook, actions, switcher + add-account screens - home: dashboard (identity, shortcuts, recent repos, assigned issues, review requests, activity, unread badge) - repositories/repository: list+search, overview, files, file viewer, commits, commit detail, branches, tags, repo issues/pulls, issue/pull detail - issues/notifications: cross-repo search, query hooks, inbox with read marking and lifecycle-aware polling - settings: theme/language/biometrics/poll interval/cache/about --- .../accounts/screens/accounts-screen.tsx | 176 ++++++++ .../accounts/screens/add-account-screen.tsx | 24 + src/features/accounts/use-account-actions.ts | 55 +++ src/features/accounts/use-session.ts | 46 ++ src/features/auth/app-lock.tsx | 164 +++++++ src/features/auth/components/connect-form.tsx | 194 ++++++++ src/features/auth/connect.test.ts | 146 +++++++ src/features/auth/connect.ts | 115 +++++ src/features/auth/screens/connect-screen.tsx | 18 + src/features/auth/screens/welcome-screen.tsx | 120 +++++ src/features/auth/use-connect-account.ts | 30 ++ src/features/home/queries.ts | 38 ++ src/features/home/screens/home-screen.tsx | 413 ++++++++++++++++++ src/features/inbox/screens/inbox-screen.tsx | 106 +++++ src/features/issues/queries.ts | 181 ++++++++ src/features/issues/screens/issues-screen.tsx | 93 ++++ src/features/issues/target.test.ts | 55 +++ src/features/issues/target.ts | 34 ++ src/features/notifications/queries.ts | 82 ++++ .../pulls/screens/pull-requests-screen.tsx | 96 ++++ src/features/repositories/queries.ts | 109 +++++ .../screens/repository-list-screen.tsx | 133 ++++++ src/features/repository/queries.ts | 170 +++++++ .../repository/screens/branches-screen.tsx | 69 +++ .../screens/commit-detail-screen.tsx | 187 ++++++++ .../repository/screens/commits-screen.tsx | 53 +++ .../repository/screens/file-viewer-screen.tsx | 158 +++++++ .../repository/screens/files-screen.tsx | 103 +++++ .../screens/issue-detail-screen.tsx | 132 ++++++ .../repository/screens/pull-detail-screen.tsx | 138 ++++++ .../repository/screens/repo-issues-screen.tsx | 70 +++ .../screens/repo-overview-screen.tsx | 302 +++++++++++++ .../repository/screens/repo-pulls-screen.tsx | 61 +++ .../repository/screens/tags-screen.tsx | 40 ++ .../settings/screens/settings-screen.tsx | 223 ++++++++++ src/features/settings/settings-store.ts | 52 +++ 36 files changed, 4186 insertions(+) create mode 100644 src/features/accounts/screens/accounts-screen.tsx create mode 100644 src/features/accounts/screens/add-account-screen.tsx create mode 100644 src/features/accounts/use-account-actions.ts create mode 100644 src/features/accounts/use-session.ts create mode 100644 src/features/auth/app-lock.tsx create mode 100644 src/features/auth/components/connect-form.tsx create mode 100644 src/features/auth/connect.test.ts create mode 100644 src/features/auth/connect.ts create mode 100644 src/features/auth/screens/connect-screen.tsx create mode 100644 src/features/auth/screens/welcome-screen.tsx create mode 100644 src/features/auth/use-connect-account.ts create mode 100644 src/features/home/queries.ts create mode 100644 src/features/home/screens/home-screen.tsx create mode 100644 src/features/inbox/screens/inbox-screen.tsx create mode 100644 src/features/issues/queries.ts create mode 100644 src/features/issues/screens/issues-screen.tsx create mode 100644 src/features/issues/target.test.ts create mode 100644 src/features/issues/target.ts create mode 100644 src/features/notifications/queries.ts create mode 100644 src/features/pulls/screens/pull-requests-screen.tsx create mode 100644 src/features/repositories/queries.ts create mode 100644 src/features/repositories/screens/repository-list-screen.tsx create mode 100644 src/features/repository/queries.ts create mode 100644 src/features/repository/screens/branches-screen.tsx create mode 100644 src/features/repository/screens/commit-detail-screen.tsx create mode 100644 src/features/repository/screens/commits-screen.tsx create mode 100644 src/features/repository/screens/file-viewer-screen.tsx create mode 100644 src/features/repository/screens/files-screen.tsx create mode 100644 src/features/repository/screens/issue-detail-screen.tsx create mode 100644 src/features/repository/screens/pull-detail-screen.tsx create mode 100644 src/features/repository/screens/repo-issues-screen.tsx create mode 100644 src/features/repository/screens/repo-overview-screen.tsx create mode 100644 src/features/repository/screens/repo-pulls-screen.tsx create mode 100644 src/features/repository/screens/tags-screen.tsx create mode 100644 src/features/settings/screens/settings-screen.tsx create mode 100644 src/features/settings/settings-store.ts diff --git a/src/features/accounts/screens/accounts-screen.tsx b/src/features/accounts/screens/accounts-screen.tsx new file mode 100644 index 0000000..16cf906 --- /dev/null +++ b/src/features/accounts/screens/accounts-screen.tsx @@ -0,0 +1,176 @@ +import { Alert, StyleSheet, View } from 'react-native'; +import { useTranslation } from 'react-i18next'; +import { useNavigation } from '@react-navigation/native'; +import type { NativeStackNavigationProp } from '@react-navigation/native-stack'; + +import { Screen } from '@/components/layout/screen'; +import { AppText } from '@/components/ui/app-text'; +import { Avatar } from '@/components/ui/avatar'; +import { Badge } from '@/components/ui/badge'; +import { Button } from '@/components/ui/button'; +import { Card } from '@/components/ui/card'; +import { IconButton } from '@/components/ui/icon-button'; +import { ListItem } from '@/components/ui/list-item'; +import { EmptyState } from '@/components/ui/state-views'; +import type { AccountRecord, InstanceRecord } from '@/core/accounts/types'; +import { useAccountsStore } from '@/core/accounts/accounts-store'; +import { useAccountActions } from '@/features/accounts/use-account-actions'; +import { spacing } from '@/theme/tokens'; +import type { AccountsStackParamList } from '@/navigation/types'; +import type { ScreenProps } from '@/navigation/typing'; + +type Props = ScreenProps; + +/** Manage instances and accounts: switch, add and remove. */ +export function AccountsScreen(_props: Props) { + const navigation = useNavigation>(); + const { t } = useTranslation(); + const instances = useAccountsStore((s) => s.instances); + const accounts = useAccountsStore((s) => s.accounts); + const activeAccountId = useAccountsStore((s) => s.activeAccountId); + const tokens = useAccountsStore((s) => s.tokens); + const { removeAccount, removeInstance, switchAccount } = useAccountActions(); + + const confirmRemoveAccount = (account: AccountRecord) => { + Alert.alert( + t('accounts.removeAccountTitle'), + t('accounts.removeAccountBody', { name: account.login }), + [ + { text: t('common.cancel'), style: 'cancel' }, + { + text: t('common.remove'), + style: 'destructive', + onPress: () => { + void removeAccount(account.id).then(() => Alert.alert(t('accounts.removeDone'))); + }, + }, + ], + ); + }; + + const confirmRemoveInstance = (instance: InstanceRecord) => { + Alert.alert( + t('accounts.removeInstanceTitle'), + t('accounts.removeInstanceBody', { instance: instance.label }), + [ + { text: t('common.cancel'), style: 'cancel' }, + { + text: t('common.disconnect'), + style: 'destructive', + onPress: () => { + void removeInstance(instance.id).then(() => Alert.alert(t('accounts.disconnectDone'))); + }, + }, + ], + ); + }; + + if (instances.length === 0) { + return ( + + navigation.navigate('AddAccount')} + /> + + ); + } + + return ( + +