-
Notifications
You must be signed in to change notification settings - Fork 363
AI assistant pane is displayed for supported screens when the AI assistant feature flag is enabled #9591
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
Merged
Merged
AI assistant pane is displayed for supported screens when the AI assistant feature flag is enabled #9591
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
def20a1
AI assistant tab is conditionally displayed
elliette 3746517
Clean up
elliette 27c9fce
Small improvements
elliette ff06d2c
Add test
elliette ccbc4d6
Fix static analysis errors
elliette 3d0686f
Merge branch 'master' into ai-assists-feature-flag
elliette a31b696
Clean up
elliette ed6df03
Hopefully fix tests
elliette 0a8a39a
Fix debugger test
elliette 04366c6
Test for AI assistant feature flag
elliette File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
packages/devtools_app/lib/src/framework/scaffold/bottom_pane.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| // Copyright 2025 The Flutter Authors | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd. | ||
|
|
||
| import 'package:flutter/material.dart'; | ||
|
|
||
| import '../../shared/ui/tab.dart'; | ||
|
|
||
| /// A widget that displays a tabbed view at the bottom of the DevTools screen. | ||
| /// | ||
| /// This widget is used to host views like the console and the AI Assistant. | ||
| class BottomPane extends StatelessWidget { | ||
| const BottomPane({super.key, required this.screenId, required this.tabs}) | ||
| : assert(tabs.length > 0); | ||
|
|
||
| static const splitterKey = Key('Bottom Pane Splitter'); | ||
|
|
||
| final String screenId; | ||
| final List<TabbedPane> tabs; | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return AnalyticsTabbedView( | ||
| gaScreen: screenId, | ||
| tabs: tabs | ||
| .map((tabbedPane) => (tab: tabbedPane.tab, tabView: tabbedPane)) | ||
| .toList(), | ||
| staticSingleTab: true, | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| /// An interface for a widget that should be displayed as a tab in the | ||
| /// [BottomPane]. | ||
| abstract class TabbedPane implements Widget { | ||
| /// The tab to display for this pane. | ||
| DevToolsTab get tab; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/devtools_app/lib/src/shared/ai_assistant/widgets/ai_assistant_pane.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // Copyright 2025 The Flutter Authors | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd. | ||
|
|
||
| import 'package:flutter/material.dart'; | ||
|
|
||
| import '../../../framework/scaffold/bottom_pane.dart'; | ||
| import '../../ui/tab.dart'; | ||
|
|
||
| class AiAssistantPane extends StatelessWidget implements TabbedPane { | ||
| const AiAssistantPane({super.key}); | ||
|
|
||
| @override | ||
| DevToolsTab get tab => | ||
| DevToolsTab.create(tabName: _tabName, gaPrefix: _gaPrefix); | ||
|
|
||
| static const _tabName = 'AI Assistant'; | ||
|
|
||
| static const _gaPrefix = 'aiAssistant'; | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return const Column( | ||
| children: [ | ||
| Expanded(child: Center(child: Text('TODO: Implement AI Assistant.'))), | ||
| ], | ||
| ); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this name been vetted by... someone? Not sure who 😅 . But I feel like Product or UX might want to sign off on a branding here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's behind an experiment flag it can easily be changed (this will not be visible to users until we enable the flag).