feat(electron): recording popups (#11016)

Added a recording popup UI for the audio recording feature in the desktop app, improving the user experience when capturing audio from applications.

### What changed?

- Created a new popup window system for displaying recording controls
- Added a dedicated recording UI with start/stop controls and status indicators
- Moved audio encoding logic from the main app to a dedicated module
- Implemented smooth animations for popup appearance/disappearance
- Updated the recording workflow to show visual feedback during recording process
- Added internationalization support for recording-related text
- Modified the recording status flow to include new states: new, recording, stopped, ready

fix AF-2340
This commit is contained in:
pengx17
2025-03-26 04:53:43 +00:00
parent 96e83a2141
commit 61c0d01da3
38 changed files with 3611 additions and 383 deletions

View File

@@ -1114,10 +1114,6 @@ export function useAFFiNEI18N(): {
["com.affine.auth.sign.auth.code.resend.hint"](options: {
readonly second: string;
}): string;
/**
* `Sent`
*/
["com.affine.auth.sent"](): string;
/**
* `The verification link failed to be sent, please try again later.`
*/
@@ -1707,6 +1703,10 @@ export function useAFFiNEI18N(): {
* `Cancel`
*/
["com.affine.confirmModal.button.cancel"](): string;
/**
* `Ok`
*/
["com.affine.confirmModal.button.ok"](): string;
/**
* `Current year`
*/
@@ -6928,7 +6928,7 @@ export function useAFFiNEI18N(): {
*/
["com.affine.editor.at-menu.date-picker"](): string;
/**
* `Mention Members`
* `Mention Member`
*/
["com.affine.editor.at-menu.mention-member"](): string;
/**
@@ -7428,15 +7428,45 @@ export function useAFFiNEI18N(): {
/**
* `Notes`
*/
["com.affine.attachmentViewer.audio.notes"](): string;
["com.affine.audio.notes"](): string;
/**
* `Transcribing`
*/
["com.affine.attachmentViewer.audio.transcribing"](): string;
["com.affine.audio.transcribing"](): string;
/**
* `Accept & Join`
* `Unable to retrieve AI results for others`
*/
["com.affine.notification.invitation.accept"](): string;
["com.affine.audio.transcribe.non-owner.confirm.title"](): string;
/**
* `Audio activity`
*/
["com.affine.recording.new"](): string;
/**
* `Open app`
*/
["com.affine.recording.ready"](): string;
/**
* `{{appName}}'s audio`
*/
["com.affine.recording.recording"](options: {
readonly appName: string;
}): string;
/**
* `Audio recording`
*/
["com.affine.recording.recording.unnamed"](): string;
/**
* `Start`
*/
["com.affine.recording.start"](): string;
/**
* `Dismiss`
*/
["com.affine.recording.dismiss"](): string;
/**
* `Stop`
*/
["com.affine.recording.stop"](): string;
/**
* `An internal error occurred.`
*/
@@ -8494,29 +8524,11 @@ export const TypedTrans: {
a: JSX.Element;
}>>;
/**
* `<1>{{username}}</1> has accept your invitation`
* `Please contact <1>{{user}}</1> to upgrade AI rights or resend the attachment.`
*/
["com.affine.notification.invitation-accepted"]: ComponentType<TypedTransProps<{
readonly username: string;
["com.affine.audio.transcribe.non-owner.confirm.message"]: ComponentType<TypedTransProps<{
readonly user: string;
}, {
["1"]: JSX.Element;
}>>;
/**
* `There is an issue regarding your invitation to <1>{{workspaceName}}</1> `
*/
["com.affine.notification.invitation-blocked"]: ComponentType<TypedTransProps<{
readonly workspaceName: string;
}, {
["1"]: JSX.Element;
}>>;
/**
* `<1>{{username}}</1> invited you to join <2>{{workspaceName}}</2>`
*/
["com.affine.notification.invitation"]: ComponentType<TypedTransProps<Readonly<{
username: string;
workspaceName: string;
}>, {
["1"]: JSX.Element;
["2"]: JSX.Element;
}>>;
} = /*#__PURE__*/ createProxy(createComponent);

View File

@@ -270,7 +270,6 @@
"com.affine.auth.sign.auth.code.continue": "Continue with code",
"com.affine.auth.sign.auth.code.resend": "Resend code",
"com.affine.auth.sign.auth.code.resend.hint": "Resend in {{second}}s",
"com.affine.auth.sent": "Sent",
"com.affine.auth.sent.change.email.fail": "The verification link failed to be sent, please try again later.",
"com.affine.auth.sent.change.email.hint": "Verification link has been sent.",
"com.affine.auth.sent.change.password.hint": "Reset password link has been sent.",
@@ -422,6 +421,7 @@
"com.affine.copy.asImage.success": "Image copied",
"com.affine.copy.asImage.failed": "Image copy failed",
"com.affine.confirmModal.button.cancel": "Cancel",
"com.affine.confirmModal.button.ok": "Ok",
"com.affine.currentYear": "Current year",
"com.affine.delete-tags.confirm.description": "Deleting <1>{{tag}}</1> cannot be undone, please proceed with caution.",
"com.affine.delete-tags.confirm.multi-tag-description": "Deleting {{count}} tags cannot be undone, please proceed with caution.",
@@ -1720,7 +1720,7 @@
"com.affine.editor.at-menu.more-docs-hint": "{{count}} more docs",
"com.affine.editor.at-menu.journal": "Journal",
"com.affine.editor.at-menu.date-picker": "Select a specific date",
"com.affine.editor.at-menu.mention-member": "Mention Members",
"com.affine.editor.at-menu.mention-member": "Mention Member",
"com.affine.editor.at-menu.mention-success": "Successfully mentioned the member",
"com.affine.editor.bi-directional-link-panel.show": "Show",
"com.affine.editor.bi-directional-link-panel.hide": "Hide",
@@ -1851,12 +1851,17 @@
"com.affine.integration.readwise-prop.created": "Created",
"com.affine.integration.readwise-prop.updated": "Updated",
"com.affine.integration.properties": "Integration properties",
"com.affine.attachmentViewer.audio.notes": "Notes",
"com.affine.attachmentViewer.audio.transcribing": "Transcribing",
"com.affine.notification.invitation-accepted": "<1>{{username}}</1> has accept your invitation",
"com.affine.notification.invitation-blocked": "There is an issue regarding your invitation to <1>{{workspaceName}}</1> ",
"com.affine.notification.invitation": "<1>{{username}}</1> invited you to join <2>{{workspaceName}}</2>",
"com.affine.notification.invitation.accept": "Accept & Join",
"com.affine.audio.notes": "Notes",
"com.affine.audio.transcribing": "Transcribing",
"com.affine.audio.transcribe.non-owner.confirm.title": "Unable to retrieve AI results for others",
"com.affine.audio.transcribe.non-owner.confirm.message": "Please contact <1>{{user}}</1> to upgrade AI rights or resend the attachment.",
"com.affine.recording.new": "Audio activity",
"com.affine.recording.ready": "Open app",
"com.affine.recording.recording": "{{appName}}'s audio",
"com.affine.recording.recording.unnamed": "Audio recording",
"com.affine.recording.start": "Start",
"com.affine.recording.dismiss": "Dismiss",
"com.affine.recording.stop": "Stop",
"error.INTERNAL_SERVER_ERROR": "An internal error occurred.",
"error.NETWORK_ERROR": "Network error.",
"error.TOO_MANY_REQUEST": "Too many requests.",