0c589a6f79
* feat: add text file preview (#7023) * feat: open message text file attachment in preview * refractor: use `window.api.fs.readText` * fix: use `FileTypes.TEXT` * fix: trim prefix "file://" with `replace` * refactor(FileAction): centralize file click handling for text preview - Use FileAction.handleClick in AttachmentPreview and MessageAttachments - Show i18n error modal on failure (zh-cn: files.click.error) * fix: i18n * fix: update i18n on field `files.click.error` with codex * fix: use hook * fix: rename `handleClick` to `preview` * feat: support lang highlight * fix: remove prefix '.' of extension * fix: code editor style * fix: editor cursor text style * fix: add `FileTypes` check * fix: move parseFileType into utils * fix: move `parseFileTypes` into utils/file