接入桌面壳文本文件导出能力

新增 HostBridge file.exportText 契约、文件名清洗和 H5 导出入口

Tauri 桌面壳通过受控 host_bridge_request 打开保存对话框并写入文本文件

Expo 移动壳对未接入的文件导出能力明确返回 unsupported

更新宿主壳方案、统一协议和项目共享决策记录
This commit is contained in:
2026-06-17 23:02:01 +08:00
parent 6f19e1c3ba
commit d67f9d5725
14 changed files with 540 additions and 12 deletions

View File

@@ -179,4 +179,17 @@ describe('handleMobileHostBridgeMessage', () => {
expect(failedResponse.error.code).toBe('invalid_request');
expect(Linking.openURL).not.toHaveBeenCalled();
});
test('移动壳未接入真实导出能力时明确返回 unsupported', async () => {
const response = await send(
request('file.exportText', {
fileName: '作品记录.txt',
content: 'content',
}),
);
const failedResponse = expectFailed(response);
expect(failedResponse.error.code).toBe('unsupported_method');
});
});