-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: ai type * chore: use patch to fix version issue * chore: update * chore: update * chore: integrate client api * chore: add schema * chore: setup event * chore: add event test * chore: add test * chore: update test * chore: load chat message * chore: load chat message * chore: chat ui * chore: disable create chat * chore: update client api * chore: disable chat * chore: ui theme * chore: ui theme * chore: copy message * chore: fix test * chore: show error * chore: update bloc * chore: update test * chore: lint * chore: icon * chore: hover * chore: show unsupported page * chore: adjust mobile ui * chore: adjust view title bar * chore: return related question * chore: error page * chore: error page * chore: code format * chore: prompt * chore: fix test * chore: ui adjust * chore: disable create chat * chore: add loading page * chore: fix test * chore: disable chat action * chore: add maximum text limit
- Loading branch information
Showing
114 changed files
with
5,473 additions
and
282 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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
28 changes: 28 additions & 0 deletions
28
frontend/appflowy_flutter/lib/mobile/presentation/chat/mobile_chat_screen.dart
This file contains 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,28 @@ | ||
import 'package:appflowy/mobile/presentation/base/mobile_view_page.dart'; | ||
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class MobileChatScreen extends StatelessWidget { | ||
const MobileChatScreen({ | ||
super.key, | ||
required this.id, | ||
this.title, | ||
}); | ||
|
||
/// view id | ||
final String id; | ||
final String? title; | ||
|
||
static const routeName = '/chat'; | ||
static const viewId = 'id'; | ||
static const viewTitle = 'title'; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return MobileViewPage( | ||
id: id, | ||
title: title, | ||
viewLayout: ViewLayoutPB.Chat, | ||
); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
frontend/appflowy_flutter/lib/plugins/ai_chat/application/chat_ai_message_bloc.dart
This file contains 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,42 @@ | ||
import 'package:appflowy_backend/protobuf/flowy-document/protobuf.dart'; | ||
import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:flutter_chat_types/flutter_chat_types.dart'; | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
part 'chat_ai_message_bloc.freezed.dart'; | ||
|
||
class ChatAIMessageBloc extends Bloc<ChatAIMessageEvent, ChatAIMessageState> { | ||
ChatAIMessageBloc({ | ||
required Message message, | ||
}) : super(ChatAIMessageState.initial(message)) { | ||
on<ChatAIMessageEvent>( | ||
(event, emit) async { | ||
await event.when( | ||
initial: () async {}, | ||
update: (userProfile, deviceId, states) {}, | ||
); | ||
}, | ||
); | ||
} | ||
} | ||
|
||
@freezed | ||
class ChatAIMessageEvent with _$ChatAIMessageEvent { | ||
const factory ChatAIMessageEvent.initial() = Initial; | ||
const factory ChatAIMessageEvent.update( | ||
UserProfilePB userProfile, | ||
String deviceId, | ||
DocumentAwarenessStatesPB states, | ||
) = Update; | ||
} | ||
|
||
@freezed | ||
class ChatAIMessageState with _$ChatAIMessageState { | ||
const factory ChatAIMessageState({ | ||
required Message message, | ||
}) = _ChatAIMessageState; | ||
|
||
factory ChatAIMessageState.initial(Message message) => | ||
ChatAIMessageState(message: message); | ||
} |
Oops, something went wrong.