Repository navigation
Composer attachments: first page previews, Library icons, lighter cards - #12261
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…ext decoder, respect MIME kind
|
@codex review |
|
@codex review |
|
@codex review |
|
@codex review |
|
@codex review |
…DOCX for thumbnails
|
@codex review |
|
@codex review |
|
@codex review |
|
@codex review |
|
@codex review |
…labels, no DOCX links)
|
@codex review |
|
@codex review |
|
@codex review |
|
@codex review |
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
| function docxRelationships(rels: Uint8Array | undefined, base: string): DocxRelationship[] { | ||
| if (!rels) return []; | ||
| const list: DocxRelationship[] = []; | ||
| const markup = strFromU8(rels).replace(XML_NON_ELEMENT_RE, ""); |
|
|
||
| /** Each element tag's local name and attributes; comments, CDATA and text are skipped. */ | ||
| function* docxElementTags(xml: string): Generator<{ local: string; attributes: Map<string, string> }> { | ||
| for (const tag of xml.replace(XML_NON_ELEMENT_RE, "").match(XML_ELEMENT_TAG_RE) ?? []) { |
| if (!part || !xml) continue; | ||
| // Just the referenced notes' elements, not the whole part. | ||
| const element = new RegExp(`<([\\w.-]+:)?${note}(?=[\\s/>])(?:"[^"]*"|'[^']*'|[^"'>])*>[\\s\\S]*?</\\1?${note}>`, "g"); | ||
| const kept = [...strFromU8(xml).replace(XML_NON_ELEMENT_RE, "").matchAll(element)] |
Summary
Composer attachment cards now show a preview of the file's first page for documents, and use the same icons as the Library.
Changes
First page previews
DocumentView(the same renderer as the attachment preview dialog) at a fixed layout width, scaled down to the card.inertandaria-hidden, so clicking the card still opens the full preview dialog.MarkdownPreview. Text and code show the first 8 KB.Icons
features/library/file-kind.ts):Pdf01Icon,FlimSlateIcon,File02Icon,SheetIcon,InternetIcon. Colors are unchanged.text-pink-400, slightly scaled down) so it no longer stands out.FileEmpty02Icon.SheetIconis imported relatively so the node tests can still loadattachment-file-kind.ts.Card styling
Testing
tsc -bpasses.npm test, 9353 tests).