Merge pull request #188 from cogwheel0/improve-user-data-handling
improve-user-data-handling
This commit is contained in:
@@ -338,9 +338,6 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
|||||||
// Strip leading '/' prefix so we can match prompt commands (e.g., "help")
|
// Strip leading '/' prefix so we can match prompt commands (e.g., "help")
|
||||||
final String searchQuery = query.startsWith('/') ? query.substring(1) : query;
|
final String searchQuery = query.startsWith('/') ? query.substring(1) : query;
|
||||||
|
|
||||||
// Prevent matching all prompts when user types only '/'
|
|
||||||
if (searchQuery.isEmpty) return const <Prompt>[];
|
|
||||||
|
|
||||||
final List<Prompt> filtered =
|
final List<Prompt> filtered =
|
||||||
prompts
|
prompts
|
||||||
.where(
|
.where(
|
||||||
@@ -976,6 +973,7 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
|||||||
final List<Widget> composerChildren = <Widget>[
|
final List<Widget> composerChildren = <Widget>[
|
||||||
if (_showPromptOverlay)
|
if (_showPromptOverlay)
|
||||||
Padding(
|
Padding(
|
||||||
|
key: const ValueKey('prompt-overlay'),
|
||||||
padding: const EdgeInsets.fromLTRB(
|
padding: const EdgeInsets.fromLTRB(
|
||||||
Spacing.sm,
|
Spacing.sm,
|
||||||
0,
|
0,
|
||||||
@@ -986,6 +984,7 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
|||||||
),
|
),
|
||||||
if (showCompactComposer)
|
if (showCompactComposer)
|
||||||
Padding(
|
Padding(
|
||||||
|
key: const ValueKey('composer-compact'),
|
||||||
padding: const EdgeInsets.fromLTRB(
|
padding: const EdgeInsets.fromLTRB(
|
||||||
Spacing.screenPadding,
|
Spacing.screenPadding,
|
||||||
Spacing.xs,
|
Spacing.xs,
|
||||||
@@ -1059,6 +1058,7 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
|||||||
)
|
)
|
||||||
else ...[
|
else ...[
|
||||||
Padding(
|
Padding(
|
||||||
|
key: const ValueKey('composer-expanded-input'),
|
||||||
padding: const EdgeInsets.fromLTRB(
|
padding: const EdgeInsets.fromLTRB(
|
||||||
Spacing.sm,
|
Spacing.sm,
|
||||||
Spacing.xs,
|
Spacing.xs,
|
||||||
@@ -1097,6 +1097,7 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
|
key: const ValueKey('composer-expanded-buttons'),
|
||||||
padding: const EdgeInsets.fromLTRB(
|
padding: const EdgeInsets.fromLTRB(
|
||||||
Spacing.inputPadding,
|
Spacing.inputPadding,
|
||||||
0,
|
0,
|
||||||
|
|||||||
@@ -1478,7 +1478,12 @@ class _ChatsDrawerState extends ConsumerState<ChatsDrawer> {
|
|||||||
Widget _buildBottomSection(BuildContext context) {
|
Widget _buildBottomSection(BuildContext context) {
|
||||||
final theme = context.conduitTheme;
|
final theme = context.conduitTheme;
|
||||||
final sidebarTheme = context.sidebarTheme;
|
final sidebarTheme = context.sidebarTheme;
|
||||||
final user = ref.watch(currentUserProvider2);
|
final authUser = ref.watch(currentUserProvider2);
|
||||||
|
final asyncUser = ref.watch(currentUserProvider);
|
||||||
|
final user = asyncUser.maybeWhen(
|
||||||
|
data: (value) => value ?? authUser,
|
||||||
|
orElse: () => authUser,
|
||||||
|
);
|
||||||
final api = ref.watch(apiServiceProvider);
|
final api = ref.watch(apiServiceProvider);
|
||||||
|
|
||||||
String initialFor(String name) {
|
String initialFor(String name) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:flutter_animate/flutter_animate.dart';
|
|||||||
import 'package:conduit/l10n/app_localizations.dart';
|
import 'package:conduit/l10n/app_localizations.dart';
|
||||||
|
|
||||||
import '../../auth/providers/unified_auth_providers.dart';
|
import '../../auth/providers/unified_auth_providers.dart';
|
||||||
|
import '../../../core/providers/app_providers.dart';
|
||||||
import '../../../core/utils/user_display_name.dart';
|
import '../../../core/utils/user_display_name.dart';
|
||||||
import '../../../shared/theme/theme_extensions.dart';
|
import '../../../shared/theme/theme_extensions.dart';
|
||||||
import '../../../shared/widgets/sheet_handle.dart';
|
import '../../../shared/widgets/sheet_handle.dart';
|
||||||
@@ -67,7 +68,12 @@ class _OnboardingSheetState extends ConsumerState<OnboardingSheet> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final height = MediaQuery.of(context).size.height;
|
final height = MediaQuery.of(context).size.height;
|
||||||
final l10n = AppLocalizations.of(context)!;
|
final l10n = AppLocalizations.of(context)!;
|
||||||
final user = ref.watch(currentUserProvider2);
|
final authUser = ref.watch(currentUserProvider2);
|
||||||
|
final asyncUser = ref.watch(currentUserProvider);
|
||||||
|
final user = asyncUser.maybeWhen(
|
||||||
|
data: (value) => value ?? authUser,
|
||||||
|
orElse: () => authUser,
|
||||||
|
);
|
||||||
final greetingName = deriveUserDisplayName(user);
|
final greetingName = deriveUserDisplayName(user);
|
||||||
final pages = _buildPages(l10n, greetingName);
|
final pages = _buildPages(l10n, greetingName);
|
||||||
final pageCount = pages.length;
|
final pageCount = pages.length;
|
||||||
|
|||||||
@@ -41,7 +41,12 @@ class ProfilePage extends ConsumerWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final user = ref.watch(currentUserProvider2);
|
final authUser = ref.watch(currentUserProvider2);
|
||||||
|
final asyncUser = ref.watch(currentUserProvider);
|
||||||
|
final user = asyncUser.maybeWhen(
|
||||||
|
data: (value) => value ?? authUser,
|
||||||
|
orElse: () => authUser,
|
||||||
|
);
|
||||||
final isAuthLoading = ref.watch(isAuthLoadingProvider2);
|
final isAuthLoading = ref.watch(isAuthLoadingProvider2);
|
||||||
final api = ref.watch(apiServiceProvider);
|
final api = ref.watch(apiServiceProvider);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user