feat: document templates in the shared Add-a-document drawer - EXO-88755 - #2011
Merged
bmestrallet merged 4 commits intoJul 22, 2026
Merged
Conversation
bmestrallet
force-pushed
the
feat/EXO-88752-documents-add-new-menu
branch
from
July 22, 2026 20:28
369b6cd to
4317c7e
Compare
Base automatically changed from
feat/EXO-88752-documents-add-new-menu
to
feature/ai-contribution
July 22, 2026 20:36
bmestrallet
force-pushed
the
feat/EXO-88755-documents-templates
branch
from
July 22, 2026 20:42
56bc585 to
03adc67
Compare
…88755 Make the scaffolded Templates section of the shared create-document drawer real, entirely in the documents repo and reusing existing components. - Source = the "Templates" folder (by convention) at the current drive's docs root, resolved per context (space identity in a space, user identity in personal) via GET /v1/documents; its files are listed and rendered. - Cards REUSE the Documents-app grid card (documents-item-card) for the thumbnail preview + hover title/info bar, registered into the attachment bundle via initComponents.js. Real thumbnails come for free. - Card click copies the template node into the current target folder (POST /v1/documents/duplicate, destinationId resolved from the drive-root relative path via the breadcrumb endpoint) then behaves like blank-create: attachment-list add / Drive refresh, and OnlyOffice open only for office document types (PDF/image templates are copied but not opened, avoiding an editor error). - The card's hover info icon opens the existing document-info-drawer. - Visibility: the Templates section is always shown; when the folder is absent/empty a neutral, context word-swapped placeholder is displayed (new i18n keys in attachments_en.properties). No backend changes: reuses /v1/documents list + /v1/documents/duplicate + /v1/documents/breadcrumb. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The '+ New' menu 'Import' entry (zip mass import) is renamed 'Mass Import' and uses a distinct 'far fa-file-archive' icon (was the same fa-upload as the Upload entry). i18n via the existing documents.label.zip.upload key; desktop + mobile menus both updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…bootstrap, symlink templates - EXO-88755 Follow-up polish on the shared Add-a-document drawer's Templates section: - Name-first create (option B): clicking a template card selects it (primary ring) and reveals an editable title field right under that card, pre-filled with the template's base name; the footer Create commits it with that name. - Full-width, stacked template cards (were fixed-width side-by-side). - Readable card hover band: the reused Documents card's title band rendered white in the drawer (theme --allPagesMaskColor + a nested white v-card hid the white file name); force the activity-stream grey and make the inner name card transparent, teleport-proof selectors. - Collision-safe create: copy the template into the target folder, re-fetch the created node for a valid (openable) id, and fall back to a dedupe-safe in-place duplicate on the JCR 'same name sibling' 500 — no backend change. - Bootstrap (A): when the Templates folder is missing and the user can edit the drive root, offer a one-click 'Create a Templates folder'; context-aware empty states otherwise. - Global/other-space templates via symlinks (B): copy the symlink target (sourceID) so the new doc holds real content; filter symlinks whose target the viewer can't read. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…XO-88755 The created copy was located by name (name === template.name). When the backend de-duplicated a clashing name to 'name (1)', that match instead picked the source template, so the option-B rename hit the template's id — renaming/consuming the source and 503-ing (JCR refuses to rename a node OnlyOffice has open). Fix: snapshot the destination folder's file ids before the copy (listFolderFileIds) and pick the one new id afterwards (findNewCopy). The rename now targets the actual copy (a fresh, unopened node). Verified live in the collision scenario: copy id != template id, rename 200, source template preserved; symlink templates also copy their target into a real file. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bmestrallet
force-pushed
the
feat/EXO-88755-documents-templates
branch
from
July 22, 2026 20:48
03adc67 to
e15fd04
Compare
bmestrallet
added a commit
that referenced
this pull request
Jul 28, 2026
(#2011) * feat: document templates in the shared "Add a document" drawer - EXO-88755 Make the scaffolded Templates section of the shared create-document drawer real, entirely in the documents repo and reusing existing components. - Source = the "Templates" folder (by convention) at the current drive's docs root, resolved per context (space identity in a space, user identity in personal) via GET /v1/documents; its files are listed and rendered. - Cards REUSE the Documents-app grid card (documents-item-card) for the thumbnail preview + hover title/info bar, registered into the attachment bundle via initComponents.js. Real thumbnails come for free. - Card click copies the template node into the current target folder (POST /v1/documents/duplicate, destinationId resolved from the drive-root relative path via the breadcrumb endpoint) then behaves like blank-create: attachment-list add / Drive refresh, and OnlyOffice open only for office document types (PDF/image templates are copied but not opened, avoiding an editor error). - The card's hover info icon opens the existing document-info-drawer. - Visibility: the Templates section is always shown; when the folder is absent/empty a neutral, context word-swapped placeholder is displayed (new i18n keys in attachments_en.properties). No backend changes: reuses /v1/documents list + /v1/documents/duplicate + /v1/documents/breadcrumb. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat: rename Drive Import to Mass Import with archive icon - EXO-88752 The '+ New' menu 'Import' entry (zip mass import) is renamed 'Mass Import' and uses a distinct 'far fa-file-archive' icon (was the same fa-upload as the Upload entry). i18n via the existing documents.label.zip.upload key; desktop + mobile menus both updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat: templates drawer — name-first create, full-width cards, folder bootstrap, symlink templates - EXO-88755 Follow-up polish on the shared Add-a-document drawer's Templates section: - Name-first create (option B): clicking a template card selects it (primary ring) and reveals an editable title field right under that card, pre-filled with the template's base name; the footer Create commits it with that name. - Full-width, stacked template cards (were fixed-width side-by-side). - Readable card hover band: the reused Documents card's title band rendered white in the drawer (theme --allPagesMaskColor + a nested white v-card hid the white file name); force the activity-stream grey and make the inner name card transparent, teleport-proof selectors. - Collision-safe create: copy the template into the target folder, re-fetch the created node for a valid (openable) id, and fall back to a dedupe-safe in-place duplicate on the JCR 'same name sibling' 500 — no backend change. - Bootstrap (A): when the Templates folder is missing and the user can edit the drive root, offer a one-click 'Create a Templates folder'; context-aware empty states otherwise. - Global/other-space templates via symlinks (B): copy the symlink target (sourceID) so the new doc holds real content; filter symlinks whose target the viewer can't read. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix: create-from-template targets the copy by id-diff, not by name - EXO-88755 The created copy was located by name (name === template.name). When the backend de-duplicated a clashing name to 'name (1)', that match instead picked the source template, so the option-B rename hit the template's id — renaming/consuming the source and 503-ing (JCR refuses to rename a node OnlyOffice has open). Fix: snapshot the destination folder's file ids before the copy (listFolderFileIds) and pick the one new id afterwards (findNewCopy). The rename now targets the actual copy (a fresh, unopened node). Verified live in the collision scenario: copy id != template id, rename 200, source template preserved; symlink templates also copy their target into a real file. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Jihed525
pushed a commit
that referenced
this pull request
Jul 30, 2026
(#2011) * feat: document templates in the shared "Add a document" drawer - EXO-88755 Make the scaffolded Templates section of the shared create-document drawer real, entirely in the documents repo and reusing existing components. - Source = the "Templates" folder (by convention) at the current drive's docs root, resolved per context (space identity in a space, user identity in personal) via GET /v1/documents; its files are listed and rendered. - Cards REUSE the Documents-app grid card (documents-item-card) for the thumbnail preview + hover title/info bar, registered into the attachment bundle via initComponents.js. Real thumbnails come for free. - Card click copies the template node into the current target folder (POST /v1/documents/duplicate, destinationId resolved from the drive-root relative path via the breadcrumb endpoint) then behaves like blank-create: attachment-list add / Drive refresh, and OnlyOffice open only for office document types (PDF/image templates are copied but not opened, avoiding an editor error). - The card's hover info icon opens the existing document-info-drawer. - Visibility: the Templates section is always shown; when the folder is absent/empty a neutral, context word-swapped placeholder is displayed (new i18n keys in attachments_en.properties). No backend changes: reuses /v1/documents list + /v1/documents/duplicate + /v1/documents/breadcrumb. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat: rename Drive Import to Mass Import with archive icon - EXO-88752 The '+ New' menu 'Import' entry (zip mass import) is renamed 'Mass Import' and uses a distinct 'far fa-file-archive' icon (was the same fa-upload as the Upload entry). i18n via the existing documents.label.zip.upload key; desktop + mobile menus both updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat: templates drawer — name-first create, full-width cards, folder bootstrap, symlink templates - EXO-88755 Follow-up polish on the shared Add-a-document drawer's Templates section: - Name-first create (option B): clicking a template card selects it (primary ring) and reveals an editable title field right under that card, pre-filled with the template's base name; the footer Create commits it with that name. - Full-width, stacked template cards (were fixed-width side-by-side). - Readable card hover band: the reused Documents card's title band rendered white in the drawer (theme --allPagesMaskColor + a nested white v-card hid the white file name); force the activity-stream grey and make the inner name card transparent, teleport-proof selectors. - Collision-safe create: copy the template into the target folder, re-fetch the created node for a valid (openable) id, and fall back to a dedupe-safe in-place duplicate on the JCR 'same name sibling' 500 — no backend change. - Bootstrap (A): when the Templates folder is missing and the user can edit the drive root, offer a one-click 'Create a Templates folder'; context-aware empty states otherwise. - Global/other-space templates via symlinks (B): copy the symlink target (sourceID) so the new doc holds real content; filter symlinks whose target the viewer can't read. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix: create-from-template targets the copy by id-diff, not by name - EXO-88755 The created copy was located by name (name === template.name). When the backend de-duplicated a clashing name to 'name (1)', that match instead picked the source template, so the option-B rename hit the template's id — renaming/consuming the source and 503-ing (JCR refuses to rename a node OnlyOffice has open). Fix: snapshot the destination folder's file ids before the copy (listFolderFileIds) and pick the one new id afterwards (findNewCopy). The rename now targets the actual copy (a fresh, unopened node). Verified live in the collision scenario: copy id != template id, rename 200, source template preserved; symlink templates also copy their target into a real file. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> (cherry picked from commit a679d44)
bmestrallet
added a commit
that referenced
this pull request
Aug 1, 2026
(#2011) * feat: document templates in the shared "Add a document" drawer - EXO-88755 Make the scaffolded Templates section of the shared create-document drawer real, entirely in the documents repo and reusing existing components. - Source = the "Templates" folder (by convention) at the current drive's docs root, resolved per context (space identity in a space, user identity in personal) via GET /v1/documents; its files are listed and rendered. - Cards REUSE the Documents-app grid card (documents-item-card) for the thumbnail preview + hover title/info bar, registered into the attachment bundle via initComponents.js. Real thumbnails come for free. - Card click copies the template node into the current target folder (POST /v1/documents/duplicate, destinationId resolved from the drive-root relative path via the breadcrumb endpoint) then behaves like blank-create: attachment-list add / Drive refresh, and OnlyOffice open only for office document types (PDF/image templates are copied but not opened, avoiding an editor error). - The card's hover info icon opens the existing document-info-drawer. - Visibility: the Templates section is always shown; when the folder is absent/empty a neutral, context word-swapped placeholder is displayed (new i18n keys in attachments_en.properties). No backend changes: reuses /v1/documents list + /v1/documents/duplicate + /v1/documents/breadcrumb. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat: rename Drive Import to Mass Import with archive icon - EXO-88752 The '+ New' menu 'Import' entry (zip mass import) is renamed 'Mass Import' and uses a distinct 'far fa-file-archive' icon (was the same fa-upload as the Upload entry). i18n via the existing documents.label.zip.upload key; desktop + mobile menus both updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat: templates drawer — name-first create, full-width cards, folder bootstrap, symlink templates - EXO-88755 Follow-up polish on the shared Add-a-document drawer's Templates section: - Name-first create (option B): clicking a template card selects it (primary ring) and reveals an editable title field right under that card, pre-filled with the template's base name; the footer Create commits it with that name. - Full-width, stacked template cards (were fixed-width side-by-side). - Readable card hover band: the reused Documents card's title band rendered white in the drawer (theme --allPagesMaskColor + a nested white v-card hid the white file name); force the activity-stream grey and make the inner name card transparent, teleport-proof selectors. - Collision-safe create: copy the template into the target folder, re-fetch the created node for a valid (openable) id, and fall back to a dedupe-safe in-place duplicate on the JCR 'same name sibling' 500 — no backend change. - Bootstrap (A): when the Templates folder is missing and the user can edit the drive root, offer a one-click 'Create a Templates folder'; context-aware empty states otherwise. - Global/other-space templates via symlinks (B): copy the symlink target (sourceID) so the new doc holds real content; filter symlinks whose target the viewer can't read. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix: create-from-template targets the copy by id-diff, not by name - EXO-88755 The created copy was located by name (name === template.name). When the backend de-duplicated a clashing name to 'name (1)', that match instead picked the source template, so the option-B rename hit the template's id — renaming/consuming the source and 503-ing (JCR refuses to rename a node OnlyOffice has open). Fix: snapshot the destination folder's file ids before the copy (listFolderFileIds) and pick the one new id afterwards (findNewCopy). The rename now targets the actual copy (a fresh, unopened node). Verified live in the collision scenario: copy id != template id, rename 200, source template preserved; symlink templates also copy their target into a real file. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on feat/EXO-88752 (PR #2010) — the diff shows only the templates work once the lower PRs merge. Retarget up the chain as they land.
What this adds
Document templates in the shared "Add a document" drawer (attachment composer + Drive "+ New → Document"), by convention: each drive's
Templatesfolder holds the template files; they render in the drawer's "Or start from a template" section as the reused Documents-app cards.Create from a template (name-first, option B)
Cards & readability
--allPagesMaskColor+ a nested whitev-cardhid the white filename). Forced the activity-stream grey and made the inner name card transparent, with teleport-proof selectors.Empty-state bootstrap (A)
Templatesfolder is missing and the user may edit the drive root, a one-click "Create a Templates folder" is offered; otherwise a neutral, context-aware message (space vs personal, folder-empty vs missing).Global / cross-space templates via symlinks (B)
sourceID) so the new document holds real content, not a link; symlinks whose target the viewer can't read are filtered out.Also here
far fa-file-archiveicon (desktop + mobile), i18n via the existing key.Testing
Built, deployed on a local 7.3.x instance, and live-verified: name-first create + open in OnlyOffice, full-width cards, readable grey card band (confirmed via computed styles), collision fallback (no 500), and the Mass Import label/icon. Two environment notes surfaced during testing (not code): OnlyOffice's Docker container must reach the platform via a host-reachable address — browse via the LAN IP so its callback/content URLs aren't
localhost(unreachable from the container).🤖 Generated with Claude Code