Skip to content

Commit

Permalink
fix #593
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Jul 31, 2024
1 parent b55a3f3 commit d40219e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 25 deletions.
3 changes: 3 additions & 0 deletions lib/ui/desktop/layout/home_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:maid/enumerators/large_language_model_type.dart';
import 'package:maid/classes/providers/app_data.dart';
import 'package:maid/ui/desktop/dropdowns/remote_model_dropdown.dart';
import 'package:maid/ui/shared/buttons/new_session_button.dart';
import 'package:maid/ui/shared/dropdowns/llm_platform_dropdown.dart';
import 'package:maid/ui/shared/groups/llama_cpp_model_controls.dart';
import 'package:provider/provider.dart';
Expand Down Expand Up @@ -39,6 +40,8 @@ class HomeAppBar extends StatelessWidget implements PreferredSizeWidget {
const RemoteModelDropdown(),
),
const Spacer(flex: 1),
const NewSessionButton(),
const SizedBox(width: 8.0),
IconButton(
tooltip: 'About',
icon: const Icon(Icons.info),
Expand Down
12 changes: 2 additions & 10 deletions lib/ui/desktop/side_panels/sessions_panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,8 @@ class SessionsPanel extends StatelessWidget {
Widget buildColumn() {
return const Column(
children: [
Wrap(
alignment: WrapAlignment.center,
spacing: 8.0,
runSpacing: 4.0,
children: [
ClearSessionsButton(),
NewSessionButton(),
],
),
Expanded(child: SessionsListView())
Expanded(child: SessionsListView()),
ClearSessionsButton()
]
);
}
Expand Down
5 changes: 5 additions & 0 deletions lib/ui/mobile/layout/home_app_bar.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:maid/ui/mobile/buttons/menu_button.dart';
import 'package:maid/ui/shared/buttons/new_session_button.dart';
import 'package:maid/ui/shared/dropdowns/llm_platform_dropdown.dart';

class HomeAppBar extends StatelessWidget implements PreferredSizeWidget {
Expand All @@ -15,6 +16,10 @@ class HomeAppBar extends StatelessWidget implements PreferredSizeWidget {
title: const LlmPlatformDropdown(),
centerTitle: false,
actions: const [
Padding(
padding: EdgeInsets.only(right: 8.0),
child: NewSessionButton(),
),
Padding(
padding: EdgeInsets.only(right: 8.0),
child: MenuButton(),
Expand Down
11 changes: 1 addition & 10 deletions lib/ui/mobile/layout/home_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,10 @@ class HomeDrawer extends StatelessWidget {
Divider(
color: Theme.of(context).colorScheme.primary,
),
const Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
ClearSessionsButton(),
NewSessionButton(),
]
),
Divider(
color: Theme.of(context).colorScheme.primary,
),
const Expanded(
child: SessionsListView()
),
const ClearSessionsButton(),
Divider(
height: 0.0,
color: Theme.of(context).colorScheme.primary,
Expand Down
12 changes: 7 additions & 5 deletions lib/ui/shared/buttons/new_session_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ class NewSessionButton extends StatelessWidget {

@override
Widget build(BuildContext context) {
return FilledButton(
onPressed: AppData.of(context).newSession,
child: const Text(
"New Chat"
),
return IconButton(
tooltip: "New Session",
onPressed: AppData.of(context).newSession,
icon: const Icon(
Icons.border_color_rounded,
size: 24,
)
);
}
}

0 comments on commit d40219e

Please sign in to comment.