Commit ac86e4e
feat(web-app-ai-quick-draft-creator): add AI quick draft creator action (#465)
* feat(web-app-ai-quick-draft-creator): initial extension scaffold
Signed-off-by: Lukas Hirt <info@hirt.cz>
* fix(web-app-ai-quick-draft-creator): repair failing integration
Signed-off-by: Lukas Hirt <info@hirt.cz>
* chore(web-app-ai-quick-draft-creator): move extension from extensions/ to packages/
Relocate ai-quick-draft-creator from the non-standard extensions/ directory
to packages/web-app-ai-quick-draft-creator/ so it is picked up by the
pnpm-workspace.yaml glob (packages/*) and follows the repo convention.
Rename the package to web-app-ai-quick-draft-creator.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Lukas Hirt <info@hirt.cz>
* feat(web-app-ai-quick-draft-creator): address review feedback
Security (blockers):
- Route all LLM requests through the same-origin ai-llm-proxy; the
browser now sends Authorization: Bearer <oCIS OIDC token> to the proxy
rather than calling the LLM endpoint directly.
- Remove apiKey from LLMConfig and from applicationConfig entirely; the
provider API key is held server-side by the proxy only.
- useLLM.ts enforces a same-origin check at call time and throws a
user-visible error if the endpoint is cross-origin.
Structural:
- Delete unused generated App.vue stub.
- Add l10n/translations.json (initially empty) and l10n/template.pot;
wire translations into defineWebApplication return value.
- Update docker-compose.yml with dist volume mount for the extension.
- Add ai-quick-draft-creator entry to dev/docker/ocis.apps.yaml.
- Add web-app-ai-quick-draft-creator entry to support/actions/ocis.apps.yaml.
- Add web-app-ai-quick-draft-creator to the CI test matrix in test.yml.
Code quality:
- Remove ~190 lines of unused code from useLLM.ts: capability probe (4
network requests on every modal open), stream(), completeJSON(), and
summariseMessages().
- Remove capability-based tier logic from useDraftCreator.ts; always
generate a well-structured draft prompt.
- Add HH-mm-ss timestamp suffix to derived filenames so two same-day
drafts never silently overwrite each other.
- Replace raw <button> elements in DraftCreatorModal.vue with <oc-button>
and add an <oc-spinner> during creation.
Tests:
- Unit tests updated to match the slimmed UseLLMReturn interface (no
stream/completeJSON/capabilities); add a collision-suffix test.
- E2E tests rewritten: all no-op assertions replaced with real behavioral
checks; proxy mock now targets **/ai-llm-proxy/v1/** (matching the
same-origin path enforced by useLLM.ts); happy-path test verifies proxy
is called and modal closes on success.
Docs:
- Update README to document the proxy security model, configuration, and
environment variables.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Lukas Hirt <info@hirt.cz>
* fix(web-app-ai-quick-draft-creator): remove unused ref import in test
Signed-off-by: Lukas Hirt <info@hirt.cz>
* fix(web-app-ai-quick-draft-creator): remove canUpload guard from isVisible
Signed-off-by: Lukas Hirt <info@hirt.cz>
* chore(web-app-ai-quick-draft-creator): bump deps to ^12.4.2 to fix type errors
Signed-off-by: Lukas Hirt <info@hirt.cz>
* fix(web-app-ai-quick-draft-creator): register action in new-file menu instead of upload menu
Use appInfo.extensions with newFileMenu + customHandler to place the
'Draft from description' action in the correct #new-file-menu-drop
dropdown (the + New button), not the upload dropdown.
The newFileMenu.isVisible callback receives currentFolder directly as a
parameter, so the canUpload check is accurate and race-condition-free.
Update E2E tests to open #new-file-menu-btn and locate the item by its
menu title text.
Signed-off-by: Lukas Hirt <info@hirt.cz>
* feat(web-app-ai-quick-draft-creator): open created draft in editor automatically
After a draft is created, trigger the default file action so the new
file opens immediately without requiring manual navigation.
Return `{ resource, space }` from `createDraft` instead of the filename
string so the modal can pass the created resource to `triggerDefaultAction`.
Also adds `oc-modal-body-actions-cancel` class to the cancel button for
reliable E2E targeting, dismisses open modals before logout in `LoginPage`,
drops the WebDAV PUT stub from E2E setup now that tests run against real
oCIS, and adds `public/manifest.json`.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Lukas Hirt <info@hirt.cz>
---------
Signed-off-by: Lukas Hirt <info@hirt.cz>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 47e9f24 commit ac86e4e
20 files changed
Lines changed: 1187 additions & 339 deletions
File tree
- .github/workflows
- dev/docker
- packages/web-app-ai-quick-draft-creator
- l10n
- public
- src
- components
- composables
- tests
- e2e
- unit
- support
- actions
- pages
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
5 | 11 | | |
6 | 12 | | |
7 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
Lines changed: 83 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 96 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
0 commit comments