Skip to content

Suggestions overlapping with welcome message #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
luis901101 opened this issue Mar 28, 2025 · 12 comments
Closed

Suggestions overlapping with welcome message #74

luis901101 opened this issue Mar 28, 2025 · 12 comments

Comments

@luis901101
Copy link
Contributor

For a new chat with a welcome message, no history and a list of suggestions, the suggestions list overlaps the welcome message when the input field has focus.

Reproducible code using v0.6.8

 @override
  Widget build(BuildContext context) => Scaffold(
        appBar: AppBar(title: const Text(App.title)),
        body: LlmChatView(
          welcomeMessage:
              'Hello! This is the Flutter AI Assistant, how can I help you today?',
          suggestions: List.generate(
            5,
            (index) => 'This is a suggestion sample ${index + 1}',
          ),
          provider: GeminiProvider(
            model: GenerativeModel(
                model: 'gemini-2.0-flash', apiKey: geminiApiKey),
          ),
        ),
      );

Depending on the number of suggestions and the welcome message, this may become more noticeable. In any case, I believe that if the LlmChatView has suggestions, the input field should not automatically receive focus. However, if the user manually taps on the input field, the suggestions should be hidden.

Additionally, making the suggestions scrollable could be useful.

@csells csells self-assigned this Mar 29, 2025
@csells
Copy link
Contributor

csells commented Mar 29, 2025

good idea, @luis901101 . care to take a crack at a PR?

@luis901101
Copy link
Contributor Author

good idea, @luis901101 . care to take a crack at a PR?

I think I can give it a try next week.

@luis901101
Copy link
Contributor Author

By the way here is a screen record supporting the issue's description:

Screen.Recording.2025-03-28.at.22.00.42.mov

@luis901101
Copy link
Contributor Author

hi @csells I already made #79 can you review it?

@csells
Copy link
Contributor

csells commented Apr 4, 2025

@luis901101 I think you and I should agree on a design and the behavior we're looking for ahead of the code to produce that behavior. Right now, this PR has the following behavior:

  1. make the suggestions disappear if I click in the text field on mobile, but not on web or desktop
  2. if there are enough suggestions that you have to scroll to see them, the welcome message is hidden

I don't actually think that either of these behaviors is what we want.

@luis901101
Copy link
Contributor Author

Hi @csells

  1. Right, in any case without a soft keyboard showing up the suggestions remains visible this should be the case of desktop and even mobile using hard keyboard, I can change it to hide suggestions depending on the focus of the input.
  2. Maybe the suggestions could limit scrolling height taking into account the welcome message height... but this could be tricky because with a long welcome message and a lot of suggestions the probability of overlapping is high.

Anyways, just let me know the expected behavior for each case and I can give it a try.

@csells
Copy link
Contributor

csells commented Apr 4, 2025

I guess the ideal UI would be that the suggestions are in the listview along with the messages and the welcome message. that way, things scroll and get out of the way automatically.

@luis901101
Copy link
Contributor Author

Ok, but the suggestions are only meant to help start a conversation, right? I mean, once the user sends the first message whether it's from a suggestion or something they typed, the suggestions should disappear?

@csells
Copy link
Contributor

csells commented Apr 5, 2025

once the user sends the first message whether it's from a suggestion or something they typed, the suggestions should disappear?

right

@luis901101
Copy link
Contributor Author

All clear, I will get back to my PR next week.

@csells
Copy link
Contributor

csells commented Apr 5, 2025

Have a good weekend!

@csells csells mentioned this issue Apr 7, 2025
8 tasks
@csells
Copy link
Contributor

csells commented Apr 8, 2025

fixed with 0.7.1: https://pub.dev/packages/flutter_ai_toolkit

@csells csells closed this as completed Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants