feat(chat): Add keys to composer widgets for improved testing
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,
|
||||||
|
|||||||
Reference in New Issue
Block a user