mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-11 23:26:30 +08:00
29ae6afe71
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Introduced a redesigned chat interface with new cell types for user, assistant, system, loading, and error messages. * Added streaming chat responses and improved session management. * Enhanced input box behavior, allowing sending messages with the return key and inserting new lines via the edit menu. * Added new GraphQL queries for fetching recent and latest chat sessions. * **Refactor** * Replaced previous chat message and session management with a new, more structured view model system. * Updated chat view to use a custom table view component for better message rendering and empty state handling. * Simplified and improved error and loading state handling in the chat UI. * **Bug Fixes** * Improved error reporting and retry options for failed chat messages. * Fixed inconsistent property types for message and error identifiers. * **Style** * Updated UI components for chat cells with modern layouts and consistent styling. * **Chores** * Added a new package dependency for event streaming support. * Renamed various internal properties and classes for clarity and consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
36 lines
1.1 KiB
Swift
36 lines
1.1 KiB
Swift
//
|
|
// AffineViewController+AIButton.swift
|
|
// App
|
|
//
|
|
// Created by 秋星桥 on 2025/1/8.
|
|
//
|
|
|
|
import Intelligents
|
|
import UIKit
|
|
|
|
extension AFFiNEViewController: IntelligentsButtonDelegate {
|
|
func onIntelligentsButtonTapped(_ button: IntelligentsButton) {
|
|
// if it shows up then we are ready to go
|
|
let controller = IntelligentsController()
|
|
self.present(controller, animated: true)
|
|
// IntelligentContext.shared.webView = webView
|
|
// button.beginProgress()
|
|
// IntelligentContext.shared.preparePresent { result in
|
|
// DispatchQueue.main.async {
|
|
// button.stopProgress()
|
|
// switch result {
|
|
// case .success:
|
|
// case let .failure(failure):
|
|
// let alert = UIAlertController(
|
|
// title: "Error",
|
|
// message: failure.localizedDescription,
|
|
// preferredStyle: .alert
|
|
// )
|
|
// alert.addAction(UIAlertAction(title: "OK", style: .default))
|
|
// self.present(alert, animated: true)
|
|
// }
|
|
// }
|
|
// }
|
|
}
|
|
}
|