Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 10 additions & 18 deletions src/apps/mobile/harmonyos/entry/src/main/ets/i18n/EnUsMessages.ets
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,6 @@ export const EN_US_MESSAGES: [string, string][] = [
['remote.actions', 'Remote settings'],
['remote.device', 'Connected device'],
['remote.newChat', 'Chat'],
['remote.create.title', 'New task'],
['remote.create.chat', 'Chat'],
['remote.create.noDevice', 'Choose a desktop'],
['remote.create.noOnlineDevice', 'No online desktop is available'],
['remote.create.placeholder', 'Tell BitFun what to do'],
['remote.create.deviceLoadFailed', 'Could not load devices. Try again later.'],
['remote.create.workspaceLoadFailed', 'Could not load workspaces. Try again later.'],
['remote.create.deviceMismatch', 'The selected device is not connected. Choose it again and retry.'],
['remote.create.submitFailed', 'Could not create the session. Check the desktop connection and retry.'],
['remote.create.harness.minimal', 'Minimal'],
['remote.create.harness.balanced', 'Standard'],
['remote.create.harness.ultimate', 'Ultimate'],
['remote.create.harnessAccessibility', 'Harness: {0}'],
['remote.workspace', 'Workspace'],
['remote.assistant', 'Assistant'],
['remote.noAssistant', 'Default assistant'],
Expand Down Expand Up @@ -453,6 +440,7 @@ export const EN_US_MESSAGES: [string, string][] = [
['chat.toolOpAskUser', 'Ask for confirmation'],
['chat.toolTodoFallback', 'Task list'],
['chat.toolTaskFallback', 'Subtask'],
['chat.subagentOutput', 'Subtask output'],
['chat.toolFailed', '{0} failed'],
['chat.toolRunning', 'Running'],
['chat.showMore', 'Show more'],
Expand Down Expand Up @@ -492,6 +480,8 @@ export const EN_US_MESSAGES: [string, string][] = [
['filePreview.offline', 'Offline. Showing loaded content only.'],
['filePreview.fitImage', 'Fit window'],
['filePreview.actualImageSize', 'Actual size'],
['filePreview.expand', 'Expand preview'],
['filePreview.restoreSize', 'Restore preview'],
['filePreview.imageDecodeFailed', 'The image could not be decoded. Retry or download the file.'],
['filePreview.loadFailed', 'Could not open the file'],
['filePreview.notFound', 'The file does not exist or was moved'],
Expand Down Expand Up @@ -605,21 +595,23 @@ export const EN_US_MESSAGES: [string, string][] = [
['errors.voiceInputUnavailable', 'Speech recognition is unavailable. Try again later.'],
['errors.voiceInputFailed', 'Speech recognition failed ({0}). Try again later.'],

['watchProvision.title', 'Add this watch to your BitFun account?'],
['watchProvision.title', 'Sign in to BitFun on this watch?'],
['watchProvision.deviceId', 'Device {0}'],
['watchProvision.body', 'If you allow this, the watch can use your account to connect a desktop for 30 days. Confirm the device is in your hands.'],
['watchProvision.body', 'If you allow this, the watch will sign in to your account and can connect to a desktop. Confirm the watch is in your hands.'],
['watchProvision.approve', 'Allow'],
['watchProvision.reject', 'Deny'],
['watchProvision.gotIt', 'Got it'],
['watchProvision.working', 'Setting up the watch account...'],
['watchProvision.passwordBody', 'Confirm your account password once more to create a separate sign-in for this watch. The password is used only for this verification.'],
['watchProvision.passwordPlaceholder', 'Account password'],
['watchProvision.passwordConfirm', 'Confirm'],
['watchProvision.doneBody', '{0} was added to the account and can be used on the watch now.'],
['watchProvision.doneBody', '{0} is signed in and ready to use BitFun.'],
['watchProvision.rejected', 'Denied on the phone.'],
['watchProvision.busy', 'The phone is handling another device request. Try again later.'],
['watchProvision.errors.noDesktop', 'Scan and connect a desktop on the phone before authorizing a watch.'],
['watchProvision.errors.desktopUnreachable', 'The desktop is offline or too old. Update it and retry.'],
['watchProvision.errors.noDesktop', 'Sign in to BitFun on the phone, or connect a desktop signed in to the same account.'],
['watchProvision.errors.accountUnavailable', 'The account could not be verified. Check the phone network and try again.'],
['watchProvision.errors.desktopUnreachable', 'The desktop could not be reached. Make sure it is online and try again.'],
['watchProvision.errors.desktopAuthorizationFailed', 'The desktop could not sign in the watch. Make sure it uses the same BitFun account.'],
['watchProvision.errors.passwordFailed', 'Account verification failed. Check the password or network and retry.'],
['watchProvision.errors.handoffFailed', 'Authorization finished, but the credential could not be sent to the watch. Retry on the watch.'],

Expand Down
28 changes: 10 additions & 18 deletions src/apps/mobile/harmonyos/entry/src/main/ets/i18n/ZhCnMessages.ets
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,6 @@ export const ZH_CN_MESSAGES: [string, string][] = [
['remote.actions', '远程设置'],
['remote.device', '连接的设备'],
['remote.newChat', '聊天'],
['remote.create.title', '新建任务'],
['remote.create.chat', '聊天'],
['remote.create.noDevice', '选择桌面设备'],
['remote.create.noOnlineDevice', '没有可用的在线桌面设备'],
['remote.create.placeholder', '告诉 BitFun 要做什么'],
['remote.create.deviceLoadFailed', '设备列表加载失败,请稍后重试。'],
['remote.create.workspaceLoadFailed', '工作区加载失败,请稍后重试。'],
['remote.create.deviceMismatch', '所选设备尚未连接,请重新选择设备后再试。'],
['remote.create.submitFailed', '无法创建会话,请检查桌面连接后重试。'],
['remote.create.harness.minimal', '极简'],
['remote.create.harness.balanced', '标准'],
['remote.create.harness.ultimate', '极致'],
['remote.create.harnessAccessibility', 'Harness:{0}'],
['remote.workspace', '工作区'],
['remote.assistant', '助理'],
['remote.noAssistant', '默认助理'],
Expand Down Expand Up @@ -453,6 +440,7 @@ export const ZH_CN_MESSAGES: [string, string][] = [
['chat.toolOpAskUser', '请求确认'],
['chat.toolTodoFallback', '任务列表'],
['chat.toolTaskFallback', '子任务'],
['chat.subagentOutput', '子任务输出'],
['chat.toolFailed', '{0}失败'],
['chat.toolRunning', '正在运行'],
['chat.showMore', '查看更多'],
Expand Down Expand Up @@ -492,6 +480,8 @@ export const ZH_CN_MESSAGES: [string, string][] = [
['filePreview.offline', '离线,仅显示已加载内容'],
['filePreview.fitImage', '适应窗口'],
['filePreview.actualImageSize', '原始大小'],
['filePreview.expand', '放大预览'],
['filePreview.restoreSize', '还原预览'],
['filePreview.imageDecodeFailed', '图片无法解码,请重试或下载文件。'],
['filePreview.loadFailed', '无法打开文件'],
['filePreview.notFound', '文件不存在或已被移动'],
Expand Down Expand Up @@ -605,21 +595,23 @@ export const ZH_CN_MESSAGES: [string, string][] = [
['errors.voiceInputUnavailable', '语音识别暂不可用,请稍后重试。'],
['errors.voiceInputFailed', '语音识别失败({0}),请稍后重试。'],

['watchProvision.title', '把这块手表加入你的 BitFun 账号?'],
['watchProvision.title', '在这块手表上登录 BitFun?'],
['watchProvision.deviceId', '设备编号 {0}'],
['watchProvision.body', '同意后,这块手表可以用你的账号连接桌面端,有效期 30 天。请确认这台设备就在你手里。'],
['watchProvision.body', '同意后,手表会登录你的账号并可以连接桌面端。请确认这块手表就在你手里。'],
['watchProvision.approve', '允许'],
['watchProvision.reject', '拒绝'],
['watchProvision.gotIt', '知道了'],
['watchProvision.working', '正在为手表开通账号...'],
['watchProvision.passwordBody', '需要再确认一次账号密码,才能给这块手表创建独立的登录凭证。密码只会用于本次验证。'],
['watchProvision.passwordPlaceholder', '账号密码'],
['watchProvision.passwordConfirm', '确认'],
['watchProvision.doneBody', '{0} 已加入账号,手表上可以直接使用了。'],
['watchProvision.doneBody', '{0} 已登录,可以在手表上使用 BitFun 了。'],
['watchProvision.rejected', '已在手机上拒绝。'],
['watchProvision.busy', '手机正在处理另一台设备的请求,请稍后再试。'],
['watchProvision.errors.noDesktop', '需要先在手机上扫码连接桌面端,才能给手表授权。'],
['watchProvision.errors.desktopUnreachable', '桌面端未在线或版本过旧,请更新桌面端后重试。'],
['watchProvision.errors.noDesktop', '请先在手机上登录 BitFun 账号,或连接已登录同一账号的桌面端。'],
['watchProvision.errors.accountUnavailable', '暂时无法验证账号,请检查手机网络后重试。'],
['watchProvision.errors.desktopUnreachable', '暂时无法连接桌面端,请确认桌面端在线后重试。'],
['watchProvision.errors.desktopAuthorizationFailed', '桌面端没能完成手表登录,请确认桌面端已登录同一 BitFun 账号。'],
['watchProvision.errors.passwordFailed', '账号验证失败,请检查密码或网络后重试。'],
['watchProvision.errors.handoffFailed', '授权已完成,但没能把凭证发给手表,请在手表上重试一次。'],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,27 @@ export class ChatTimelineRowStore {
private signaturesByKey: Map<string, string> = new Map<string, string>();

reconcile(items: ChatTimelineItem[]): ObservableChatTimelineItem[] {
// A lazy container requires unique keys. Keep the final projection for a
// key as a defensive boundary even if an upstream adapter temporarily
// exposes both a persisted assistant stub and its active turn snapshot.
const orderedKeys: string[] = [];
const itemsByKey: Map<string, ChatTimelineItem> = new Map<string, ChatTimelineItem>();
items.forEach((item: ChatTimelineItem) => {
const key = ChatTimelineRevisionTracker.itemKey(item);
if (!itemsByKey.has(key)) {
orderedKeys.push(key);
}
itemsByKey.set(key, item);
});
const nextRowsByKey: Map<string, ObservableChatTimelineItem> =
new Map<string, ObservableChatTimelineItem>();
const nextSignaturesByKey: Map<string, string> = new Map<string, string>();
const rows: ObservableChatTimelineItem[] = [];
items.forEach((item: ChatTimelineItem) => {
const key = ChatTimelineRevisionTracker.itemKey(item);
orderedKeys.forEach((key: string) => {
const item = itemsByKey.get(key);
if (!item) {
return;
}
const signature = ChatTimelineRevisionTracker.itemSignature(item);
let row = this.rowsByKey.get(key);
if (row) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ struct AppRoot {
navigationStack: this.runtime.navigationStack,
remotePageState: this.runtime.remotePageState,
deviceDirectoryState: this.runtime.deviceDirectoryState,
remoteCreateState: this.runtime.remoteCreateState,
generalPageState: this.runtime.generalChatPageState,
filePreviewState: this.runtime.filePreviewState,
deviceId: this.runtime.remoteConnectionController.getDeviceId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { CloudAccountDevice } from '../../services/CloudAccountClient';
import { DetectedUrlAction } from '../../services/ConnectScanDecisionPolicy';
import { ConversationIntent } from './ConversationIntent';
import { AppRoute } from '../navigation/AppRouteContract';
import { RemoteHarnessProfile } from '../state/RemoteCreateSessionState';

export interface AppRootPresentationActions {
readonly onNavigationBack: (route: AppRoute) => boolean;
Expand All @@ -12,7 +11,6 @@ export interface AppRootPresentationActions {
readonly onCompactLayoutEntered: () => void;
readonly onLayoutModeChanged: (wideLayout: boolean) => void;
readonly onRemoteHome: RemoteHomePresentationActions;
readonly onRemoteCreate: RemoteCreatePresentationActions;
readonly onSidebar: SidebarPresentationActions;
readonly onSettings: SettingsPresentationActions;
readonly onConnect: ConnectPresentationActions;
Expand All @@ -27,19 +25,6 @@ export interface FilePreviewPresentationActions {
readonly openLink: (reference: string, label: string) => void;
}

export interface RemoteCreatePresentationActions {
readonly back: () => void;
readonly toggleDevices: () => void;
readonly toggleWorkspaces: () => void;
readonly selectDevice: (device: CloudAccountDevice) => void;
readonly selectWorkspace: (path: string) => void;
readonly draftChanged: (value: string) => void;
readonly voiceInput: () => void;
readonly selectModel: (modelId: string) => void;
readonly selectHarness: (profile: RemoteHarnessProfile) => void;
readonly send: () => void;
}

export interface RemoteHomePresentationActions {
readonly openSidebar: () => void;
readonly connectWorkspace: () => void;
Expand All @@ -60,8 +45,6 @@ export interface RemoteHomePresentationActions {
readonly clearPairing: () => void;
readonly create: (agentType: string) => void;
readonly createInPlace: (agentType: string) => void;
readonly createAssistant: () => void;
readonly openCreateInWorkspace: (path: string, deviceId?: string) => void;
readonly createInWorkspace: (path: string, agentType: string, deviceId?: string) => void;
readonly createInWorkspaceInPlace: (path: string, agentType: string, deviceId?: string) => void;
readonly selectDirectoryDevice: (deviceId: string) => void;
Expand Down Expand Up @@ -136,17 +119,11 @@ export function emptyAppRootPresentationActions(): AppRootPresentationActions {
refresh: () => {}, showWorkspaces: () => {}, showAssistants: () => {}, selectWorkspace: () => {},
selectAssistant: () => {}, cancelWorkspace: () => {}, cancelAssistant: () => {}, queryChanged: () => {},
search: () => {}, loadMore: () => {}, reconnect: () => {}, disconnect: () => {}, clearPairing: () => {},
create: () => {}, createInPlace: () => {}, createAssistant: () => {}, openCreateInWorkspace: () => {},
createInWorkspace: () => {},
create: () => {}, createInPlace: () => {}, createInWorkspace: () => {},
createInWorkspaceInPlace: () => {}, selectDirectoryDevice: () => {}, addDirectoryWorkspace: () => {},
retryDirectoryDevice: () => {}, loadWorkspaceSessions: async () => {},
openSession: () => {}, openSessionInPlace: () => {}, deleteSession: () => {}
},
onRemoteCreate: {
back: () => {}, toggleDevices: () => {}, toggleWorkspaces: () => {}, selectDevice: () => {},
selectWorkspace: () => {}, draftChanged: () => {}, voiceInput: () => {}, selectModel: () => {},
selectHarness: () => {}, send: () => {}
},
onSidebar: {
close: () => {}, newChat: () => {}, enterCode: () => {}, scanDesktop: () => {}, addDesktop: () => {},
refreshDevices: () => {}, settings: () => {}, openAccount: () => {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class AdaptiveSheetOptions {
if (placement.mode === SettingsPlacementMode.FoldOperate) {
return {
height: placement.height,
keyboardAvoidMode: SheetKeyboardAvoidMode.RESIZE_ONLY,
backgroundColor: '#00000000',
maskColor: '#44000000',
showClose: false,
Expand All @@ -22,6 +23,7 @@ export class AdaptiveSheetOptions {
return {
height: placement.height,
width: placement.width,
keyboardAvoidMode: SheetKeyboardAvoidMode.RESIZE_ONLY,
preferType: SheetType.SIDE,
backgroundColor: '#00000000',
maskColor: '#44000000',
Expand All @@ -33,6 +35,7 @@ export class AdaptiveSheetOptions {
return {
height: placement.height,
width: placement.width,
keyboardAvoidMode: SheetKeyboardAvoidMode.RESIZE_ONLY,
preferType: SheetType.CENTER,
backgroundColor: '#00000000',
maskColor: '#44000000',
Expand All @@ -43,6 +46,7 @@ export class AdaptiveSheetOptions {
if (placement.height > 0) {
return {
height: placement.height,
keyboardAvoidMode: SheetKeyboardAvoidMode.RESIZE_ONLY,
backgroundColor: '#00000000',
maskColor: '#44000000',
showClose: false,
Expand All @@ -51,6 +55,7 @@ export class AdaptiveSheetOptions {
}
return {
height: SheetSize.LARGE,
keyboardAvoidMode: SheetKeyboardAvoidMode.RESIZE_ONLY,
backgroundColor: '#00000000',
maskColor: '#44000000',
showClose: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export struct AppSidebarSurface {
onOpenSession: this.actions.onSidebar.openSession,
onCreateInWorkspace: (deviceId: string, path: string) => {
this.actions.onSidebar.close();
this.actions.onRemoteHome.openCreateInWorkspace(path, deviceId);
this.actions.onRemoteHome.createInWorkspace(path, 'code', deviceId);
},
onOpenWorkspace: (deviceId: string, path: string) => {
this.actions.onRemoteHome.selectWorkspace(path, deviceId);
Expand Down
Loading