@conduction/nextcloud-vue 2.77.0 → 2.78.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/esm/components/CnAiCompanion/CnAiCompanion.vue2.js +23 -0
  2. package/dist/esm/components/CnAiCompanion/CnAiCompanion.vue2.js.map +1 -1
  3. package/dist/esm/components/CnAiCompanion/CnAiCompanion.vue3.js.map +1 -1
  4. package/dist/esm/components/CnBoardView/CnBoardView.vue2.js +2 -1
  5. package/dist/esm/components/CnBoardView/CnBoardView.vue2.js.map +1 -1
  6. package/dist/esm/components/CnBoardView/CnBoardView.vue3.js.map +1 -1
  7. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +37 -0
  8. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
  9. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js +8 -7
  10. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
  11. package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js +37 -0
  12. package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js.map +1 -1
  13. package/dist/esm/components/CnChartWidget/CnChartWidget.vue3.js +2 -2
  14. package/dist/esm/components/CnChartWidget/CnChartWidget.vue3.js.map +1 -1
  15. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +29 -4
  16. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  17. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  18. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +7 -2
  19. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
  20. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
  21. package/dist/esm/components/CnDateRangePicker/CnDateRangePicker.vue.js +1 -1
  22. package/dist/esm/components/CnDateRangePicker/CnDateRangePicker.vue2.js +45 -2
  23. package/dist/esm/components/CnDateRangePicker/CnDateRangePicker.vue2.js.map +1 -1
  24. package/dist/esm/components/CnDateRangePicker/CnDateRangePicker.vue3.js.map +1 -1
  25. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js +7 -1
  26. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
  27. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
  28. package/dist/esm/components/CnFormPage/CnFormPage.vue2.js +4 -1
  29. package/dist/esm/components/CnFormPage/CnFormPage.vue2.js.map +1 -1
  30. package/dist/esm/components/CnFormPage/CnFormPage.vue3.js.map +1 -1
  31. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +6 -0
  32. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  33. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  34. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js +36 -0
  35. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js.map +1 -1
  36. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js +35 -23
  37. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js.map +1 -1
  38. package/dist/esm/components/CnStatusBadge/CnStatusBadge.vue2.js +6 -2
  39. package/dist/esm/components/CnStatusBadge/CnStatusBadge.vue2.js.map +1 -1
  40. package/dist/esm/components/CnStatusBadge/CnStatusBadge.vue3.js.map +1 -1
  41. package/dist/esm/composables/useFormDraft.js +11 -1
  42. package/dist/esm/composables/useFormDraft.js.map +1 -1
  43. package/dist/esm/composables/useObjectPresence.js +15 -4
  44. package/dist/esm/composables/useObjectPresence.js.map +1 -1
  45. package/dist/esm/l10n/en.json.js +7 -0
  46. package/dist/esm/l10n/en.json.js.map +1 -1
  47. package/dist/esm/l10n/nl.json.js +7 -0
  48. package/dist/esm/l10n/nl.json.js.map +1 -1
  49. package/dist/esm/nextcloud-vue.css +212 -1
  50. package/dist/esm/utils/badgeVariants.js +32 -0
  51. package/dist/esm/utils/badgeVariants.js.map +1 -0
  52. package/dist/esm/utils/validateManifestV2.compiled.js +2 -2
  53. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  54. package/dist/nextcloud-vue.cjs.js +533 -233
  55. package/dist/nextcloud-vue.cjs.js.map +2 -2
  56. package/dist/nextcloud-vue.css +212 -1
  57. package/l10n/en.json +7 -0
  58. package/l10n/nl.json +7 -0
  59. package/package.json +1 -1
  60. package/src/components/CnAiCompanion/CnAiCompanion.vue +23 -0
  61. package/src/components/CnBoardView/CnBoardView.vue +2 -1
  62. package/src/components/CnCellRenderer/CnCellRenderer.md +1 -0
  63. package/src/components/CnCellRenderer/CnCellRenderer.vue +50 -8
  64. package/src/components/CnChartWidget/CnChartWidget.vue +39 -2
  65. package/src/components/CnDashboardPage/CnDashboardPage.vue +29 -4
  66. package/src/components/CnDataTable/CnDataTable.vue +7 -2
  67. package/src/components/CnDateRangePicker/CnDateRangePicker.vue +44 -1
  68. package/src/components/CnFormDialog/CnFormDialog.vue +7 -1
  69. package/src/components/CnFormPage/CnFormPage.vue +4 -1
  70. package/src/components/CnIndexPage/CnIndexPage.vue +6 -0
  71. package/src/components/CnStatWidget/CnStatWidget.vue +52 -2
  72. package/src/components/CnStatusBadge/CnStatusBadge.vue +6 -2
  73. package/src/composables/__tests__/useObjectPresence.spec.js +24 -0
  74. package/src/composables/useFormDraft.js +11 -1
  75. package/src/composables/useObjectPresence.js +15 -4
  76. package/src/css/badge.css +31 -0
  77. package/src/css/kpi-card.css +51 -0
  78. package/src/css/look-board-index.css +36 -0
  79. package/src/css/look-board.css +8 -0
  80. package/src/schemas/app-manifest-v2.schema.json +5 -5
  81. package/src/utils/badgeVariants.js +29 -0
  82. package/src/utils/validateManifestV2.compiled.js +2 -2
@@ -3,6 +3,7 @@ import __sfc_main$1 from './CnAiChatPanel.vue.js';
3
3
  import __sfc_main from './CnAiFloatingButton.vue.js';
4
4
  import { DEFAULT_CHAT_APP_ID, chatHealthUrl } from '../../composables/aiChatConfig.js';
5
5
  import { useAiChatStream } from '../../composables/useAiChatStream.js';
6
+ import { isAppInstalled } from '../../utils/appInstalled.js';
6
7
 
7
8
  const HEALTH_TIMEOUT = 5000;
8
9
 
@@ -277,6 +278,15 @@ var script = {
277
278
  }
278
279
  },
279
280
 
281
+ /**
282
+ * Ask the chat backend whether it can answer, and render only if so.
283
+ *
284
+ * Skipped without a request when the backend app is not installed for
285
+ * this user.
286
+ *
287
+ * @return {Promise<void>}
288
+ * @spec openspec/changes/no-calls-to-missing-apps-and-presence-beacon/specs/ai-companion/spec.md#requirement-the-companion-does-not-probe-a-backend-that-is-not-installed
289
+ */
280
290
  async runHealthProbe() {
281
291
  // RETRY before hiding. A single probe makes the whole companion
282
292
  // disappear on one slow response, and "slow" is normal: measured on a
@@ -288,6 +298,19 @@ var script = {
288
298
  //
289
299
  // A backend that is genuinely down fails all attempts and is still
290
300
  // reported; this only stops one unlucky request from deciding.
301
+ //
302
+ // šŸ”“ NO PROBE AT AN APP THAT IS NOT THERE. Nextcloud already tells
303
+ // the page which apps the user has (`OC.appswebroots`), so asking a
304
+ // missing backend for its health is a guaranteed 404, three times
305
+ // per page, in every console. Measured on cloud.conduction.nl
306
+ // (round-5 check): hermiq not installed, three
307
+ // `/apps/hermiq/api/chat/health` 404s on every pipelinq and dossiq
308
+ // page. Hidden either way; now hidden without the requests.
309
+ if (!isAppInstalled(this.chatAppId || DEFAULT_CHAT_APP_ID)) {
310
+ this.probeSucceeded = false;
311
+ return
312
+ }
313
+
291
314
  for (let attempt = 1; attempt <= HEALTH_PROBE_ATTEMPTS; attempt++) {
292
315
  try {
293
316
  const response = await axios__default.get(chatHealthUrl(this.chatAppId), {
@@ -1 +1 @@
1
- {"version":3,"file":"CnAiCompanion.vue2.js","sources":["../../../../src/components/CnAiCompanion/CnAiCompanion.vue"],"sourcesContent":["<!--\n CnAiCompanion — top-level mount for the AI Chat Companion widget.\n\n On created():\n - Issues GET /index.php/apps/{chatAppId}/api/chat/health via axios.\n - Renders nothing on non-2xx, network error, or timeout (5s).\n - Probe result cached for component lifetime.\n - Only console.info() on failure (never warn/error).\n\n When probe succeeds:\n - Renders CnAiFloatingButton ALWAYS — it toggles the window rather than only\n opening it, and stays visible while the window is open.\n - Renders CnAiChatPanel (when isPanelOpen) as a floating window anchored to the\n same corner as the hex, offset clear of it so both stay clickable.\n\n FAB and panel both hidden when cnAiContext.pageKind === 'chat'.\n-->\n<template>\n\t<div\n\t\tv-if=\"probeSucceeded && !isChatPage && isPrimaryCompanion\"\n\t\tclass=\"cn-ai-companion\"\n\t\tdata-testid=\"cn-ai-companion\">\n\t\t<!--\n\t\t The hex is rendered UNCONDITIONALLY and toggles the window.\n\n\t\t It used to be `:visible=\"!isPanelOpen\"` — the launcher vanished while\n\t\t the thing it launched was open. Three reasons it now stays, in order of\n\t\t weight:\n\n\t\t 1. It is the one control we can guarantee. The window's own close\n\t\t button lives in markup a host page's stylesheet could hide; the hex\n\t\t is fixed-position with explicit `!important` properties and has\n\t\t survived every host it has been dropped into, including third-party\n\t\t office editors.\n\t\t 2. A launcher that disappears is a dead end — the affordance you used\n\t\t to summon something should dismiss it.\n\t\t 3. It removes a state transition: no show/hide to coordinate with the\n\t\t window's own.\n\n\t\t āš ļø This is why the window anchors 70px from the edge: the hex is 26x30\n\t\t at a 24px inset, and the two must not overlap or the guarantee above is\n\t\t worth nothing.\n\t\t-->\n\t\t<CnAiFloatingButton\n\t\t\t:visible=\"true\"\n\t\t\t:position=\"position\"\n\t\t\t@click=\"togglePanel\" />\n\t\t<CnAiChatPanel\n\t\t\tref=\"panel\"\n\t\t\t:visible=\"isPanelOpen\"\n\t\t\t:streamState=\"stream.state\"\n\t\t\t:chatAppId=\"chatAppId\"\n\t\t\t:context=\"effectiveContext\"\n\t\t\t:position=\"position\"\n\t\t\t:fabRef=\"$refs.fabButton\"\n\t\t\t@close=\"closePanel\"\n\t\t\t@send=\"onSend\"\n\t\t\t@newThread=\"onNewThread\"\n\t\t\t@loadConversation=\"onLoadConversation\" />\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport CnAiChatPanel from './CnAiChatPanel.vue'\nimport CnAiFloatingButton from './CnAiFloatingButton.vue'\nimport { chatHealthUrl, DEFAULT_CHAT_APP_ID } from '../../composables/aiChatConfig.js'\nimport { useAiChatStream } from '../../composables/useAiChatStream.js'\n\nconst HEALTH_TIMEOUT = 5000\n\n/** How many times the health probe may fail before the companion hides. */\nconst HEALTH_PROBE_ATTEMPTS = 3\n\n/** Base backoff between probe attempts, multiplied by the attempt number. */\nconst HEALTH_RETRY_DELAY = 750\n\n/**\n * The window key one companion claims so a second one stands down.\n *\n * On `window` rather than in module scope, because the two companions on a page\n * do not share a module instance: one comes from the host app's bundle and one\n * from a standalone bundle attached to every page. Two copies of this file are\n * loaded, so a module-level flag would be two flags and would guard nothing.\n */\nconst COMPANION_SINGLETON_KEY = '__cnAiCompanionPrimary'\n\n/**\n * How long to wait before looking for a companion that cannot stand down.\n *\n * Long enough for a host app's Vue tree to boot after a standalone mount at\n * DOMContentLoaded, short enough that a user never sees two hexes settle.\n */\nconst LEGACY_SIBLING_DELAY = 1200\n\nexport default {\n\tname: 'CnAiCompanion',\n\n\tcomponents: {\n\t\tCnAiFloatingButton,\n\t\tCnAiChatPanel,\n\t},\n\n\tinject: {\n\t\tcnAiContext: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Default position for the FAB.\n\t\t *\n\t\t * @type {'bottom-right'|'bottom-left'|'top-right'|'top-left'}\n\t\t */\n\t\tposition: {\n\t\t\ttype: String,\n\t\t\tdefault: 'bottom-right',\n\t\t},\n\n\t\t/**\n\t\t * Backend app id that answers the chat/health/conversation HTTP calls\n\t\t * (`/index.php/apps/{chatAppId}/api/...`). Single configuration point for\n\t\t * the AI Chat Companion's backend — see composables/aiChatConfig.js.\n\t\t * Defaults to `hermiq` (the agent engine's home per hydra ADR-034\n\t\t * \"Amendment 2026-07-05\"); `CnAppRoot` forwards its own `chatAppId`\n\t\t * prop here so a consuming app can point the widget at another backend\n\t\t * (e.g. `openregister` during its compat window) in one place.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tchatAppId: {\n\t\t\ttype: String,\n\t\t\tdefault: DEFAULT_CHAT_APP_ID,\n\t\t},\n\n\t\t/**\n\t\t * What the user is looking at, stated by whoever mounted the companion.\n\t\t *\n\t\t * Inside a Conduction app, CnAppRoot provides this and the prop is\n\t\t * unnecessary. Mounted standalone on a page belonging to another app —\n\t\t * an office editor, the Files list — there is no provider, and the\n\t\t * injected fallback reports `appId: 'unknown'`. The agent then has no\n\t\t * idea what \"this document\" refers to and says so.\n\t\t *\n\t\t * Shape mirrors the injected context: `{ appId, pageKind, fileId,\n\t\t * objectUuid, registerSlug, schemaSlug, route }`. All optional; whatever\n\t\t * the host knows is better than 'unknown'.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tcontext: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tprobeSucceeded: false,\n\t\t\tisPanelOpen: false,\n\t\t\tisPrimaryCompanion: false,\n\t\t\t// Cleared on unmount so a torn-down companion cannot stand itself\n\t\t\t// down after the fact.\n\t\t\tlegacySiblingTimer: null,\n\t\t\tstream: useAiChatStream(this, { chatAppId: this.chatAppId, context: this.context }),\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tisChatPage() {\n\t\t\tconst ctx = this.cnAiContext\n\t\t\treturn ctx && ctx.pageKind === 'chat'\n\t\t},\n\n\t\t/**\n\t\t * The page context the panel reasons with: the prop when a standalone\n\t\t * mount passed one, otherwise the context CnAppRoot provides.\n\t\t *\n\t\t * WHY THIS EXISTS\n\t\t * ---------------\n\t\t * `CnAppRoot` renders `<CnAiCompanion :chatAppId=\"chatAppId\" />` and\n\t\t * passes NO `:context`, because it already provides `cnAiContext` for\n\t\t * descendants to inject. This component injected it for `isChatPage`\n\t\t * but handed the panel the raw `context` PROP, which is `null` in that\n\t\t * arrangement — so inside every app shell the panel ran with no\n\t\t * context at all.\n\t\t *\n\t\t * The panel's `relevantAgentOptions` treats an empty context as \"no\n\t\t * page to be relevant to\" and returns EVERY agent, so it selected\n\t\t * whichever agent the API happened to list first. Measured on the\n\t\t * demo instance 2026-09-20: on `/apps/buildiq/` the companion opened\n\t\t * as \"Hydra Triage\", which holds only `hydra.*` tools, and its first\n\t\t * answer was \"This agent's tool grants resolve to no tools\" — while\n\t\t * \"Buildiq builder\", holding all eight `buildiq_*` tools, sat unused\n\t\t * at the bottom of the same list.\n\t\t *\n\t\t * A standalone mount that passes `context` explicitly still wins, so\n\t\t * Hermiq's cross-app companion is unaffected.\n\t\t *\n\t\t * @return {object|null} The context to reason with.\n\t\t */\n\t\teffectiveContext() {\n\t\t\treturn this.context || this.cnAiContext || null\n\t\t},\n\t},\n\n\tcreated() {\n\t\tthis.runHealthProbe()\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this.legacySiblingTimer !== null) {\n\t\t\tclearTimeout(this.legacySiblingTimer)\n\t\t\tthis.legacySiblingTimer = null\n\t\t}\n\n\t\tthis.releaseSingleton()\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Stand down if another companion is on the page that cannot stand down.\n\t\t *\n\t\t * šŸ”“ THE WINDOW FLAG ONLY BINDS INSTANCES THAT CHECK IT. Measured on a\n\t\t * live instance after shipping the flag: still TWO hexes, stacked at the\n\t\t * same coordinates — one from `#openregister` (the host app's own bundle,\n\t\t * built against an older version of this library) and one from\n\t\t * `#hermiq-companion-root` (the standalone mount, built against the new\n\t\t * one). The old bundle never reads the flag, so it renders regardless,\n\t\t * and the guarded instance had already claimed the slot and rendered too.\n\t\t *\n\t\t * The library fix alone therefore does not reach a page until EVERY app\n\t\t * on it has rebuilt — which is not something a user with a double hex\n\t\t * can wait for. So the instance that CAN yield does.\n\t\t *\n\t\t * Deferred rather than checked at mount, because order is against us: a\n\t\t * standalone companion mounts at DOMContentLoaded and the host app's Vue\n\t\t * tree boots after it, so at mount time there is nothing to see.\n\t\t *\n\t\t * When both companions carry this guard the flag has already stopped the\n\t\t * second one, so this never fires — it is strictly a bridge for mixed\n\t\t * versions, and it costs one timeout.\n\t\t */\n\t\tyieldToACompanionThatCannotYield() {\n\t\t\tif (typeof document === 'undefined' || this.isPrimaryCompanion !== true) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.legacySiblingTimer = setTimeout(() => {\n\t\t\t\tthis.legacySiblingTimer = null\n\n\t\t\t\tconst rendered = document.querySelectorAll('[data-testid=\"cn-ai-companion\"]')\n\t\t\t\tif (rendered.length <= 1) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tfor (const el of rendered) {\n\t\t\t\t\tif (el !== this.$el) {\n\t\t\t\t\t\t// Yield to it: the host app's own companion sits inside\n\t\t\t\t\t\t// that app's tree and carries its page context, which a\n\t\t\t\t\t\t// standalone mount can only approximate.\n\t\t\t\t\t\tthis.releaseSingleton()\n\t\t\t\t\t\tthis.isPrimaryCompanion = false\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, LEGACY_SIBLING_DELAY)\n\t\t},\n\n\t\t/**\n\t\t * Claim the page's single companion slot, or stand down.\n\t\t *\n\t\t * šŸ”“ TWO COMPANIONS ON ONE PAGE IS A REACHABLE STATE, and it was reached:\n\t\t * `CnAppRoot` renders a companion for any app that sets `aiCompanion`,\n\t\t * while a host app can also mount one standalone on every page of the\n\t\t * instance (Hermiq does exactly this, so the assistant reaches\n\t\t * third-party office editors that have no CnAppRoot of ours). On any\n\t\t * page that has both, the user saw TWO hexes stacked a few pixels apart\n\t\t * — the two mounts pick up different bundled stylesheets, so they do not\n\t\t * even land in the same place.\n\t\t *\n\t\t * The guard lives HERE, in the component, rather than in each host's\n\t\t * mount script, because only the component knows how many of itself\n\t\t * exist. A host-side check cannot see a sibling that mounts later: the\n\t\t * standalone script runs at DOMContentLoaded and the app's own Vue tree\n\t\t * boots after it, so whichever check runs first sees nothing and both\n\t\t * render.\n\t\t *\n\t\t * First to claim wins and the rest render nothing. That order is stable\n\t\t * in practice — the standalone mount runs first — but the rule does not\n\t\t * depend on it: what matters is that exactly one renders, not which.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tclaimSingleton() {\n\t\t\t// šŸ”“ CLAIMED ONLY WHEN THIS INSTANCE WOULD ACTUALLY RENDER.\n\t\t\t//\n\t\t\t// An earlier version claimed in `created()`, before the health probe\n\t\t\t// had answered — so a companion whose probe FAILED still took the\n\t\t\t// slot and stood the other one down, turning \"one companion\" into\n\t\t\t// NONE. Measured on a slow instance, where the probe's 3Ɨ5s budget\n\t\t\t// is genuinely marginal: the slot was claimed and nothing rendered.\n\t\t\t//\n\t\t\t// Claiming late is also why the claim is not in a `watch` on the\n\t\t\t// window key: the slot is contended exactly once per page, at the\n\t\t\t// moment each candidate learns it can render.\n\t\t\tif (this.probeSucceeded !== true || this.isChatPage === true) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst scope = typeof window !== 'undefined' ? window : null\n\t\t\tif (scope === null) {\n\t\t\t\t// No window (SSR, a bare unit test): nothing else can be\n\t\t\t\t// rendering, so this instance is the only one by definition.\n\t\t\t\tthis.isPrimaryCompanion = true\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (scope[COMPANION_SINGLETON_KEY] === null || scope[COMPANION_SINGLETON_KEY] === undefined) {\n\t\t\t\tscope[COMPANION_SINGLETON_KEY] = this\n\t\t\t\tthis.isPrimaryCompanion = true\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.isPrimaryCompanion = scope[COMPANION_SINGLETON_KEY] === this\n\t\t},\n\n\t\t/**\n\t\t * Give the slot back, but only if this instance is holding it.\n\t\t *\n\t\t * Checked rather than cleared unconditionally: a second, standing-down\n\t\t * instance unmounting must not release the slot the FIRST one is still\n\t\t * using, which would let a third mount render alongside it.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\treleaseSingleton() {\n\t\t\tconst scope = typeof window !== 'undefined' ? window : null\n\t\t\tif (scope !== null && scope[COMPANION_SINGLETON_KEY] === this) {\n\t\t\t\tscope[COMPANION_SINGLETON_KEY] = null\n\t\t\t}\n\t\t},\n\n\t\tasync runHealthProbe() {\n\t\t\t// RETRY before hiding. A single probe makes the whole companion\n\t\t\t// disappear on one slow response, and \"slow\" is normal: measured on a\n\t\t\t// busy instance (load 48) the health endpoint answered in well under a\n\t\t\t// second, but the request still lost its 5s budget to contention. The\n\t\t\t// failure mode is the worst kind — the widget is simply absent, with\n\t\t\t// nothing on screen saying why, and a reload usually \"fixes\" it, which\n\t\t\t// is what makes it read as flakiness rather than as a probe result.\n\t\t\t//\n\t\t\t// A backend that is genuinely down fails all attempts and is still\n\t\t\t// reported; this only stops one unlucky request from deciding.\n\t\t\tfor (let attempt = 1; attempt <= HEALTH_PROBE_ATTEMPTS; attempt++) {\n\t\t\t\ttry {\n\t\t\t\t\tconst response = await axios.get(chatHealthUrl(this.chatAppId), {\n\t\t\t\t\t\ttimeout: HEALTH_TIMEOUT,\n\t\t\t\t\t\tvalidateStatus: (status) => status >= 200 && status < 300,\n\t\t\t\t\t})\n\t\t\t\t\tthis.probeSucceeded = response.status >= 200 && response.status < 300\n\t\t\t\t\t// Contend for the page's single slot only now, with a\n\t\t\t\t\t// backend that answered. See claimSingleton().\n\t\t\t\t\tthis.claimSingleton()\n\t\t\t\t\t// A companion built against an older version of this library\n\t\t\t\t\t// cannot read the flag above, so look for one shortly.\n\t\t\t\t\tthis.yieldToACompanionThatCannotYield()\n\t\t\t\t\treturn\n\t\t\t\t} catch {\n\t\t\t\t\tif (attempt < HEALTH_PROBE_ATTEMPTS) {\n\t\t\t\t\t\tawait new Promise((resolve) => {\n\t\t\t\t\t\t\tsetTimeout(resolve, HEALTH_RETRY_DELAY * attempt)\n\t\t\t\t\t\t})\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.info(`[CnAiCompanion] chat backend \"${this.chatAppId}\" health probe did not return 2xx `\n\t\t\t\t\t\t+ `after ${HEALTH_PROBE_ATTEMPTS} attempts — widget hidden`)\n\t\t\t\t\tthis.probeSucceeded = false\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The hex's own handler: open when closed, close when open.\n\t\t *\n\t\t * The launcher stays visible while the window is open (see the template),\n\t\t * so it has to answer for both directions rather than only opening.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\ttogglePanel() {\n\t\t\tif (this.isPanelOpen) {\n\t\t\t\tthis.closePanel()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.openPanel()\n\t\t},\n\n\t\topenPanel() {\n\t\t\tthis.isPanelOpen = true\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tif (this.$refs.panel && this.$refs.panel.$refs.input) {\n\t\t\t\t\tthis.$refs.panel.$refs.input.focus()\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\tclosePanel() {\n\t\t\tthis.isPanelOpen = false\n\t\t},\n\n\t\tonSend(text, agentUuid, attachments) {\n\t\t\tthis.stream.send(text, { agentUuid, attachments }).catch((err) => {\n\t\t\t\t// Stream errors are tracked in stream.state.error — no extra handling needed\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.info('[CnAiCompanion] send error:', err?.message)\n\t\t\t})\n\t\t},\n\n\t\tonNewThread() {\n\t\t\tthis.stream.startNewThread()\n\t\t},\n\n\t\tonLoadConversation(uuid) {\n\t\t\tthis.stream.loadConversation(uuid)\n\t\t},\n\t},\n}\n</script>\n\n<style>\n.cn-ai-companion {\n\t/*\n\t * display: contents removes this wrapper from the layout tree so the\n\t * embedded NcAppSidebar inherits NcContent as its flex parent — required\n\t * for the sidebar to slide in from the RIGHT edge. The FAB is itself\n\t * position:fixed so it positions independently of the wrapper's box.\n\t *\n\t * !important is intentional: webpack pulls in BOTH the old (position:\n\t * fixed) and new (display: contents) rules from the package's CJS and\n\t * ESM builds; without !important the old rule wins the cascade and the\n\t * sidebar renders at the left.\n\t */\n\tdisplay: contents !important;\n\tposition: static !important;\n}\n</style>\n"],"names":["CnAiFloatingButton","CnAiChatPanel","axios"],"mappings":";;;;;;AAqEA,MAAM,cAAe,GAAE,KAAG;;AAE1B;AACA,MAAM,qBAAoB,GAAI,EAAA;;AAE9B;AACA,MAAM,kBAAiB,GAAI,IAAE;;AAE7B;;AAEC;AACA;AACA;AACA;AACA;;AAED,MAAM,uBAAwB,GAAE,yBAAuB;;AAEvD;;AAEC;;;;AAID,MAAM,oBAAqB,GAAE,KAAG;;AAEhC,aAAe;AACd,CAAA,IAAI,EAAE,eAAe;;CAErB,UAAU,EAAE;AACX,sBAAAA,UAAkB;iBAClBC,YAAa;EACb;;AAED,CAAA,MAAM,EAAE;EACP,WAAW,EAAE,EAAE,OAAO,EAAE,IAAG,EAAG;EAC9B;;AAED,CAAA,KAAK,EAAE;AACN;;AAEC;;;AAGD,EAAA,QAAQ,EAAE;GACT,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,cAAc;GACvB;;AAED;;AAEC;;;;;;AAMA;;;EAGD,SAAS,EAAE;GACV,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,mBAAmB;GAC5B;;AAED;;AAEC;;;;;AAKA;AACA;;AAEA;AACA;AACA;AACA;;AAED,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,IAAI;GACb;EACD;;AAED,CAAA,IAAI,GAAG;AACN,EAAA,OAAO;AACN,GAAA,cAAc,EAAE,KAAK;AACrB,GAAA,WAAW,EAAE,KAAK;GAClB,kBAAkB,EAAE,KAAK;;AAEzB;GACA,kBAAkB,EAAE,IAAI;AACxB,GAAA,MAAM,EAAE,eAAe,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,OAAM,EAAG,CAAC;A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,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAC;AACpC,KAAA;IACA,EAAA;GACD;;EAED,UAAU,GAAG;AACZ,GAAA,IAAI,CAAC,WAAU,GAAI,MAAI;GACvB;;AAED,EAAA,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE;GACpC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,WAAY,EAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK;AACjE;AACA;IACA,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,GAAG,EAAE,OAAO,EAAA;IACxD,EAAA;GACD;;EAED,WAAW,GAAG;GACb,IAAI,CAAC,MAAM,CAAC,cAAc,GAAC;GAC3B;;EAED,kBAAkB,CAAC,IAAI,EAAE;AACxB,GAAA,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAA;GACjC;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnAiCompanion.vue2.js","sources":["../../../../src/components/CnAiCompanion/CnAiCompanion.vue"],"sourcesContent":["<!--\n CnAiCompanion — top-level mount for the AI Chat Companion widget.\n\n On created():\n - Issues GET /index.php/apps/{chatAppId}/api/chat/health via axios.\n - Renders nothing on non-2xx, network error, or timeout (5s).\n - Probe result cached for component lifetime.\n - Only console.info() on failure (never warn/error).\n\n When probe succeeds:\n - Renders CnAiFloatingButton ALWAYS — it toggles the window rather than only\n opening it, and stays visible while the window is open.\n - Renders CnAiChatPanel (when isPanelOpen) as a floating window anchored to the\n same corner as the hex, offset clear of it so both stay clickable.\n\n FAB and panel both hidden when cnAiContext.pageKind === 'chat'.\n-->\n<template>\n\t<div\n\t\tv-if=\"probeSucceeded && !isChatPage && isPrimaryCompanion\"\n\t\tclass=\"cn-ai-companion\"\n\t\tdata-testid=\"cn-ai-companion\">\n\t\t<!--\n\t\t The hex is rendered UNCONDITIONALLY and toggles the window.\n\n\t\t It used to be `:visible=\"!isPanelOpen\"` — the launcher vanished while\n\t\t the thing it launched was open. Three reasons it now stays, in order of\n\t\t weight:\n\n\t\t 1. It is the one control we can guarantee. The window's own close\n\t\t button lives in markup a host page's stylesheet could hide; the hex\n\t\t is fixed-position with explicit `!important` properties and has\n\t\t survived every host it has been dropped into, including third-party\n\t\t office editors.\n\t\t 2. A launcher that disappears is a dead end — the affordance you used\n\t\t to summon something should dismiss it.\n\t\t 3. It removes a state transition: no show/hide to coordinate with the\n\t\t window's own.\n\n\t\t āš ļø This is why the window anchors 70px from the edge: the hex is 26x30\n\t\t at a 24px inset, and the two must not overlap or the guarantee above is\n\t\t worth nothing.\n\t\t-->\n\t\t<CnAiFloatingButton\n\t\t\t:visible=\"true\"\n\t\t\t:position=\"position\"\n\t\t\t@click=\"togglePanel\" />\n\t\t<CnAiChatPanel\n\t\t\tref=\"panel\"\n\t\t\t:visible=\"isPanelOpen\"\n\t\t\t:streamState=\"stream.state\"\n\t\t\t:chatAppId=\"chatAppId\"\n\t\t\t:context=\"effectiveContext\"\n\t\t\t:position=\"position\"\n\t\t\t:fabRef=\"$refs.fabButton\"\n\t\t\t@close=\"closePanel\"\n\t\t\t@send=\"onSend\"\n\t\t\t@newThread=\"onNewThread\"\n\t\t\t@loadConversation=\"onLoadConversation\" />\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport CnAiChatPanel from './CnAiChatPanel.vue'\nimport CnAiFloatingButton from './CnAiFloatingButton.vue'\nimport { chatHealthUrl, DEFAULT_CHAT_APP_ID } from '../../composables/aiChatConfig.js'\nimport { useAiChatStream } from '../../composables/useAiChatStream.js'\nimport { isAppInstalled } from '../../utils/appInstalled.js'\n\nconst HEALTH_TIMEOUT = 5000\n\n/** How many times the health probe may fail before the companion hides. */\nconst HEALTH_PROBE_ATTEMPTS = 3\n\n/** Base backoff between probe attempts, multiplied by the attempt number. */\nconst HEALTH_RETRY_DELAY = 750\n\n/**\n * The window key one companion claims so a second one stands down.\n *\n * On `window` rather than in module scope, because the two companions on a page\n * do not share a module instance: one comes from the host app's bundle and one\n * from a standalone bundle attached to every page. Two copies of this file are\n * loaded, so a module-level flag would be two flags and would guard nothing.\n */\nconst COMPANION_SINGLETON_KEY = '__cnAiCompanionPrimary'\n\n/**\n * How long to wait before looking for a companion that cannot stand down.\n *\n * Long enough for a host app's Vue tree to boot after a standalone mount at\n * DOMContentLoaded, short enough that a user never sees two hexes settle.\n */\nconst LEGACY_SIBLING_DELAY = 1200\n\nexport default {\n\tname: 'CnAiCompanion',\n\n\tcomponents: {\n\t\tCnAiFloatingButton,\n\t\tCnAiChatPanel,\n\t},\n\n\tinject: {\n\t\tcnAiContext: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Default position for the FAB.\n\t\t *\n\t\t * @type {'bottom-right'|'bottom-left'|'top-right'|'top-left'}\n\t\t */\n\t\tposition: {\n\t\t\ttype: String,\n\t\t\tdefault: 'bottom-right',\n\t\t},\n\n\t\t/**\n\t\t * Backend app id that answers the chat/health/conversation HTTP calls\n\t\t * (`/index.php/apps/{chatAppId}/api/...`). Single configuration point for\n\t\t * the AI Chat Companion's backend — see composables/aiChatConfig.js.\n\t\t * Defaults to `hermiq` (the agent engine's home per hydra ADR-034\n\t\t * \"Amendment 2026-07-05\"); `CnAppRoot` forwards its own `chatAppId`\n\t\t * prop here so a consuming app can point the widget at another backend\n\t\t * (e.g. `openregister` during its compat window) in one place.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tchatAppId: {\n\t\t\ttype: String,\n\t\t\tdefault: DEFAULT_CHAT_APP_ID,\n\t\t},\n\n\t\t/**\n\t\t * What the user is looking at, stated by whoever mounted the companion.\n\t\t *\n\t\t * Inside a Conduction app, CnAppRoot provides this and the prop is\n\t\t * unnecessary. Mounted standalone on a page belonging to another app —\n\t\t * an office editor, the Files list — there is no provider, and the\n\t\t * injected fallback reports `appId: 'unknown'`. The agent then has no\n\t\t * idea what \"this document\" refers to and says so.\n\t\t *\n\t\t * Shape mirrors the injected context: `{ appId, pageKind, fileId,\n\t\t * objectUuid, registerSlug, schemaSlug, route }`. All optional; whatever\n\t\t * the host knows is better than 'unknown'.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tcontext: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tprobeSucceeded: false,\n\t\t\tisPanelOpen: false,\n\t\t\tisPrimaryCompanion: false,\n\t\t\t// Cleared on unmount so a torn-down companion cannot stand itself\n\t\t\t// down after the fact.\n\t\t\tlegacySiblingTimer: null,\n\t\t\tstream: useAiChatStream(this, { chatAppId: this.chatAppId, context: this.context }),\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tisChatPage() {\n\t\t\tconst ctx = this.cnAiContext\n\t\t\treturn ctx && ctx.pageKind === 'chat'\n\t\t},\n\n\t\t/**\n\t\t * The page context the panel reasons with: the prop when a standalone\n\t\t * mount passed one, otherwise the context CnAppRoot provides.\n\t\t *\n\t\t * WHY THIS EXISTS\n\t\t * ---------------\n\t\t * `CnAppRoot` renders `<CnAiCompanion :chatAppId=\"chatAppId\" />` and\n\t\t * passes NO `:context`, because it already provides `cnAiContext` for\n\t\t * descendants to inject. This component injected it for `isChatPage`\n\t\t * but handed the panel the raw `context` PROP, which is `null` in that\n\t\t * arrangement — so inside every app shell the panel ran with no\n\t\t * context at all.\n\t\t *\n\t\t * The panel's `relevantAgentOptions` treats an empty context as \"no\n\t\t * page to be relevant to\" and returns EVERY agent, so it selected\n\t\t * whichever agent the API happened to list first. Measured on the\n\t\t * demo instance 2026-09-20: on `/apps/buildiq/` the companion opened\n\t\t * as \"Hydra Triage\", which holds only `hydra.*` tools, and its first\n\t\t * answer was \"This agent's tool grants resolve to no tools\" — while\n\t\t * \"Buildiq builder\", holding all eight `buildiq_*` tools, sat unused\n\t\t * at the bottom of the same list.\n\t\t *\n\t\t * A standalone mount that passes `context` explicitly still wins, so\n\t\t * Hermiq's cross-app companion is unaffected.\n\t\t *\n\t\t * @return {object|null} The context to reason with.\n\t\t */\n\t\teffectiveContext() {\n\t\t\treturn this.context || this.cnAiContext || null\n\t\t},\n\t},\n\n\tcreated() {\n\t\tthis.runHealthProbe()\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this.legacySiblingTimer !== null) {\n\t\t\tclearTimeout(this.legacySiblingTimer)\n\t\t\tthis.legacySiblingTimer = null\n\t\t}\n\n\t\tthis.releaseSingleton()\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Stand down if another companion is on the page that cannot stand down.\n\t\t *\n\t\t * šŸ”“ THE WINDOW FLAG ONLY BINDS INSTANCES THAT CHECK IT. Measured on a\n\t\t * live instance after shipping the flag: still TWO hexes, stacked at the\n\t\t * same coordinates — one from `#openregister` (the host app's own bundle,\n\t\t * built against an older version of this library) and one from\n\t\t * `#hermiq-companion-root` (the standalone mount, built against the new\n\t\t * one). The old bundle never reads the flag, so it renders regardless,\n\t\t * and the guarded instance had already claimed the slot and rendered too.\n\t\t *\n\t\t * The library fix alone therefore does not reach a page until EVERY app\n\t\t * on it has rebuilt — which is not something a user with a double hex\n\t\t * can wait for. So the instance that CAN yield does.\n\t\t *\n\t\t * Deferred rather than checked at mount, because order is against us: a\n\t\t * standalone companion mounts at DOMContentLoaded and the host app's Vue\n\t\t * tree boots after it, so at mount time there is nothing to see.\n\t\t *\n\t\t * When both companions carry this guard the flag has already stopped the\n\t\t * second one, so this never fires — it is strictly a bridge for mixed\n\t\t * versions, and it costs one timeout.\n\t\t */\n\t\tyieldToACompanionThatCannotYield() {\n\t\t\tif (typeof document === 'undefined' || this.isPrimaryCompanion !== true) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.legacySiblingTimer = setTimeout(() => {\n\t\t\t\tthis.legacySiblingTimer = null\n\n\t\t\t\tconst rendered = document.querySelectorAll('[data-testid=\"cn-ai-companion\"]')\n\t\t\t\tif (rendered.length <= 1) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tfor (const el of rendered) {\n\t\t\t\t\tif (el !== this.$el) {\n\t\t\t\t\t\t// Yield to it: the host app's own companion sits inside\n\t\t\t\t\t\t// that app's tree and carries its page context, which a\n\t\t\t\t\t\t// standalone mount can only approximate.\n\t\t\t\t\t\tthis.releaseSingleton()\n\t\t\t\t\t\tthis.isPrimaryCompanion = false\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, LEGACY_SIBLING_DELAY)\n\t\t},\n\n\t\t/**\n\t\t * Claim the page's single companion slot, or stand down.\n\t\t *\n\t\t * šŸ”“ TWO COMPANIONS ON ONE PAGE IS A REACHABLE STATE, and it was reached:\n\t\t * `CnAppRoot` renders a companion for any app that sets `aiCompanion`,\n\t\t * while a host app can also mount one standalone on every page of the\n\t\t * instance (Hermiq does exactly this, so the assistant reaches\n\t\t * third-party office editors that have no CnAppRoot of ours). On any\n\t\t * page that has both, the user saw TWO hexes stacked a few pixels apart\n\t\t * — the two mounts pick up different bundled stylesheets, so they do not\n\t\t * even land in the same place.\n\t\t *\n\t\t * The guard lives HERE, in the component, rather than in each host's\n\t\t * mount script, because only the component knows how many of itself\n\t\t * exist. A host-side check cannot see a sibling that mounts later: the\n\t\t * standalone script runs at DOMContentLoaded and the app's own Vue tree\n\t\t * boots after it, so whichever check runs first sees nothing and both\n\t\t * render.\n\t\t *\n\t\t * First to claim wins and the rest render nothing. That order is stable\n\t\t * in practice — the standalone mount runs first — but the rule does not\n\t\t * depend on it: what matters is that exactly one renders, not which.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tclaimSingleton() {\n\t\t\t// šŸ”“ CLAIMED ONLY WHEN THIS INSTANCE WOULD ACTUALLY RENDER.\n\t\t\t//\n\t\t\t// An earlier version claimed in `created()`, before the health probe\n\t\t\t// had answered — so a companion whose probe FAILED still took the\n\t\t\t// slot and stood the other one down, turning \"one companion\" into\n\t\t\t// NONE. Measured on a slow instance, where the probe's 3Ɨ5s budget\n\t\t\t// is genuinely marginal: the slot was claimed and nothing rendered.\n\t\t\t//\n\t\t\t// Claiming late is also why the claim is not in a `watch` on the\n\t\t\t// window key: the slot is contended exactly once per page, at the\n\t\t\t// moment each candidate learns it can render.\n\t\t\tif (this.probeSucceeded !== true || this.isChatPage === true) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst scope = typeof window !== 'undefined' ? window : null\n\t\t\tif (scope === null) {\n\t\t\t\t// No window (SSR, a bare unit test): nothing else can be\n\t\t\t\t// rendering, so this instance is the only one by definition.\n\t\t\t\tthis.isPrimaryCompanion = true\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (scope[COMPANION_SINGLETON_KEY] === null || scope[COMPANION_SINGLETON_KEY] === undefined) {\n\t\t\t\tscope[COMPANION_SINGLETON_KEY] = this\n\t\t\t\tthis.isPrimaryCompanion = true\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.isPrimaryCompanion = scope[COMPANION_SINGLETON_KEY] === this\n\t\t},\n\n\t\t/**\n\t\t * Give the slot back, but only if this instance is holding it.\n\t\t *\n\t\t * Checked rather than cleared unconditionally: a second, standing-down\n\t\t * instance unmounting must not release the slot the FIRST one is still\n\t\t * using, which would let a third mount render alongside it.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\treleaseSingleton() {\n\t\t\tconst scope = typeof window !== 'undefined' ? window : null\n\t\t\tif (scope !== null && scope[COMPANION_SINGLETON_KEY] === this) {\n\t\t\t\tscope[COMPANION_SINGLETON_KEY] = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Ask the chat backend whether it can answer, and render only if so.\n\t\t *\n\t\t * Skipped without a request when the backend app is not installed for\n\t\t * this user.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/no-calls-to-missing-apps-and-presence-beacon/specs/ai-companion/spec.md#requirement-the-companion-does-not-probe-a-backend-that-is-not-installed\n\t\t */\n\t\tasync runHealthProbe() {\n\t\t\t// RETRY before hiding. A single probe makes the whole companion\n\t\t\t// disappear on one slow response, and \"slow\" is normal: measured on a\n\t\t\t// busy instance (load 48) the health endpoint answered in well under a\n\t\t\t// second, but the request still lost its 5s budget to contention. The\n\t\t\t// failure mode is the worst kind — the widget is simply absent, with\n\t\t\t// nothing on screen saying why, and a reload usually \"fixes\" it, which\n\t\t\t// is what makes it read as flakiness rather than as a probe result.\n\t\t\t//\n\t\t\t// A backend that is genuinely down fails all attempts and is still\n\t\t\t// reported; this only stops one unlucky request from deciding.\n\t\t\t//\n\t\t\t// šŸ”“ NO PROBE AT AN APP THAT IS NOT THERE. Nextcloud already tells\n\t\t\t// the page which apps the user has (`OC.appswebroots`), so asking a\n\t\t\t// missing backend for its health is a guaranteed 404, three times\n\t\t\t// per page, in every console. Measured on cloud.conduction.nl\n\t\t\t// (round-5 check): hermiq not installed, three\n\t\t\t// `/apps/hermiq/api/chat/health` 404s on every pipelinq and dossiq\n\t\t\t// page. Hidden either way; now hidden without the requests.\n\t\t\tif (!isAppInstalled(this.chatAppId || DEFAULT_CHAT_APP_ID)) {\n\t\t\t\tthis.probeSucceeded = false\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor (let attempt = 1; attempt <= HEALTH_PROBE_ATTEMPTS; attempt++) {\n\t\t\t\ttry {\n\t\t\t\t\tconst response = await axios.get(chatHealthUrl(this.chatAppId), {\n\t\t\t\t\t\ttimeout: HEALTH_TIMEOUT,\n\t\t\t\t\t\tvalidateStatus: (status) => status >= 200 && status < 300,\n\t\t\t\t\t})\n\t\t\t\t\tthis.probeSucceeded = response.status >= 200 && response.status < 300\n\t\t\t\t\t// Contend for the page's single slot only now, with a\n\t\t\t\t\t// backend that answered. See claimSingleton().\n\t\t\t\t\tthis.claimSingleton()\n\t\t\t\t\t// A companion built against an older version of this library\n\t\t\t\t\t// cannot read the flag above, so look for one shortly.\n\t\t\t\t\tthis.yieldToACompanionThatCannotYield()\n\t\t\t\t\treturn\n\t\t\t\t} catch {\n\t\t\t\t\tif (attempt < HEALTH_PROBE_ATTEMPTS) {\n\t\t\t\t\t\tawait new Promise((resolve) => {\n\t\t\t\t\t\t\tsetTimeout(resolve, HEALTH_RETRY_DELAY * attempt)\n\t\t\t\t\t\t})\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.info(`[CnAiCompanion] chat backend \"${this.chatAppId}\" health probe did not return 2xx `\n\t\t\t\t\t\t+ `after ${HEALTH_PROBE_ATTEMPTS} attempts — widget hidden`)\n\t\t\t\t\tthis.probeSucceeded = false\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The hex's own handler: open when closed, close when open.\n\t\t *\n\t\t * The launcher stays visible while the window is open (see the template),\n\t\t * so it has to answer for both directions rather than only opening.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\ttogglePanel() {\n\t\t\tif (this.isPanelOpen) {\n\t\t\t\tthis.closePanel()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.openPanel()\n\t\t},\n\n\t\topenPanel() {\n\t\t\tthis.isPanelOpen = true\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tif (this.$refs.panel && this.$refs.panel.$refs.input) {\n\t\t\t\t\tthis.$refs.panel.$refs.input.focus()\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\tclosePanel() {\n\t\t\tthis.isPanelOpen = false\n\t\t},\n\n\t\tonSend(text, agentUuid, attachments) {\n\t\t\tthis.stream.send(text, { agentUuid, attachments }).catch((err) => {\n\t\t\t\t// Stream errors are tracked in stream.state.error — no extra handling needed\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.info('[CnAiCompanion] send error:', err?.message)\n\t\t\t})\n\t\t},\n\n\t\tonNewThread() {\n\t\t\tthis.stream.startNewThread()\n\t\t},\n\n\t\tonLoadConversation(uuid) {\n\t\t\tthis.stream.loadConversation(uuid)\n\t\t},\n\t},\n}\n</script>\n\n<style>\n.cn-ai-companion {\n\t/*\n\t * display: contents removes this wrapper from the layout tree so the\n\t * embedded NcAppSidebar inherits NcContent as its flex parent — required\n\t * for the sidebar to slide in from the RIGHT edge. The FAB is itself\n\t * position:fixed so it positions independently of the wrapper's box.\n\t *\n\t * !important is intentional: webpack pulls in BOTH the old (position:\n\t * fixed) and new (display: contents) rules from the package's CJS and\n\t * ESM builds; without !important the old rule wins the cascade and the\n\t * sidebar renders at the left.\n\t */\n\tdisplay: contents !important;\n\tposition: static !important;\n}\n</style>\n"],"names":["CnAiFloatingButton","CnAiChatPanel","axios"],"mappings":";;;;;;;AAsEA,MAAM,cAAe,GAAE,KAAG;;AAE1B;AACA,MAAM,qBAAoB,GAAI,EAAA;;AAE9B;AACA,MAAM,kBAAiB,GAAI,IAAE;;AAE7B;;AAEC;AACA;AACA;AACA;AACA;;AAED,MAAM,uBAAwB,GAAE,yBAAuB;;AAEvD;;AAEC;;;;AAID,MAAM,oBAAqB,GAAE,KAAG;;AAEhC,aAAe;AACd,CAAA,IAAI,EAAE,eAAe;;CAErB,UAAU,EAAE;AACX,sBAAAA,UAAkB;iBAClBC,YAAa;EACb;;AAED,CAAA,MAAM,EAAE;EACP,WAAW,EAAE,EAAE,OAAO,EAAE,IAAG,EAAG;EAC9B;;AAED,CAAA,KAAK,EAAE;AACN;;AAEC;;;AAGD,EAAA,QAAQ,EAAE;GACT,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,cAAc;GACvB;;AAED;;AAEC;;;;;;AAMA;;;EAGD,SAAS,EAAE;GACV,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,mBAAmB;GAC5B;;AAED;;AAEC;;;;;AAKA;AACA;;AAEA;AACA;AACA;AACA;;AAED,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,IAAI;GACb;EACD;;AAED,CAAA,IAAI,GAAG;AACN,EAAA,OAAO;AACN,GAAA,cAAc,EAAE,KAAK;AACrB,GAAA,WAAW,EAAE,KAA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AAW,GAAG;AACb,GAAA,IAAI,IAAI,CAAC,WAAW,EAAE;AACrB,IAAA,IAAI,CAAC,UAAU,GAAC;IAChB,MAAK;AACN,IAAA;;AAEA,GAAA,IAAI,CAAC,SAAS,GAAC;GACf;;EAED,SAAS,GAAG;AACX,GAAA,IAAI,CAAC,cAAc,KAAG;AACtB,GAAA,IAAI,CAAC,SAAS,CAAC,MAAM;IACpB,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;AACrD,KAAA,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAC;AACpC,KAAA;IACA,EAAA;GACD;;EAED,UAAU,GAAG;AACZ,GAAA,IAAI,CAAC,WAAU,GAAI,MAAI;GACvB;;AAED,EAAA,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE;GACpC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,WAAY,EAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK;AACjE;AACA;IACA,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,GAAG,EAAE,OAAO,EAAA;IACxD,EAAA;GACD;;EAED,WAAW,GAAG;GACb,IAAI,CAAC,MAAM,CAAC,cAAc,GAAC;GAC3B;;EAED,kBAAkB,CAAC,IAAI,EAAE;AACxB,GAAA,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAA;GACjC;EACD;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CnAiCompanion.vue3.js","sources":["../../../../src/components/CnAiCompanion/CnAiCompanion.vue?vue&type=template&id=13429583&lang.js"],"sourcesContent":["<!--\n CnAiCompanion — top-level mount for the AI Chat Companion widget.\n\n On created():\n - Issues GET /index.php/apps/{chatAppId}/api/chat/health via axios.\n - Renders nothing on non-2xx, network error, or timeout (5s).\n - Probe result cached for component lifetime.\n - Only console.info() on failure (never warn/error).\n\n When probe succeeds:\n - Renders CnAiFloatingButton ALWAYS — it toggles the window rather than only\n opening it, and stays visible while the window is open.\n - Renders CnAiChatPanel (when isPanelOpen) as a floating window anchored to the\n same corner as the hex, offset clear of it so both stay clickable.\n\n FAB and panel both hidden when cnAiContext.pageKind === 'chat'.\n-->\n<template>\n\t<div\n\t\tv-if=\"probeSucceeded && !isChatPage && isPrimaryCompanion\"\n\t\tclass=\"cn-ai-companion\"\n\t\tdata-testid=\"cn-ai-companion\">\n\t\t<!--\n\t\t The hex is rendered UNCONDITIONALLY and toggles the window.\n\n\t\t It used to be `:visible=\"!isPanelOpen\"` — the launcher vanished while\n\t\t the thing it launched was open. Three reasons it now stays, in order of\n\t\t weight:\n\n\t\t 1. It is the one control we can guarantee. The window's own close\n\t\t button lives in markup a host page's stylesheet could hide; the hex\n\t\t is fixed-position with explicit `!important` properties and has\n\t\t survived every host it has been dropped into, including third-party\n\t\t office editors.\n\t\t 2. A launcher that disappears is a dead end — the affordance you used\n\t\t to summon something should dismiss it.\n\t\t 3. It removes a state transition: no show/hide to coordinate with the\n\t\t window's own.\n\n\t\t āš ļø This is why the window anchors 70px from the edge: the hex is 26x30\n\t\t at a 24px inset, and the two must not overlap or the guarantee above is\n\t\t worth nothing.\n\t\t-->\n\t\t<CnAiFloatingButton\n\t\t\t:visible=\"true\"\n\t\t\t:position=\"position\"\n\t\t\t@click=\"togglePanel\" />\n\t\t<CnAiChatPanel\n\t\t\tref=\"panel\"\n\t\t\t:visible=\"isPanelOpen\"\n\t\t\t:streamState=\"stream.state\"\n\t\t\t:chatAppId=\"chatAppId\"\n\t\t\t:context=\"effectiveContext\"\n\t\t\t:position=\"position\"\n\t\t\t:fabRef=\"$refs.fabButton\"\n\t\t\t@close=\"closePanel\"\n\t\t\t@send=\"onSend\"\n\t\t\t@newThread=\"onNewThread\"\n\t\t\t@loadConversation=\"onLoadConversation\" />\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport CnAiChatPanel from './CnAiChatPanel.vue'\nimport CnAiFloatingButton from './CnAiFloatingButton.vue'\nimport { chatHealthUrl, DEFAULT_CHAT_APP_ID } from '../../composables/aiChatConfig.js'\nimport { useAiChatStream } from '../../composables/useAiChatStream.js'\n\nconst HEALTH_TIMEOUT = 5000\n\n/** How many times the health probe may fail before the companion hides. */\nconst HEALTH_PROBE_ATTEMPTS = 3\n\n/** Base backoff between probe attempts, multiplied by the attempt number. */\nconst HEALTH_RETRY_DELAY = 750\n\n/**\n * The window key one companion claims so a second one stands down.\n *\n * On `window` rather than in module scope, because the two companions on a page\n * do not share a module instance: one comes from the host app's bundle and one\n * from a standalone bundle attached to every page. Two copies of this file are\n * loaded, so a module-level flag would be two flags and would guard nothing.\n */\nconst COMPANION_SINGLETON_KEY = '__cnAiCompanionPrimary'\n\n/**\n * How long to wait before looking for a companion that cannot stand down.\n *\n * Long enough for a host app's Vue tree to boot after a standalone mount at\n * DOMContentLoaded, short enough that a user never sees two hexes settle.\n */\nconst LEGACY_SIBLING_DELAY = 1200\n\nexport default {\n\tname: 'CnAiCompanion',\n\n\tcomponents: {\n\t\tCnAiFloatingButton,\n\t\tCnAiChatPanel,\n\t},\n\n\tinject: {\n\t\tcnAiContext: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Default position for the FAB.\n\t\t *\n\t\t * @type {'bottom-right'|'bottom-left'|'top-right'|'top-left'}\n\t\t */\n\t\tposition: {\n\t\t\ttype: String,\n\t\t\tdefault: 'bottom-right',\n\t\t},\n\n\t\t/**\n\t\t * Backend app id that answers the chat/health/conversation HTTP calls\n\t\t * (`/index.php/apps/{chatAppId}/api/...`). Single configuration point for\n\t\t * the AI Chat Companion's backend — see composables/aiChatConfig.js.\n\t\t * Defaults to `hermiq` (the agent engine's home per hydra ADR-034\n\t\t * \"Amendment 2026-07-05\"); `CnAppRoot` forwards its own `chatAppId`\n\t\t * prop here so a consuming app can point the widget at another backend\n\t\t * (e.g. `openregister` during its compat window) in one place.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tchatAppId: {\n\t\t\ttype: String,\n\t\t\tdefault: DEFAULT_CHAT_APP_ID,\n\t\t},\n\n\t\t/**\n\t\t * What the user is looking at, stated by whoever mounted the companion.\n\t\t *\n\t\t * Inside a Conduction app, CnAppRoot provides this and the prop is\n\t\t * unnecessary. Mounted standalone on a page belonging to another app —\n\t\t * an office editor, the Files list — there is no provider, and the\n\t\t * injected fallback reports `appId: 'unknown'`. The agent then has no\n\t\t * idea what \"this document\" refers to and says so.\n\t\t *\n\t\t * Shape mirrors the injected context: `{ appId, pageKind, fileId,\n\t\t * objectUuid, registerSlug, schemaSlug, route }`. All optional; whatever\n\t\t * the host knows is better than 'unknown'.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tcontext: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tprobeSucceeded: false,\n\t\t\tisPanelOpen: false,\n\t\t\tisPrimaryCompanion: false,\n\t\t\t// Cleared on unmount so a torn-down companion cannot stand itself\n\t\t\t// down after the fact.\n\t\t\tlegacySiblingTimer: null,\n\t\t\tstream: useAiChatStream(this, { chatAppId: this.chatAppId, context: this.context }),\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tisChatPage() {\n\t\t\tconst ctx = this.cnAiContext\n\t\t\treturn ctx && ctx.pageKind === 'chat'\n\t\t},\n\n\t\t/**\n\t\t * The page context the panel reasons with: the prop when a standalone\n\t\t * mount passed one, otherwise the context CnAppRoot provides.\n\t\t *\n\t\t * WHY THIS EXISTS\n\t\t * ---------------\n\t\t * `CnAppRoot` renders `<CnAiCompanion :chatAppId=\"chatAppId\" />` and\n\t\t * passes NO `:context`, because it already provides `cnAiContext` for\n\t\t * descendants to inject. This component injected it for `isChatPage`\n\t\t * but handed the panel the raw `context` PROP, which is `null` in that\n\t\t * arrangement — so inside every app shell the panel ran with no\n\t\t * context at all.\n\t\t *\n\t\t * The panel's `relevantAgentOptions` treats an empty context as \"no\n\t\t * page to be relevant to\" and returns EVERY agent, so it selected\n\t\t * whichever agent the API happened to list first. Measured on the\n\t\t * demo instance 2026-09-20: on `/apps/buildiq/` the companion opened\n\t\t * as \"Hydra Triage\", which holds only `hydra.*` tools, and its first\n\t\t * answer was \"This agent's tool grants resolve to no tools\" — while\n\t\t * \"Buildiq builder\", holding all eight `buildiq_*` tools, sat unused\n\t\t * at the bottom of the same list.\n\t\t *\n\t\t * A standalone mount that passes `context` explicitly still wins, so\n\t\t * Hermiq's cross-app companion is unaffected.\n\t\t *\n\t\t * @return {object|null} The context to reason with.\n\t\t */\n\t\teffectiveContext() {\n\t\t\treturn this.context || this.cnAiContext || null\n\t\t},\n\t},\n\n\tcreated() {\n\t\tthis.runHealthProbe()\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this.legacySiblingTimer !== null) {\n\t\t\tclearTimeout(this.legacySiblingTimer)\n\t\t\tthis.legacySiblingTimer = null\n\t\t}\n\n\t\tthis.releaseSingleton()\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Stand down if another companion is on the page that cannot stand down.\n\t\t *\n\t\t * šŸ”“ THE WINDOW FLAG ONLY BINDS INSTANCES THAT CHECK IT. Measured on a\n\t\t * live instance after shipping the flag: still TWO hexes, stacked at the\n\t\t * same coordinates — one from `#openregister` (the host app's own bundle,\n\t\t * built against an older version of this library) and one from\n\t\t * `#hermiq-companion-root` (the standalone mount, built against the new\n\t\t * one). The old bundle never reads the flag, so it renders regardless,\n\t\t * and the guarded instance had already claimed the slot and rendered too.\n\t\t *\n\t\t * The library fix alone therefore does not reach a page until EVERY app\n\t\t * on it has rebuilt — which is not something a user with a double hex\n\t\t * can wait for. So the instance that CAN yield does.\n\t\t *\n\t\t * Deferred rather than checked at mount, because order is against us: a\n\t\t * standalone companion mounts at DOMContentLoaded and the host app's Vue\n\t\t * tree boots after it, so at mount time there is nothing to see.\n\t\t *\n\t\t * When both companions carry this guard the flag has already stopped the\n\t\t * second one, so this never fires — it is strictly a bridge for mixed\n\t\t * versions, and it costs one timeout.\n\t\t */\n\t\tyieldToACompanionThatCannotYield() {\n\t\t\tif (typeof document === 'undefined' || this.isPrimaryCompanion !== true) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.legacySiblingTimer = setTimeout(() => {\n\t\t\t\tthis.legacySiblingTimer = null\n\n\t\t\t\tconst rendered = document.querySelectorAll('[data-testid=\"cn-ai-companion\"]')\n\t\t\t\tif (rendered.length <= 1) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tfor (const el of rendered) {\n\t\t\t\t\tif (el !== this.$el) {\n\t\t\t\t\t\t// Yield to it: the host app's own companion sits inside\n\t\t\t\t\t\t// that app's tree and carries its page context, which a\n\t\t\t\t\t\t// standalone mount can only approximate.\n\t\t\t\t\t\tthis.releaseSingleton()\n\t\t\t\t\t\tthis.isPrimaryCompanion = false\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, LEGACY_SIBLING_DELAY)\n\t\t},\n\n\t\t/**\n\t\t * Claim the page's single companion slot, or stand down.\n\t\t *\n\t\t * šŸ”“ TWO COMPANIONS ON ONE PAGE IS A REACHABLE STATE, and it was reached:\n\t\t * `CnAppRoot` renders a companion for any app that sets `aiCompanion`,\n\t\t * while a host app can also mount one standalone on every page of the\n\t\t * instance (Hermiq does exactly this, so the assistant reaches\n\t\t * third-party office editors that have no CnAppRoot of ours). On any\n\t\t * page that has both, the user saw TWO hexes stacked a few pixels apart\n\t\t * — the two mounts pick up different bundled stylesheets, so they do not\n\t\t * even land in the same place.\n\t\t *\n\t\t * The guard lives HERE, in the component, rather than in each host's\n\t\t * mount script, because only the component knows how many of itself\n\t\t * exist. A host-side check cannot see a sibling that mounts later: the\n\t\t * standalone script runs at DOMContentLoaded and the app's own Vue tree\n\t\t * boots after it, so whichever check runs first sees nothing and both\n\t\t * render.\n\t\t *\n\t\t * First to claim wins and the rest render nothing. That order is stable\n\t\t * in practice — the standalone mount runs first — but the rule does not\n\t\t * depend on it: what matters is that exactly one renders, not which.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tclaimSingleton() {\n\t\t\t// šŸ”“ CLAIMED ONLY WHEN THIS INSTANCE WOULD ACTUALLY RENDER.\n\t\t\t//\n\t\t\t// An earlier version claimed in `created()`, before the health probe\n\t\t\t// had answered — so a companion whose probe FAILED still took the\n\t\t\t// slot and stood the other one down, turning \"one companion\" into\n\t\t\t// NONE. Measured on a slow instance, where the probe's 3Ɨ5s budget\n\t\t\t// is genuinely marginal: the slot was claimed and nothing rendered.\n\t\t\t//\n\t\t\t// Claiming late is also why the claim is not in a `watch` on the\n\t\t\t// window key: the slot is contended exactly once per page, at the\n\t\t\t// moment each candidate learns it can render.\n\t\t\tif (this.probeSucceeded !== true || this.isChatPage === true) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst scope = typeof window !== 'undefined' ? window : null\n\t\t\tif (scope === null) {\n\t\t\t\t// No window (SSR, a bare unit test): nothing else can be\n\t\t\t\t// rendering, so this instance is the only one by definition.\n\t\t\t\tthis.isPrimaryCompanion = true\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (scope[COMPANION_SINGLETON_KEY] === null || scope[COMPANION_SINGLETON_KEY] === undefined) {\n\t\t\t\tscope[COMPANION_SINGLETON_KEY] = this\n\t\t\t\tthis.isPrimaryCompanion = true\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.isPrimaryCompanion = scope[COMPANION_SINGLETON_KEY] === this\n\t\t},\n\n\t\t/**\n\t\t * Give the slot back, but only if this instance is holding it.\n\t\t *\n\t\t * Checked rather than cleared unconditionally: a second, standing-down\n\t\t * instance unmounting must not release the slot the FIRST one is still\n\t\t * using, which would let a third mount render alongside it.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\treleaseSingleton() {\n\t\t\tconst scope = typeof window !== 'undefined' ? window : null\n\t\t\tif (scope !== null && scope[COMPANION_SINGLETON_KEY] === this) {\n\t\t\t\tscope[COMPANION_SINGLETON_KEY] = null\n\t\t\t}\n\t\t},\n\n\t\tasync runHealthProbe() {\n\t\t\t// RETRY before hiding. A single probe makes the whole companion\n\t\t\t// disappear on one slow response, and \"slow\" is normal: measured on a\n\t\t\t// busy instance (load 48) the health endpoint answered in well under a\n\t\t\t// second, but the request still lost its 5s budget to contention. The\n\t\t\t// failure mode is the worst kind — the widget is simply absent, with\n\t\t\t// nothing on screen saying why, and a reload usually \"fixes\" it, which\n\t\t\t// is what makes it read as flakiness rather than as a probe result.\n\t\t\t//\n\t\t\t// A backend that is genuinely down fails all attempts and is still\n\t\t\t// reported; this only stops one unlucky request from deciding.\n\t\t\tfor (let attempt = 1; attempt <= HEALTH_PROBE_ATTEMPTS; attempt++) {\n\t\t\t\ttry {\n\t\t\t\t\tconst response = await axios.get(chatHealthUrl(this.chatAppId), {\n\t\t\t\t\t\ttimeout: HEALTH_TIMEOUT,\n\t\t\t\t\t\tvalidateStatus: (status) => status >= 200 && status < 300,\n\t\t\t\t\t})\n\t\t\t\t\tthis.probeSucceeded = response.status >= 200 && response.status < 300\n\t\t\t\t\t// Contend for the page's single slot only now, with a\n\t\t\t\t\t// backend that answered. See claimSingleton().\n\t\t\t\t\tthis.claimSingleton()\n\t\t\t\t\t// A companion built against an older version of this library\n\t\t\t\t\t// cannot read the flag above, so look for one shortly.\n\t\t\t\t\tthis.yieldToACompanionThatCannotYield()\n\t\t\t\t\treturn\n\t\t\t\t} catch {\n\t\t\t\t\tif (attempt < HEALTH_PROBE_ATTEMPTS) {\n\t\t\t\t\t\tawait new Promise((resolve) => {\n\t\t\t\t\t\t\tsetTimeout(resolve, HEALTH_RETRY_DELAY * attempt)\n\t\t\t\t\t\t})\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.info(`[CnAiCompanion] chat backend \"${this.chatAppId}\" health probe did not return 2xx `\n\t\t\t\t\t\t+ `after ${HEALTH_PROBE_ATTEMPTS} attempts — widget hidden`)\n\t\t\t\t\tthis.probeSucceeded = false\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The hex's own handler: open when closed, close when open.\n\t\t *\n\t\t * The launcher stays visible while the window is open (see the template),\n\t\t * so it has to answer for both directions rather than only opening.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\ttogglePanel() {\n\t\t\tif (this.isPanelOpen) {\n\t\t\t\tthis.closePanel()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.openPanel()\n\t\t},\n\n\t\topenPanel() {\n\t\t\tthis.isPanelOpen = true\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tif (this.$refs.panel && this.$refs.panel.$refs.input) {\n\t\t\t\t\tthis.$refs.panel.$refs.input.focus()\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\tclosePanel() {\n\t\t\tthis.isPanelOpen = false\n\t\t},\n\n\t\tonSend(text, agentUuid, attachments) {\n\t\t\tthis.stream.send(text, { agentUuid, attachments }).catch((err) => {\n\t\t\t\t// Stream errors are tracked in stream.state.error — no extra handling needed\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.info('[CnAiCompanion] send error:', err?.message)\n\t\t\t})\n\t\t},\n\n\t\tonNewThread() {\n\t\t\tthis.stream.startNewThread()\n\t\t},\n\n\t\tonLoadConversation(uuid) {\n\t\t\tthis.stream.loadConversation(uuid)\n\t\t},\n\t},\n}\n</script>\n\n<style>\n.cn-ai-companion {\n\t/*\n\t * display: contents removes this wrapper from the layout tree so the\n\t * embedded NcAppSidebar inherits NcContent as its flex parent — required\n\t * for the sidebar to slide in from the RIGHT edge. The FAB is itself\n\t * position:fixed so it positions independently of the wrapper's box.\n\t *\n\t * !important is intentional: webpack pulls in BOTH the old (position:\n\t * fixed) and new (display: contents) rules from the package's CJS and\n\t * ESM builds; without !important the old rule wins the cascade and the\n\t * sidebar renders at the left.\n\t */\n\tdisplay: contents !important;\n\tposition: static !important;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock"],"mappings":";;;;OAqCO,EAAC,iBAAW;;;;;;;;UADX,KAAc,CAAA,cAAA,IAAA,CAAK,QAAS,CAAA,UAAA,IAAK,KAAkB,CAAA,kBAAA;AADpD,OAAAA,SAAA,EAAA,EAAAC,kBAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnAiCompanion.vue3.js","sources":["../../../../src/components/CnAiCompanion/CnAiCompanion.vue?vue&type=template&id=13429583&lang.js"],"sourcesContent":["<!--\n CnAiCompanion — top-level mount for the AI Chat Companion widget.\n\n On created():\n - Issues GET /index.php/apps/{chatAppId}/api/chat/health via axios.\n - Renders nothing on non-2xx, network error, or timeout (5s).\n - Probe result cached for component lifetime.\n - Only console.info() on failure (never warn/error).\n\n When probe succeeds:\n - Renders CnAiFloatingButton ALWAYS — it toggles the window rather than only\n opening it, and stays visible while the window is open.\n - Renders CnAiChatPanel (when isPanelOpen) as a floating window anchored to the\n same corner as the hex, offset clear of it so both stay clickable.\n\n FAB and panel both hidden when cnAiContext.pageKind === 'chat'.\n-->\n<template>\n\t<div\n\t\tv-if=\"probeSucceeded && !isChatPage && isPrimaryCompanion\"\n\t\tclass=\"cn-ai-companion\"\n\t\tdata-testid=\"cn-ai-companion\">\n\t\t<!--\n\t\t The hex is rendered UNCONDITIONALLY and toggles the window.\n\n\t\t It used to be `:visible=\"!isPanelOpen\"` — the launcher vanished while\n\t\t the thing it launched was open. Three reasons it now stays, in order of\n\t\t weight:\n\n\t\t 1. It is the one control we can guarantee. The window's own close\n\t\t button lives in markup a host page's stylesheet could hide; the hex\n\t\t is fixed-position with explicit `!important` properties and has\n\t\t survived every host it has been dropped into, including third-party\n\t\t office editors.\n\t\t 2. A launcher that disappears is a dead end — the affordance you used\n\t\t to summon something should dismiss it.\n\t\t 3. It removes a state transition: no show/hide to coordinate with the\n\t\t window's own.\n\n\t\t āš ļø This is why the window anchors 70px from the edge: the hex is 26x30\n\t\t at a 24px inset, and the two must not overlap or the guarantee above is\n\t\t worth nothing.\n\t\t-->\n\t\t<CnAiFloatingButton\n\t\t\t:visible=\"true\"\n\t\t\t:position=\"position\"\n\t\t\t@click=\"togglePanel\" />\n\t\t<CnAiChatPanel\n\t\t\tref=\"panel\"\n\t\t\t:visible=\"isPanelOpen\"\n\t\t\t:streamState=\"stream.state\"\n\t\t\t:chatAppId=\"chatAppId\"\n\t\t\t:context=\"effectiveContext\"\n\t\t\t:position=\"position\"\n\t\t\t:fabRef=\"$refs.fabButton\"\n\t\t\t@close=\"closePanel\"\n\t\t\t@send=\"onSend\"\n\t\t\t@newThread=\"onNewThread\"\n\t\t\t@loadConversation=\"onLoadConversation\" />\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport CnAiChatPanel from './CnAiChatPanel.vue'\nimport CnAiFloatingButton from './CnAiFloatingButton.vue'\nimport { chatHealthUrl, DEFAULT_CHAT_APP_ID } from '../../composables/aiChatConfig.js'\nimport { useAiChatStream } from '../../composables/useAiChatStream.js'\nimport { isAppInstalled } from '../../utils/appInstalled.js'\n\nconst HEALTH_TIMEOUT = 5000\n\n/** How many times the health probe may fail before the companion hides. */\nconst HEALTH_PROBE_ATTEMPTS = 3\n\n/** Base backoff between probe attempts, multiplied by the attempt number. */\nconst HEALTH_RETRY_DELAY = 750\n\n/**\n * The window key one companion claims so a second one stands down.\n *\n * On `window` rather than in module scope, because the two companions on a page\n * do not share a module instance: one comes from the host app's bundle and one\n * from a standalone bundle attached to every page. Two copies of this file are\n * loaded, so a module-level flag would be two flags and would guard nothing.\n */\nconst COMPANION_SINGLETON_KEY = '__cnAiCompanionPrimary'\n\n/**\n * How long to wait before looking for a companion that cannot stand down.\n *\n * Long enough for a host app's Vue tree to boot after a standalone mount at\n * DOMContentLoaded, short enough that a user never sees two hexes settle.\n */\nconst LEGACY_SIBLING_DELAY = 1200\n\nexport default {\n\tname: 'CnAiCompanion',\n\n\tcomponents: {\n\t\tCnAiFloatingButton,\n\t\tCnAiChatPanel,\n\t},\n\n\tinject: {\n\t\tcnAiContext: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Default position for the FAB.\n\t\t *\n\t\t * @type {'bottom-right'|'bottom-left'|'top-right'|'top-left'}\n\t\t */\n\t\tposition: {\n\t\t\ttype: String,\n\t\t\tdefault: 'bottom-right',\n\t\t},\n\n\t\t/**\n\t\t * Backend app id that answers the chat/health/conversation HTTP calls\n\t\t * (`/index.php/apps/{chatAppId}/api/...`). Single configuration point for\n\t\t * the AI Chat Companion's backend — see composables/aiChatConfig.js.\n\t\t * Defaults to `hermiq` (the agent engine's home per hydra ADR-034\n\t\t * \"Amendment 2026-07-05\"); `CnAppRoot` forwards its own `chatAppId`\n\t\t * prop here so a consuming app can point the widget at another backend\n\t\t * (e.g. `openregister` during its compat window) in one place.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tchatAppId: {\n\t\t\ttype: String,\n\t\t\tdefault: DEFAULT_CHAT_APP_ID,\n\t\t},\n\n\t\t/**\n\t\t * What the user is looking at, stated by whoever mounted the companion.\n\t\t *\n\t\t * Inside a Conduction app, CnAppRoot provides this and the prop is\n\t\t * unnecessary. Mounted standalone on a page belonging to another app —\n\t\t * an office editor, the Files list — there is no provider, and the\n\t\t * injected fallback reports `appId: 'unknown'`. The agent then has no\n\t\t * idea what \"this document\" refers to and says so.\n\t\t *\n\t\t * Shape mirrors the injected context: `{ appId, pageKind, fileId,\n\t\t * objectUuid, registerSlug, schemaSlug, route }`. All optional; whatever\n\t\t * the host knows is better than 'unknown'.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tcontext: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tprobeSucceeded: false,\n\t\t\tisPanelOpen: false,\n\t\t\tisPrimaryCompanion: false,\n\t\t\t// Cleared on unmount so a torn-down companion cannot stand itself\n\t\t\t// down after the fact.\n\t\t\tlegacySiblingTimer: null,\n\t\t\tstream: useAiChatStream(this, { chatAppId: this.chatAppId, context: this.context }),\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tisChatPage() {\n\t\t\tconst ctx = this.cnAiContext\n\t\t\treturn ctx && ctx.pageKind === 'chat'\n\t\t},\n\n\t\t/**\n\t\t * The page context the panel reasons with: the prop when a standalone\n\t\t * mount passed one, otherwise the context CnAppRoot provides.\n\t\t *\n\t\t * WHY THIS EXISTS\n\t\t * ---------------\n\t\t * `CnAppRoot` renders `<CnAiCompanion :chatAppId=\"chatAppId\" />` and\n\t\t * passes NO `:context`, because it already provides `cnAiContext` for\n\t\t * descendants to inject. This component injected it for `isChatPage`\n\t\t * but handed the panel the raw `context` PROP, which is `null` in that\n\t\t * arrangement — so inside every app shell the panel ran with no\n\t\t * context at all.\n\t\t *\n\t\t * The panel's `relevantAgentOptions` treats an empty context as \"no\n\t\t * page to be relevant to\" and returns EVERY agent, so it selected\n\t\t * whichever agent the API happened to list first. Measured on the\n\t\t * demo instance 2026-09-20: on `/apps/buildiq/` the companion opened\n\t\t * as \"Hydra Triage\", which holds only `hydra.*` tools, and its first\n\t\t * answer was \"This agent's tool grants resolve to no tools\" — while\n\t\t * \"Buildiq builder\", holding all eight `buildiq_*` tools, sat unused\n\t\t * at the bottom of the same list.\n\t\t *\n\t\t * A standalone mount that passes `context` explicitly still wins, so\n\t\t * Hermiq's cross-app companion is unaffected.\n\t\t *\n\t\t * @return {object|null} The context to reason with.\n\t\t */\n\t\teffectiveContext() {\n\t\t\treturn this.context || this.cnAiContext || null\n\t\t},\n\t},\n\n\tcreated() {\n\t\tthis.runHealthProbe()\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this.legacySiblingTimer !== null) {\n\t\t\tclearTimeout(this.legacySiblingTimer)\n\t\t\tthis.legacySiblingTimer = null\n\t\t}\n\n\t\tthis.releaseSingleton()\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Stand down if another companion is on the page that cannot stand down.\n\t\t *\n\t\t * šŸ”“ THE WINDOW FLAG ONLY BINDS INSTANCES THAT CHECK IT. Measured on a\n\t\t * live instance after shipping the flag: still TWO hexes, stacked at the\n\t\t * same coordinates — one from `#openregister` (the host app's own bundle,\n\t\t * built against an older version of this library) and one from\n\t\t * `#hermiq-companion-root` (the standalone mount, built against the new\n\t\t * one). The old bundle never reads the flag, so it renders regardless,\n\t\t * and the guarded instance had already claimed the slot and rendered too.\n\t\t *\n\t\t * The library fix alone therefore does not reach a page until EVERY app\n\t\t * on it has rebuilt — which is not something a user with a double hex\n\t\t * can wait for. So the instance that CAN yield does.\n\t\t *\n\t\t * Deferred rather than checked at mount, because order is against us: a\n\t\t * standalone companion mounts at DOMContentLoaded and the host app's Vue\n\t\t * tree boots after it, so at mount time there is nothing to see.\n\t\t *\n\t\t * When both companions carry this guard the flag has already stopped the\n\t\t * second one, so this never fires — it is strictly a bridge for mixed\n\t\t * versions, and it costs one timeout.\n\t\t */\n\t\tyieldToACompanionThatCannotYield() {\n\t\t\tif (typeof document === 'undefined' || this.isPrimaryCompanion !== true) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.legacySiblingTimer = setTimeout(() => {\n\t\t\t\tthis.legacySiblingTimer = null\n\n\t\t\t\tconst rendered = document.querySelectorAll('[data-testid=\"cn-ai-companion\"]')\n\t\t\t\tif (rendered.length <= 1) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tfor (const el of rendered) {\n\t\t\t\t\tif (el !== this.$el) {\n\t\t\t\t\t\t// Yield to it: the host app's own companion sits inside\n\t\t\t\t\t\t// that app's tree and carries its page context, which a\n\t\t\t\t\t\t// standalone mount can only approximate.\n\t\t\t\t\t\tthis.releaseSingleton()\n\t\t\t\t\t\tthis.isPrimaryCompanion = false\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, LEGACY_SIBLING_DELAY)\n\t\t},\n\n\t\t/**\n\t\t * Claim the page's single companion slot, or stand down.\n\t\t *\n\t\t * šŸ”“ TWO COMPANIONS ON ONE PAGE IS A REACHABLE STATE, and it was reached:\n\t\t * `CnAppRoot` renders a companion for any app that sets `aiCompanion`,\n\t\t * while a host app can also mount one standalone on every page of the\n\t\t * instance (Hermiq does exactly this, so the assistant reaches\n\t\t * third-party office editors that have no CnAppRoot of ours). On any\n\t\t * page that has both, the user saw TWO hexes stacked a few pixels apart\n\t\t * — the two mounts pick up different bundled stylesheets, so they do not\n\t\t * even land in the same place.\n\t\t *\n\t\t * The guard lives HERE, in the component, rather than in each host's\n\t\t * mount script, because only the component knows how many of itself\n\t\t * exist. A host-side check cannot see a sibling that mounts later: the\n\t\t * standalone script runs at DOMContentLoaded and the app's own Vue tree\n\t\t * boots after it, so whichever check runs first sees nothing and both\n\t\t * render.\n\t\t *\n\t\t * First to claim wins and the rest render nothing. That order is stable\n\t\t * in practice — the standalone mount runs first — but the rule does not\n\t\t * depend on it: what matters is that exactly one renders, not which.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tclaimSingleton() {\n\t\t\t// šŸ”“ CLAIMED ONLY WHEN THIS INSTANCE WOULD ACTUALLY RENDER.\n\t\t\t//\n\t\t\t// An earlier version claimed in `created()`, before the health probe\n\t\t\t// had answered — so a companion whose probe FAILED still took the\n\t\t\t// slot and stood the other one down, turning \"one companion\" into\n\t\t\t// NONE. Measured on a slow instance, where the probe's 3Ɨ5s budget\n\t\t\t// is genuinely marginal: the slot was claimed and nothing rendered.\n\t\t\t//\n\t\t\t// Claiming late is also why the claim is not in a `watch` on the\n\t\t\t// window key: the slot is contended exactly once per page, at the\n\t\t\t// moment each candidate learns it can render.\n\t\t\tif (this.probeSucceeded !== true || this.isChatPage === true) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst scope = typeof window !== 'undefined' ? window : null\n\t\t\tif (scope === null) {\n\t\t\t\t// No window (SSR, a bare unit test): nothing else can be\n\t\t\t\t// rendering, so this instance is the only one by definition.\n\t\t\t\tthis.isPrimaryCompanion = true\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (scope[COMPANION_SINGLETON_KEY] === null || scope[COMPANION_SINGLETON_KEY] === undefined) {\n\t\t\t\tscope[COMPANION_SINGLETON_KEY] = this\n\t\t\t\tthis.isPrimaryCompanion = true\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.isPrimaryCompanion = scope[COMPANION_SINGLETON_KEY] === this\n\t\t},\n\n\t\t/**\n\t\t * Give the slot back, but only if this instance is holding it.\n\t\t *\n\t\t * Checked rather than cleared unconditionally: a second, standing-down\n\t\t * instance unmounting must not release the slot the FIRST one is still\n\t\t * using, which would let a third mount render alongside it.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\treleaseSingleton() {\n\t\t\tconst scope = typeof window !== 'undefined' ? window : null\n\t\t\tif (scope !== null && scope[COMPANION_SINGLETON_KEY] === this) {\n\t\t\t\tscope[COMPANION_SINGLETON_KEY] = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Ask the chat backend whether it can answer, and render only if so.\n\t\t *\n\t\t * Skipped without a request when the backend app is not installed for\n\t\t * this user.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/no-calls-to-missing-apps-and-presence-beacon/specs/ai-companion/spec.md#requirement-the-companion-does-not-probe-a-backend-that-is-not-installed\n\t\t */\n\t\tasync runHealthProbe() {\n\t\t\t// RETRY before hiding. A single probe makes the whole companion\n\t\t\t// disappear on one slow response, and \"slow\" is normal: measured on a\n\t\t\t// busy instance (load 48) the health endpoint answered in well under a\n\t\t\t// second, but the request still lost its 5s budget to contention. The\n\t\t\t// failure mode is the worst kind — the widget is simply absent, with\n\t\t\t// nothing on screen saying why, and a reload usually \"fixes\" it, which\n\t\t\t// is what makes it read as flakiness rather than as a probe result.\n\t\t\t//\n\t\t\t// A backend that is genuinely down fails all attempts and is still\n\t\t\t// reported; this only stops one unlucky request from deciding.\n\t\t\t//\n\t\t\t// šŸ”“ NO PROBE AT AN APP THAT IS NOT THERE. Nextcloud already tells\n\t\t\t// the page which apps the user has (`OC.appswebroots`), so asking a\n\t\t\t// missing backend for its health is a guaranteed 404, three times\n\t\t\t// per page, in every console. Measured on cloud.conduction.nl\n\t\t\t// (round-5 check): hermiq not installed, three\n\t\t\t// `/apps/hermiq/api/chat/health` 404s on every pipelinq and dossiq\n\t\t\t// page. Hidden either way; now hidden without the requests.\n\t\t\tif (!isAppInstalled(this.chatAppId || DEFAULT_CHAT_APP_ID)) {\n\t\t\t\tthis.probeSucceeded = false\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor (let attempt = 1; attempt <= HEALTH_PROBE_ATTEMPTS; attempt++) {\n\t\t\t\ttry {\n\t\t\t\t\tconst response = await axios.get(chatHealthUrl(this.chatAppId), {\n\t\t\t\t\t\ttimeout: HEALTH_TIMEOUT,\n\t\t\t\t\t\tvalidateStatus: (status) => status >= 200 && status < 300,\n\t\t\t\t\t})\n\t\t\t\t\tthis.probeSucceeded = response.status >= 200 && response.status < 300\n\t\t\t\t\t// Contend for the page's single slot only now, with a\n\t\t\t\t\t// backend that answered. See claimSingleton().\n\t\t\t\t\tthis.claimSingleton()\n\t\t\t\t\t// A companion built against an older version of this library\n\t\t\t\t\t// cannot read the flag above, so look for one shortly.\n\t\t\t\t\tthis.yieldToACompanionThatCannotYield()\n\t\t\t\t\treturn\n\t\t\t\t} catch {\n\t\t\t\t\tif (attempt < HEALTH_PROBE_ATTEMPTS) {\n\t\t\t\t\t\tawait new Promise((resolve) => {\n\t\t\t\t\t\t\tsetTimeout(resolve, HEALTH_RETRY_DELAY * attempt)\n\t\t\t\t\t\t})\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.info(`[CnAiCompanion] chat backend \"${this.chatAppId}\" health probe did not return 2xx `\n\t\t\t\t\t\t+ `after ${HEALTH_PROBE_ATTEMPTS} attempts — widget hidden`)\n\t\t\t\t\tthis.probeSucceeded = false\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The hex's own handler: open when closed, close when open.\n\t\t *\n\t\t * The launcher stays visible while the window is open (see the template),\n\t\t * so it has to answer for both directions rather than only opening.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\ttogglePanel() {\n\t\t\tif (this.isPanelOpen) {\n\t\t\t\tthis.closePanel()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.openPanel()\n\t\t},\n\n\t\topenPanel() {\n\t\t\tthis.isPanelOpen = true\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tif (this.$refs.panel && this.$refs.panel.$refs.input) {\n\t\t\t\t\tthis.$refs.panel.$refs.input.focus()\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\tclosePanel() {\n\t\t\tthis.isPanelOpen = false\n\t\t},\n\n\t\tonSend(text, agentUuid, attachments) {\n\t\t\tthis.stream.send(text, { agentUuid, attachments }).catch((err) => {\n\t\t\t\t// Stream errors are tracked in stream.state.error — no extra handling needed\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.info('[CnAiCompanion] send error:', err?.message)\n\t\t\t})\n\t\t},\n\n\t\tonNewThread() {\n\t\t\tthis.stream.startNewThread()\n\t\t},\n\n\t\tonLoadConversation(uuid) {\n\t\t\tthis.stream.loadConversation(uuid)\n\t\t},\n\t},\n}\n</script>\n\n<style>\n.cn-ai-companion {\n\t/*\n\t * display: contents removes this wrapper from the layout tree so the\n\t * embedded NcAppSidebar inherits NcContent as its flex parent — required\n\t * for the sidebar to slide in from the RIGHT edge. The FAB is itself\n\t * position:fixed so it positions independently of the wrapper's box.\n\t *\n\t * !important is intentional: webpack pulls in BOTH the old (position:\n\t * fixed) and new (display: contents) rules from the package's CJS and\n\t * ESM builds; without !important the old rule wins the cascade and the\n\t * sidebar renders at the left.\n\t */\n\tdisplay: contents !important;\n\tposition: static !important;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock"],"mappings":";;;;OAqCO,EAAC,iBAAW;;;;;;;;UADX,KAAc,CAAA,cAAA,IAAA,CAAK,QAAS,CAAA,UAAA,IAAK,KAAkB,CAAA,kBAAA;AADpD,OAAAA,SAAA,EAAA,EAAAC,kBAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,7 @@
1
1
  import { translate } from '@nextcloud/l10n';
2
2
  import __sfc_main from '../CnStatusBadge/CnStatusBadge.vue.js';
3
3
  import { normalizeLook } from '../../composables/useLook.js';
4
+ import { isBadgeVariant } from '../../utils/badgeVariants.js';
4
5
  import { buildBoardColumns, resolveStageColor } from '../../utils/boardColumns.js';
5
6
  import { buildSwimlanes } from '../../utils/boardSwimlanes.js';
6
7
  import { runBoardDrop, DROP_OUTCOMES } from '../../utils/boardTransition.js';
@@ -380,7 +381,7 @@ var script = {
380
381
  pillVariant(card) {
381
382
  const raw = this.textOf(readPath(card, this.roles.pill));
382
383
  const variant = this.roles.pillColors[raw] ?? this.roles.pillColors[raw.toLowerCase()];
383
- return ['default', 'primary', 'success', 'warning', 'error', 'info'].includes(variant) ? variant : 'default'
384
+ return isBadgeVariant(variant) ? variant : 'default'
384
385
  },
385
386
 
386
387
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CnBoardView.vue2.js","sources":["../../../../src/components/CnBoardView/CnBoardView.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div\n\t\tclass=\"cn-board-view\"\n\t\t:class=\"{ 'cn-board-view--board': isBoardLook }\"\n\t\tdata-testid=\"cn-board-view\">\n\t\t<p v-if=\"!usable\" class=\"cn-board-view__unusable\" data-testid=\"cn-board-unusable\">\n\t\t\t{{ unusableText }}\n\t\t</p>\n\n\t\t<div\n\t\t\tv-for=\"lane in lanes\"\n\t\t\tv-else\n\t\t\t:key=\"`lane-${lane.key}`\"\n\t\t\tclass=\"cn-board-view__lane\"\n\t\t\tdata-testid=\"cn-board-lane\"\n\t\t\t:data-lane=\"lane.key\">\n\t\t\t<button\n\t\t\t\tv-if=\"lane.key !== ''\"\n\t\t\t\tclass=\"cn-board-view__lane-header\"\n\t\t\t\tdata-testid=\"cn-board-lane-header\"\n\t\t\t\t:aria-expanded=\"String(!isCollapsed(lane.key))\"\n\t\t\t\t@click=\"toggleLane(lane.key)\">\n\t\t\t\t{{ lane.label }} ({{ lane.count }})\n\t\t\t</button>\n\n\t\t\t<div\n\t\t\t\tv-show=\"!isCollapsed(lane.key)\"\n\t\t\t\tclass=\"cn-board-view__columns\"\n\t\t\t\trole=\"list\"\n\t\t\t\t:aria-label=\"lane.key === '' ? boardLabel : lane.label\">\n\t\t\t\t<section\n\t\t\t\t\tv-for=\"column in lane.columns\"\n\t\t\t\t\t:key=\"`col-${lane.key}-${column.key}`\"\n\t\t\t\t\tclass=\"cn-board-view__column\"\n\t\t\t\t\trole=\"listitem\"\n\t\t\t\t\tdata-testid=\"cn-board-column\"\n\t\t\t\t\t:data-column=\"column.key\"\n\t\t\t\t\t@dragover.prevent\n\t\t\t\t\t@drop=\"onDrop(column, $event)\">\n\t\t\t\t\t<!-- Board look: a dot, the label and a white count badge, with an\n\t\t\t\t\t optional sum line under it (screens-kanban-parity). -->\n\t\t\t\t\t<div v-if=\"isBoardLook\" class=\"cn-board-view__column-head\">\n\t\t\t\t\t\t<h2 class=\"cn-board-view__column-header cn-board-view__column-header--board\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclass=\"cn-board-view__dot\"\n\t\t\t\t\t\t\t\tdata-testid=\"cn-board-dot\"\n\t\t\t\t\t\t\t\t:style=\"{ background: dotColor(column) }\"\n\t\t\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t\t\t<span class=\"cn-board-view__column-title\">{{ column.label }}</span>\n\t\t\t\t\t\t\t<span class=\"cn-board-view__badge\" data-testid=\"cn-board-count\">\n\t\t\t\t\t\t\t\t{{ column.count }}<span v-if=\"paged\" class=\"hidden-visually\"> {{ t('nextcloud-vue', 'on this page') }}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tv-if=\"columnSum(column) !== ''\"\n\t\t\t\t\t\t\tclass=\"cn-board-view__sum\"\n\t\t\t\t\t\t\tdata-testid=\"cn-board-sum\">\n\t\t\t\t\t\t\t{{ columnSum(column) }}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<h3 v-else class=\"cn-board-view__column-header\">\n\t\t\t\t\t\t{{ column.label }}\n\t\t\t\t\t\t<span class=\"cn-board-view__count\" data-testid=\"cn-board-count\">\n\t\t\t\t\t\t\t{{ countLabel(column) }}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</h3>\n\n\t\t\t\t\t<!--\n\t\t\t\t\t\tA list of its own, so a reader is told how many cards\n\t\t\t\t\t\tthis column holds. The column is a listitem of the\n\t\t\t\t\t\tboard's list of columns; the cards are a list inside\n\t\t\t\t\t\tit, not more items of that same list.\n\t\t\t\t\t-->\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-if=\"column.cards.length > 0\"\n\t\t\t\t\t\tclass=\"cn-board-view__cards\"\n\t\t\t\t\t\trole=\"list\"\n\t\t\t\t\t\t:aria-label=\"column.label\">\n\t\t\t\t\t\t<!--\n\t\t\t\t\t\t\tThe card is a CONTAINER, and every action on it is\n\t\t\t\t\t\t\tits own control. It carries the drag and nothing\n\t\t\t\t\t\t\telse: no tabindex, no click, no key handler, and\n\t\t\t\t\t\t\tnever role=\"button\".\n\n\t\t\t\t\t\t\tšŸ”“ role=\"button\" HERE WOULD BREAK THE MOVE. An\n\t\t\t\t\t\t\telement with that role has presentational children,\n\t\t\t\t\t\t\tso the <select> below would be an interactive\n\t\t\t\t\t\t\tcontrol inside a button. That is invalid, and it\n\t\t\t\t\t\t\ttakes away the only way a keyboard user can move a\n\t\t\t\t\t\t\tcard. It would also collapse every field on the\n\t\t\t\t\t\t\tcard into one button label. See\n\t\t\t\t\t\t\topenspec/changes/board-card-role-and-keyboard.\n\n\t\t\t\t\t\t\tMeasured rather than argued: putting role=\"button\"\n\t\t\t\t\t\t\there makes axe report nested-interactive (serious,\n\t\t\t\t\t\t\t\"Interactive controls must not be nested\") and\n\t\t\t\t\t\t\taria-required-children (critical), and four tests\n\t\t\t\t\t\t\tin tests/a11y/CnBoardView.a11y.spec.js go red.\n\t\t\t\t\t\t\tGate 32 suggests exactly this change. The gate is a\n\t\t\t\t\t\t\tmechanical floor, not the standard.\n\t\t\t\t\t\t-->\n\t\t\t\t\t\t<article\n\t\t\t\t\t\t\tv-for=\"card in visibleCards(lane, column)\"\n\t\t\t\t\t\t\t:key=\"`card-${cardKey(card)}`\"\n\t\t\t\t\t\t\tclass=\"cn-board-view__card\"\n\t\t\t\t\t\t\t:class=\"[\n\t\t\t\t\t\t\t\tcardDueState(card) ? `cn-board-view__card--${cardDueState(card)}` : null,\n\t\t\t\t\t\t\t\t{ 'cn-board-view__card--board': isBoardLook },\n\t\t\t\t\t\t\t]\"\n\t\t\t\t\t\t\trole=\"listitem\"\n\t\t\t\t\t\t\tdata-testid=\"cn-board-card\"\n\t\t\t\t\t\t\t:data-card-id=\"cardKey(card)\"\n\t\t\t\t\t\t\t:draggable=\"canMove\"\n\t\t\t\t\t\t\t@dragstart=\"onDragStart(card, column, $event)\"\n\t\t\t\t\t\t\t@keydown=\"onCardKeydown(card, column, lane, $event)\">\n\t\t\t\t\t\t\t<!-- Board look: title link, sub line, pill, footer, and a\n\t\t\t\t\t\t\t menu button instead of the Move to select. -->\n\t\t\t\t\t\t\t<template v-if=\"isBoardLook\">\n\t\t\t\t\t\t\t\t<div class=\"cn-board-view__card-head\">\n\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\thref=\"#\"\n\t\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__card-title\"\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-open\"\n\t\t\t\t\t\t\t\t\t\t:data-card-id=\"cardKey(card)\"\n\t\t\t\t\t\t\t\t\t\t:aria-label=\"cardLabel(card, column)\"\n\t\t\t\t\t\t\t\t\t\t@click.prevent=\"openCard(card, $event)\"\n\t\t\t\t\t\t\t\t\t\t@mousedown=\"preventMiddleClickAutoscroll\"\n\t\t\t\t\t\t\t\t\t\t@auxclick=\"onCardAuxClick(card, $event)\">\n\t\t\t\t\t\t\t\t\t\t{{ roleText(card, roles.title) || cardKey(card) }}\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t<span class=\"cn-board-view__menu-wrap\">\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__menu-button\"\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-menu\"\n\t\t\t\t\t\t\t\t\t\t\t:data-card-id=\"cardKey(card)\"\n\t\t\t\t\t\t\t\t\t\t\taria-haspopup=\"menu\"\n\t\t\t\t\t\t\t\t\t\t\t:aria-expanded=\"String(isMenuOpen(card))\"\n\t\t\t\t\t\t\t\t\t\t\t:aria-label=\"menuButtonLabel(card)\"\n\t\t\t\t\t\t\t\t\t\t\t@click=\"toggleMenu(card)\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"cn-board-view__menu-dots\" aria-hidden=\"true\">&#8943;</span>\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\tv-if=\"isMenuOpen(card)\"\n\t\t\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__menu\"\n\t\t\t\t\t\t\t\t\t\t\trole=\"menu\"\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-menu-list\"\n\t\t\t\t\t\t\t\t\t\t\t:aria-label=\"menuButtonLabel(card)\"\n\t\t\t\t\t\t\t\t\t\t\t@keydown=\"onMenuKeydown(card, $event)\">\n\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\tv-if=\"canMove\"\n\t\t\t\t\t\t\t\t\t\t\t\trole=\"group\"\n\t\t\t\t\t\t\t\t\t\t\t\t:aria-label=\"moveLabel\">\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"cn-board-view__menu-heading\" aria-hidden=\"true\">{{ moveLabel }}</span>\n\t\t\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\t\t\tv-for=\"target in moveTargets(lane, column)\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t:key=\"`m-${cardKey(card)}-${target.key}`\"\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__menu-item\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-menu-move\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t:data-target=\"target.key\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t@click=\"onMenuMove(card, column, target)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t{{ target.label }}\n\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__menu-item\"\n\t\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-menu-new-tab\"\n\t\t\t\t\t\t\t\t\t\t\t\t@click=\"onMenuOpenNewTab(card)\">\n\t\t\t\t\t\t\t\t\t\t\t\t{{ openInNewTabLabel }}\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tv-if=\"roleText(card, roles.sub) !== ''\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__card-sub\"\n\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-sub\">\n\t\t\t\t\t\t\t\t\t{{ roleText(card, roles.sub) }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tv-if=\"roleText(card, roles.pill) !== ''\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__card-pills\">\n\t\t\t\t\t\t\t\t\t<CnStatusBadge\n\t\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__pill\"\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-pill\"\n\t\t\t\t\t\t\t\t\t\t:label=\"roleText(card, roles.pill)\"\n\t\t\t\t\t\t\t\t\t\t:variant=\"pillVariant(card)\" />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tv-if=\"dueText(card) !== '' || ownerName(card) !== ''\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__card-footer\"\n\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-footer\">\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__due-text\"\n\t\t\t\t\t\t\t\t\t\t:class=\"cardDueState(card) ? `cn-board-view__due-text--${cardDueState(card)}` : null\"\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-due\">\n\t\t\t\t\t\t\t\t\t\t{{ dueText(card) }}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tv-if=\"ownerName(card) !== ''\"\n\t\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__avatar\"\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-owner\"\n\t\t\t\t\t\t\t\t\t\t:title=\"ownerName(card)\"\n\t\t\t\t\t\t\t\t\t\trole=\"img\"\n\t\t\t\t\t\t\t\t\t\t:aria-label=\"ownerName(card)\">\n\t\t\t\t\t\t\t\t\t\t<span aria-hidden=\"true\">{{ ownerInitials(card) }}</span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tv-if=\"dueLabel(card)\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__due\"\n\t\t\t\t\t\t\t\t\t:class=\"`cn-board-view__due--${dueState(card)}`\"\n\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-due\">\n\t\t\t\t\t\t\t\t\t{{ dueLabel(card) }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tv-for=\"field in cardFields\"\n\t\t\t\t\t\t\t\t\t:key=\"`f-${cardKey(card)}-${field}`\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__card-field\">\n\t\t\t\t\t\t\t\t\t{{ card[field] }}\n\t\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t\t<!--\n\t\t\t\t\t\t\t\tOpening the card. A native button, so Enter and\n\t\t\t\t\t\t\t\tSpace both work: the old markup handled Enter\n\t\t\t\t\t\t\t\tonly, and Space is what most people try on\n\t\t\t\t\t\t\t\tsomething that looks like a button.\n\t\t\t\t\t\t\t-->\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__card-open\"\n\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-open\"\n\t\t\t\t\t\t\t\t\t:data-card-id=\"cardKey(card)\"\n\t\t\t\t\t\t\t\t\t:aria-label=\"cardLabel(card, column)\"\n\t\t\t\t\t\t\t\t\t@click=\"openCard(card, $event)\"\n\t\t\t\t\t\t\t\t\t@mousedown=\"preventMiddleClickAutoscroll\"\n\t\t\t\t\t\t\t\t\t@auxclick=\"onCardAuxClick(card, $event)\">\n\t\t\t\t\t\t\t\t\t{{ openLabel }}\n\t\t\t\t\t\t\t\t</button>\n\n\t\t\t\t\t\t\t\t<!--\n\t\t\t\t\t\t\t\tThe keyboard's way to do what a drag does. A board\n\t\t\t\t\t\t\t\twhose only move is a drag is a board a keyboard\n\t\t\t\t\t\t\t\tuser cannot use at all, and \"drag the card\" is not\n\t\t\t\t\t\t\t\tan instruction you can follow with a keyboard.\n\t\t\t\t\t\t\t-->\n\t\t\t\t\t\t\t\t<label v-if=\"canMove\" class=\"cn-board-view__move\">\n\t\t\t\t\t\t\t\t\t<span class=\"cn-board-view__move-label\">{{ moveLabel }}</span>\n\t\t\t\t\t\t\t\t\t<select\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-move\"\n\t\t\t\t\t\t\t\t\t\t:data-card-id=\"cardKey(card)\"\n\t\t\t\t\t\t\t\t\t\t:value=\"column.key\"\n\t\t\t\t\t\t\t\t\t\t@change=\"onMoveTo(card, column, $event)\">\n\t\t\t\t\t\t\t\t\t\t<option\n\t\t\t\t\t\t\t\t\t\t\tv-for=\"target in lane.columns\"\n\t\t\t\t\t\t\t\t\t\t\t:key=\"`t-${cardKey(card)}-${target.key}`\"\n\t\t\t\t\t\t\t\t\t\t\t:value=\"target.key\">\n\t\t\t\t\t\t\t\t\t\t\t{{ target.label }}\n\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</article>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<p\n\t\t\t\t\t\tv-else\n\t\t\t\t\t\tclass=\"cn-board-view__empty\"\n\t\t\t\t\t\tdata-testid=\"cn-board-column-empty\">\n\t\t\t\t\t\t{{ emptyColumnText }}\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<!-- A column cut by `columnLimit`: the rest behind one dashed\n\t\t\t\t\t button. The badge keeps showing the column's total. -->\n\t\t\t\t\t<button\n\t\t\t\t\t\tv-if=\"hiddenCount(lane, column) > 0\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"cn-board-view__show-more\"\n\t\t\t\t\t\tdata-testid=\"cn-board-show-more\"\n\t\t\t\t\t\t@click=\"showMore(lane, column)\">\n\t\t\t\t\t\t{{ showMoreLabel(hiddenCount(lane, column)) }}\n\t\t\t\t\t</button>\n\t\t\t\t</section>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<p\n\t\t\tv-if=\"refusal\"\n\t\t\tclass=\"cn-board-view__refusal\"\n\t\t\tdata-testid=\"cn-board-refusal\"\n\t\t\trole=\"alert\">\n\t\t\t{{ refusal }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport CnStatusBadge from '../CnStatusBadge/CnStatusBadge.vue'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { buildBoardColumns, resolveStageColor } from '../../utils/boardColumns.js'\nimport { buildSwimlanes } from '../../utils/boardSwimlanes.js'\nimport { DROP_OUTCOMES, runBoardDrop } from '../../utils/boardTransition.js'\nimport { daysUntil, dueStateForRow } from '../../utils/dueRule.js'\nimport { formatMetricValue } from '../../utils/formatMetric.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { isRowMiddleClick, preventMiddleClickAutoscroll } from '../../utils/rowAuxClick.js'\n\nimport '../../css/board.css'\n\n/**\n * CnBoardView — the index page's rows as a board, one column per stage.\n *\n * THE COLUMNS ARE THE SCHEMA'S, NOT THE DATA'S. `buildBoardColumns` decides\n * them and is tested on its own; this renders what it returns. A board that\n * built its columns from the values present would lose the stage nothing is\n * in, which is the one you drag a card into.\n *\n * šŸ”“ A MOVE GOES THROUGH THE HOST'S TRANSITION AND NEVER WRITES THE STATUS\n * FIELD. Writing it here would skip every guard, side effect and audit entry\n * the transition carries, and the board would become a way to move a case past\n * a rule the case page enforces. `runBoardDrop` owns that contract; this\n * component owns the gestures that reach it.\n *\n * šŸ”“ THERE ARE TWO GESTURES, ALWAYS. A board whose only move is a drag is a\n * board a keyboard user cannot use, and \"drag the card\" is not an instruction\n * anybody can follow with a keyboard. Move to on the card runs the identical\n * call.\n *\n * @event {object} card-click — A card was opened. Payload: the row.\n * @event {object} moved — A card moved. Payload: `{ card, toKey }`.\n * @event {object} refused — A move was refused. Payload: `{ card, message }`.\n * @event {object} stale — The card had already moved. Payload: `{ card }`.\n */\nexport default {\n\tname: 'CnBoardView',\n\n\tcomponents: { CnStatusBadge },\n\n\tinject: {\n\t\t/**\n\t\t * The look the app is drawn in, provided by CnAppRoot. The board look\n\t\t * draws the screens' board anatomy (screens-kanban-parity).\n\t\t */\n\t\tcnLook: { default: 'nextcloud' },\n\t},\n\n\tprops: {\n\t\t/** The rows the list holds. */\n\t\trows: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The status field's schema: its enum or its lifecycle states. */\n\t\tstatusFieldSchema: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The property a row's status lives on. */\n\t\tstatusField: {\n\t\t\ttype: String,\n\t\t\tdefault: 'status',\n\t\t},\n\n\t\t/** The fields a card shows. */\n\t\tcardFields: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** A second field to group the board into rows by. */\n\t\tswimlaneField: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The row key, so a card is identifiable. */\n\t\trowKey: {\n\t\t\ttype: String,\n\t\t\tdefault: 'id',\n\t\t},\n\n\t\t/**\n\t\t * The host's transition. Absent, the board is read-only: no drag, no\n\t\t * Move to, because a gesture that cannot do anything is worse than no\n\t\t * gesture at all.\n\t\t */\n\t\trunTransition: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Re-read one card, to check it has not moved under the dragger. */\n\t\treread: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Whether the counts are of one page. A count of a page shown as\n\t\t * though it were the total is a number somebody quotes in a meeting.\n\t\t */\n\t\tpaged: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Marks late cards: `{ field, soonDays? }`. `field` is the dot-path to\n\t\t * a card's due date. A date before today gets an error edge and the\n\t\t * label \"Overdue\"; a date within `soonDays` (default 3) gets \"Due\n\t\t * soon\" in the warning colour. `null` (the default) marks nothing.\n\t\t *\n\t\t * The same rule shape the table's date cell uses, so a list and its\n\t\t * board agree on what late means.\n\t\t *\n\t\t * @type {{field: string, soonDays?: number}|null}\n\t\t */\n\t\tdueRule: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The board look's card roles (manifest `config.board.card`):\n\t\t * `{ title, sub, pill, due, owner, pillColors? }`. `sub` is a field or\n\t\t * a list of fields joined by a middle dot; `pillColors` maps a pill\n\t\t * value to a badge variant. Missing, the first of `cardFields` is the\n\t\t * title and the rest form the sub line. The Nextcloud look ignores it.\n\t\t *\n\t\t * @type {{title?: string, sub?: string|Array<string>, pill?: string, due?: string, owner?: string, pillColors?: object}|null}\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-the-board-card-anatomy\n\t\t */\n\t\tcardRoles: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The field on a column's state that holds its dot colour (manifest\n\t\t * `config.board.colorField`). Empty, the lifecycle state's declared\n\t\t * `color` is used, else the secondary text colour.\n\t\t *\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-the-board-column-header\n\t\t */\n\t\tcolorField: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * A numeric field whose sum each column shows under its heading\n\t\t * (manifest `config.board.sumField`). Empty shows no sum line.\n\t\t *\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-the-board-column-header\n\t\t */\n\t\tsumField: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * How the sum is formatted, the metric format shape:\n\t\t * `{ style: 'currency', currency: 'EUR', decimals: 2 }`.\n\t\t *\n\t\t * @type {{style?: string, currency?: string, decimals?: number}|null}\n\t\t */\n\t\tsumFormat: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * How many cards a column draws before a \"Show N more\" button\n\t\t * (manifest `config.board.columnLimit`). 0 (the default) draws every\n\t\t * card.\n\t\t *\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-a-long-column-is-cut-with-a-show-more-button\n\t\t */\n\t\tcolumnLimit: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\t},\n\n\temits: ['card-click', 'card-aux-click', 'moved', 'refused', 'stale', 'load-more'],\n\n\tdata() {\n\t\treturn {\n\t\t\t/** Lanes the reader has collapsed, for as long as they are here. */\n\t\t\tcollapsed: [],\n\t\t\t/** The guard's own words, when it refused the last move. */\n\t\t\trefusal: '',\n\t\t\t/** The card being dragged, and where from. */\n\t\t\tdragging: null,\n\t\t\t/** The day late marking measures from. */\n\t\t\ttoday: new Date(),\n\t\t\t/** Columns the reader has expanded past `columnLimit` (lane::column). */\n\t\t\texpanded: [],\n\t\t\t/** The card whose menu is open (board look), by card key. */\n\t\t\topenMenuKey: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {boolean} Whether the status field can back a board at all. */\n\t\tusable() {\n\t\t\treturn this.board.usable\n\t\t},\n\n\t\t/** @return {object} The columns, from the schema. */\n\t\tboard() {\n\t\t\treturn buildBoardColumns({\n\t\t\t\tfield: this.statusFieldSchema,\n\t\t\t\trows: this.rows,\n\t\t\t\tstatusField: this.statusField,\n\t\t\t\toffBoardLabel: t('nextcloud-vue', 'Elsewhere'),\n\t\t\t\tcolorField: this.colorField,\n\t\t\t})\n\t\t},\n\n\t\t/** @return {boolean} Whether the app takes the board look. */\n\t\tisBoardLook() {\n\t\t\treturn normalizeLook(this.cnLook) === 'board'\n\t\t},\n\n\t\t/**\n\t\t * The card's roles: `cardRoles`, else the first of `cardFields` as the\n\t\t * title and the rest as the sub line.\n\t\t *\n\t\t * @return {{title: string, sub: Array<string>, pill: string, due: string, owner: string, pillColors: object}} The roles.\n\t\t */\n\t\troles() {\n\t\t\tconst given = this.cardRoles && typeof this.cardRoles === 'object' ? this.cardRoles : null\n\t\t\tconst fields = Array.isArray(this.cardFields) ? this.cardFields : []\n\t\t\tconst sub = given && given.sub !== undefined\n\t\t\t\t? (Array.isArray(given.sub) ? given.sub : [given.sub])\n\t\t\t\t: (given ? [] : fields.slice(1))\n\t\t\treturn {\n\t\t\t\ttitle: (given && given.title) || fields[0] || '',\n\t\t\t\tsub: sub.filter(Boolean),\n\t\t\t\tpill: (given && given.pill) || '',\n\t\t\t\tdue: (given && given.due) || '',\n\t\t\t\towner: (given && given.owner) || '',\n\t\t\t\tpillColors: (given && given.pillColors) || {},\n\t\t\t}\n\t\t},\n\n\t\t/** @return {string} The Open in new tab menu item. */\n\t\topenInNewTabLabel() {\n\t\t\treturn t('nextcloud-vue', 'Open in new tab')\n\t\t},\n\n\t\t/** @return {Array<object>} The board as rows of columns. */\n\t\tlanes() {\n\t\t\treturn buildSwimlanes({\n\t\t\t\tcolumns: this.board.columns,\n\t\t\t\tswimlaneField: this.swimlaneField,\n\t\t\t\tunassignedLabel: t('nextcloud-vue', 'Unassigned'),\n\t\t\t})\n\t\t},\n\n\t\t/** @return {boolean} Whether a move is possible at all. */\n\t\tcanMove() {\n\t\t\treturn typeof this.runTransition === 'function'\n\t\t},\n\n\t\t/** @return {string} What to say when the field cannot back a board. */\n\t\tunusableText() {\n\t\t\treturn t('nextcloud-vue', 'This list has no status field with stages, so it cannot be shown as a board.')\n\t\t},\n\n\t\t/** @return {string} The board's accessible name. */\n\t\tboardLabel() {\n\t\t\treturn t('nextcloud-vue', 'Board')\n\t\t},\n\n\t\t/** @return {string} The Move to control's label. */\n\t\tmoveLabel() {\n\t\t\treturn t('nextcloud-vue', 'Move to')\n\t\t},\n\n\t\t/**\n\t\t * The visible text on a card's opening control.\n\t\t *\n\t\t * Short, because it repeats on every card. Which card it opens is\n\t\t * said by the control's `aria-label`, so a reader hearing a list of\n\t\t * buttons hears the card's own name rather than \"Open\" nine times.\n\t\t *\n\t\t * @return {string} The label.\n\t\t */\n\t\topenLabel() {\n\t\t\treturn t('nextcloud-vue', 'Open')\n\t\t},\n\n\t\t/** @return {string} What an empty column says. */\n\t\temptyColumnText() {\n\t\t\treturn t('nextcloud-vue', 'Nothing here')\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\tpreventMiddleClickAutoscroll,\n\n\t\t/**\n\t\t * A card's due state under `dueRule`.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {'overdue'|'soon'|'ok'|null} The state, or null when no rule applies.\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-late-marking-on-board-cards\n\t\t */\n\t\tdueState(card) {\n\t\t\treturn dueStateForRow(card, this.dueRule, this.today)\n\t\t},\n\n\t\t/**\n\t\t * The due state of a card: in the board look from the card's `due`\n\t\t * role (under `dueRule` when given), else from `dueRule` as before.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {'overdue'|'soon'|'ok'|null} The state.\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-the-board-card-anatomy\n\t\t */\n\t\tcardDueState(card) {\n\t\t\tif (this.isBoardLook && this.roles.due !== '') {\n\t\t\t\tconst rule = { ...(this.dueRule || {}), field: this.roles.due }\n\t\t\t\treturn dueStateForRow(card, rule, this.today)\n\t\t\t}\n\t\t\treturn this.dueState(card)\n\t\t},\n\n\t\t/**\n\t\t * The text of one role on a card: a field's value, or a list of\n\t\t * fields joined by a middle dot. An empty value drops out together\n\t\t * with its separator.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @param {string|Array<string>} role The field or fields.\n\t\t * @return {string} The text, '' when every value is empty.\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-the-board-card-anatomy\n\t\t */\n\t\troleText(card, role) {\n\t\t\tconst fields = Array.isArray(role) ? role : [role]\n\t\t\treturn fields\n\t\t\t\t.filter((field) => typeof field === 'string' && field !== '')\n\t\t\t\t.map((field) => this.textOf(readPath(card, field)))\n\t\t\t\t.filter((value) => value !== '')\n\t\t\t\t.join(' \\u00b7 ')\n\t\t},\n\n\t\t/**\n\t\t * A value as text: a string or number as is, an object by its label.\n\t\t *\n\t\t * @param {unknown} value The raw value.\n\t\t * @return {string} The text.\n\t\t */\n\t\ttextOf(value) {\n\t\t\tif (value === null || value === undefined) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (typeof value === 'object') {\n\t\t\t\tconst named = value.displayName ?? value.name ?? value.label ?? value.title ?? ''\n\t\t\t\treturn String(named).trim()\n\t\t\t}\n\t\t\treturn String(value).trim()\n\t\t},\n\n\t\t/**\n\t\t * The pill's badge variant, from `cardRoles.pillColors`.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {string} A CnStatusBadge variant.\n\t\t */\n\t\tpillVariant(card) {\n\t\t\tconst raw = this.textOf(readPath(card, this.roles.pill))\n\t\t\tconst variant = this.roles.pillColors[raw] ?? this.roles.pillColors[raw.toLowerCase()]\n\t\t\treturn ['default', 'primary', 'success', 'warning', 'error', 'info'].includes(variant) ? variant : 'default'\n\t\t},\n\n\t\t/**\n\t\t * The footer's due text: \"Due today\", \"Due 2 Nov\", or \"Overdue 2 Nov\"\n\t\t * for a date in the past. Words, so the late tone is not colour alone.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {string} The text, '' without a readable date.\n\t\t */\n\t\tdueText(card) {\n\t\t\tif (this.roles.due === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst value = readPath(card, this.roles.due)\n\t\t\tconst days = daysUntil(value, this.today)\n\t\t\tif (days === null) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (days === 0) {\n\t\t\t\treturn t('nextcloud-vue', 'Due today')\n\t\t\t}\n\t\t\tconst date = new Date(value)\n\t\t\tconst shown = Number.isNaN(date.getTime())\n\t\t\t\t? String(value)\n\t\t\t\t: date.toLocaleDateString(undefined, { day: 'numeric', month: 'short' })\n\t\t\treturn days < 0\n\t\t\t\t? t('nextcloud-vue', 'Overdue {date}', { date: shown })\n\t\t\t\t: t('nextcloud-vue', 'Due {date}', { date: shown })\n\t\t},\n\n\t\t/**\n\t\t * The owner's name.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {string} The name, '' when there is none.\n\t\t */\n\t\townerName(card) {\n\t\t\treturn this.roles.owner === '' ? '' : this.textOf(readPath(card, this.roles.owner))\n\t\t},\n\n\t\t/**\n\t\t * The owner's initials: the first letters of the first two words.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {string} Up to two capital letters.\n\t\t */\n\t\townerInitials(card) {\n\t\t\treturn this.ownerName(card)\n\t\t\t\t.split(/\\s+/)\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.slice(0, 2)\n\t\t\t\t.map((word) => word.charAt(0).toUpperCase())\n\t\t\t\t.join('')\n\t\t},\n\n\t\t/**\n\t\t * The colour of a column's dot.\n\t\t *\n\t\t * @param {object} column The column.\n\t\t * @return {string} A CSS colour or variable.\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-the-board-column-header\n\t\t */\n\t\tdotColor(column) {\n\t\t\treturn resolveStageColor(column.color)\n\t\t},\n\n\t\t/**\n\t\t * The sum of `sumField` over a column's cards, formatted.\n\t\t *\n\t\t * @param {object} column The column.\n\t\t * @return {string} The sum, '' when no `sumField` is set.\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-the-board-column-header\n\t\t */\n\t\tcolumnSum(column) {\n\t\t\tif (!this.sumField) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst total = column.cards.reduce((sum, card) => {\n\t\t\t\tconst n = Number(readPath(card, this.sumField))\n\t\t\t\treturn Number.isFinite(n) ? sum + n : sum\n\t\t\t}, 0)\n\t\t\treturn formatMetricValue(total, this.sumFormat || { style: 'decimal', decimals: 0 }, {})\n\t\t},\n\n\t\t/**\n\t\t * The cards a column draws: all of them, or the first `columnLimit`\n\t\t * until the reader shows the rest.\n\t\t *\n\t\t * @param {object} lane The lane.\n\t\t * @param {object} column The column.\n\t\t * @return {Array<object>} The cards.\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-a-long-column-is-cut-with-a-show-more-button\n\t\t */\n\t\tvisibleCards(lane, column) {\n\t\t\tconst limit = Number(this.columnLimit)\n\t\t\tif (!(limit > 0) || this.expanded.includes(this.expandKey(lane, column))) {\n\t\t\t\treturn column.cards\n\t\t\t}\n\t\t\treturn column.cards.slice(0, limit)\n\t\t},\n\n\t\t/**\n\t\t * How many cards of a column are cut.\n\t\t *\n\t\t * @param {object} lane The lane.\n\t\t * @param {object} column The column.\n\t\t * @return {number} The hidden count.\n\t\t */\n\t\thiddenCount(lane, column) {\n\t\t\treturn column.cards.length - this.visibleCards(lane, column).length\n\t\t},\n\n\t\t/**\n\t\t * @param {object} lane The lane.\n\t\t * @param {object} column The column.\n\t\t * @return {string} The key `expanded` holds.\n\t\t */\n\t\texpandKey(lane, column) {\n\t\t\treturn `${lane.key}::${column.key}`\n\t\t},\n\n\t\t/**\n\t\t * The show-more button's text.\n\t\t *\n\t\t * @param {number} count The hidden count.\n\t\t * @return {string} \"Show N more\".\n\t\t */\n\t\tshowMoreLabel(count) {\n\t\t\treturn t('nextcloud-vue', 'Show {count} more', { count })\n\t\t},\n\n\t\t/**\n\t\t * Show the rest of one column. With `paged` the host is also asked\n\t\t * for the column's next page (`load-more`), and the column is\n\t\t * expanded so the rows that arrive show.\n\t\t *\n\t\t * @param {object} lane The lane.\n\t\t * @param {object} column The column.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-a-long-column-is-cut-with-a-show-more-button\n\t\t */\n\t\tshowMore(lane, column) {\n\t\t\tif (this.paged) {\n\t\t\t\t/**\n\t\t\t\t * @event load-more Emitted when the reader presses \"Show N more\" on a paged board. Payload: `{ columnKey }`; the host loads that column's next page.\n\t\t\t\t */\n\t\t\t\tthis.$emit('load-more', { columnKey: column.key })\n\t\t\t}\n\t\t\tthis.expanded = [...this.expanded, this.expandKey(lane, column)]\n\t\t},\n\n\t\t/**\n\t\t * The columns a card can move to: every other column of its lane.\n\t\t *\n\t\t * @param {object} lane The lane.\n\t\t * @param {object} column The card's own column.\n\t\t * @return {Array<object>} The targets.\n\t\t */\n\t\tmoveTargets(lane, column) {\n\t\t\treturn lane.columns.filter((target) => target.key !== column.key)\n\t\t},\n\n\t\t/**\n\t\t * @param {object} card The card.\n\t\t * @return {boolean} Whether its menu is open.\n\t\t */\n\t\tisMenuOpen(card) {\n\t\t\treturn this.openMenuKey === this.cardKey(card)\n\t\t},\n\n\t\t/**\n\t\t * @param {object} card The card.\n\t\t * @return {string} The menu button's accessible name.\n\t\t */\n\t\tmenuButtonLabel(card) {\n\t\t\tconst name = this.roleText(card, this.roles.title) || this.cardKey(card)\n\t\t\treturn t('nextcloud-vue', 'Actions for {name}', { name })\n\t\t},\n\n\t\t/**\n\t\t * Open or close a card's menu, and put focus on its first item.\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @return {void}\n\t\t */\n\t\ttoggleMenu(card) {\n\t\t\tconst key = this.cardKey(card)\n\t\t\tthis.openMenuKey = this.openMenuKey === key ? null : key\n\t\t\tif (this.openMenuKey !== null) {\n\t\t\t\tthis.focusMenuItem(card, 0)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close the open menu, optionally returning focus to its button.\n\t\t *\n\t\t * @param {object} [card] The card whose button gets focus back.\n\t\t * @return {void}\n\t\t */\n\t\tcloseMenu(card) {\n\t\t\tthis.openMenuKey = null\n\t\t\tif (card && this.$el && typeof this.$el.querySelector === 'function') {\n\t\t\t\tthis.$nextTick(() => {\n\t\t\t\t\tconst button = this.$el.querySelector(`[data-testid=\"cn-board-card-menu\"][data-card-id=\"${this.cardKey(card)}\"]`)\n\t\t\t\t\tbutton?.focus?.()\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Focus the menu item at an index (opened menus only).\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @param {number} index The item's position.\n\t\t * @return {void}\n\t\t */\n\t\tfocusMenuItem(card, index) {\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tconst items = this.menuItems(card)\n\t\t\t\tconst item = items[((index % items.length) + items.length) % items.length]\n\t\t\t\titem?.focus?.()\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * @param {object} card The card.\n\t\t * @return {Array<HTMLElement>} The open menu's items.\n\t\t */\n\t\tmenuItems(card) {\n\t\t\tconst article = this.$el?.querySelector?.(`[data-testid=\"cn-board-card\"][data-card-id=\"${this.cardKey(card)}\"]`)\n\t\t\treturn article ? Array.from(article.querySelectorAll('[role=\"menuitem\"]')) : []\n\t\t},\n\n\t\t/**\n\t\t * Keys inside the open menu: arrows move, Escape closes.\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @param {KeyboardEvent} event The key press.\n\t\t * @return {void}\n\t\t */\n\t\tonMenuKeydown(card, event) {\n\t\t\tconst items = this.menuItems(card)\n\t\t\tconst at = items.indexOf(document.activeElement)\n\t\t\tif (event.key === 'Escape') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tevent.stopPropagation()\n\t\t\t\tthis.closeMenu(card)\n\t\t\t} else if (event.key === 'ArrowDown') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.focusMenuItem(card, at + 1)\n\t\t\t} else if (event.key === 'ArrowUp') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.focusMenuItem(card, at - 1)\n\t\t\t} else if (event.key === 'Tab') {\n\t\t\t\tthis.closeMenu()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * M on a card, or a control inside it, opens its menu. Only in the\n\t\t * board look and only when the card can move.\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @param {object} column Its column.\n\t\t * @param {object} lane Its lane.\n\t\t * @param {KeyboardEvent} event The key press.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-the-card-shows-no-form-controls-at-rest\n\t\t */\n\t\tonCardKeydown(card, column, lane, event) {\n\t\t\tif (!this.isBoardLook || !this.canMove) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif ((event.key === 'm' || event.key === 'M') && !event.ctrlKey && !event.metaKey && !event.altKey) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tif (!this.isMenuOpen(card)) {\n\t\t\t\t\tthis.openMenuKey = this.cardKey(card)\n\t\t\t\t\tthis.focusMenuItem(card, 0)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Choose a column from the card's menu: the identical call a drop runs.\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @param {object} column Its column.\n\t\t * @param {object} target The column chosen.\n\t\t * @return {Promise<void>} Nothing.\n\t\t */\n\t\tasync onMenuMove(card, column, target) {\n\t\t\tthis.closeMenu(card)\n\t\t\tawait this.move(card, column.key, target.key)\n\t\t},\n\n\t\t/**\n\t\t * Open the card in a new tab: the same event a ctrl-click emits.\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @return {void}\n\t\t */\n\t\tonMenuOpenNewTab(card) {\n\t\t\tthis.closeMenu(card)\n\t\t\tthis.openCard(card, new MouseEvent('click', { ctrlKey: true, bubbles: true }))\n\t\t},\n\n\t\t/**\n\t\t * The words a late card carries. Colour alone would not reach a reader\n\t\t * who cannot see it, or cannot tell red from amber.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {string} \"Overdue\", \"Due soon\", or '' for a card that is fine.\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-late-marking-on-board-cards\n\t\t */\n\t\tdueLabel(card) {\n\t\t\tconst state = this.dueState(card)\n\t\t\tif (state === 'overdue') {\n\t\t\t\treturn t('nextcloud-vue', 'Overdue')\n\t\t\t}\n\t\t\treturn state === 'soon' ? t('nextcloud-vue', 'Due soon') : ''\n\t\t},\n\n\t\t/**\n\t\t * Open one card. The pointer and the keyboard both come through here,\n\t\t * so a reader on Enter reaches the same record as a reader on click.\n\t\t *\n\t\t * @param {object} card The card the reader picked.\n\t\t * @param {MouseEvent|KeyboardEvent} [event] The originating event.\n\t\t * @return {void} Nothing.\n\t\t */\n\t\topenCard(card, event) {\n\t\t\t/**\n\t\t\t * @event card-click Emitted when a reader opens a card, by click or Enter. Payload: `(card, event)` — the card row and the native event, so the host can open it in a new tab on a ctrl/cmd/shift click. A middle click emits `card-aux-click` instead.\n\t\t\t */\n\t\t\tthis.$emit('card-click', card, event)\n\t\t},\n\n\t\t/**\n\t\t * Middle click on a card's open button: emits `card-aux-click`, not\n\t\t * `card-click`, so an existing listener that navigates never moves the\n\t\t * current tab away.\n\t\t *\n\t\t * @param {object} card The card the reader picked.\n\t\t * @param {MouseEvent} event The auxclick event.\n\t\t * @return {void} Nothing.\n\t\t */\n\t\tonCardAuxClick(card, event) {\n\t\t\tif (isRowMiddleClick(event)) {\n\t\t\t\t/**\n\t\t\t\t * @event card-aux-click Emitted when a reader middle-clicks a card, for opening it in a new tab (see `openRowTarget`). Payload: `(card, event)` — the card row and the native auxclick event.\n\t\t\t\t */\n\t\t\t\tthis.$emit('card-aux-click', card, event)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A card's identity.\n\t\t *\n\t\t * @param {object} card The row.\n\t\t * @return {string} Its key.\n\t\t */\n\t\tcardKey(card) {\n\t\t\treturn String(card?.[this.rowKey] ?? '')\n\t\t},\n\n\t\t/**\n\t\t * A column's count, said as a page count when that is what it is.\n\t\t *\n\t\t * @param {object} column The column.\n\t\t * @return {string} The count.\n\t\t */\n\t\tcountLabel(column) {\n\t\t\treturn this.paged\n\t\t\t\t? t('nextcloud-vue', '{count} on this page', { count: column.count })\n\t\t\t\t: String(column.count)\n\t\t},\n\n\t\t/**\n\t\t * What a card is called to somebody who cannot see which column it is in.\n\t\t *\n\t\t * @param {object} card The row.\n\t\t * @param {object} column Its column.\n\t\t * @return {string} The accessible name.\n\t\t */\n\t\tcardLabel(card, column) {\n\t\t\tconst name = this.cardFields.map((field) => card?.[field]).filter(Boolean).join(', ')\n\t\t\treturn t('nextcloud-vue', '{name}, in {column}', { name: name || this.cardKey(card), column: column.label })\n\t\t},\n\n\t\t/**\n\t\t * Whether a lane is collapsed.\n\t\t *\n\t\t * @param {string} key The lane.\n\t\t * @return {boolean} True when collapsed.\n\t\t */\n\t\tisCollapsed(key) {\n\t\t\treturn this.collapsed.includes(key)\n\t\t},\n\n\t\t/**\n\t\t * Collapse a lane, or open it again.\n\t\t *\n\t\t * Held in the component for as long as the reader is on the view, and\n\t\t * deliberately not persisted: a collapsed lane somebody forgot they\n\t\t * collapsed is work that has gone missing for them.\n\t\t *\n\t\t * @param {string} key The lane.\n\t\t */\n\t\ttoggleLane(key) {\n\t\t\tthis.collapsed = this.isCollapsed(key)\n\t\t\t\t? this.collapsed.filter((entry) => entry !== key)\n\t\t\t\t: [...this.collapsed, key]\n\t\t},\n\n\t\t/**\n\t\t * Remember which card is being dragged and where from.\n\t\t *\n\t\t * @param {object} card The row.\n\t\t * @param {object} column Its column.\n\t\t * @param {DragEvent} event The event.\n\t\t */\n\t\tonDragStart(card, column, event) {\n\t\t\tthis.dragging = { card, fromKey: column.key }\n\t\t\t// Firefox drops a drag that carries no data.\n\t\t\tevent?.dataTransfer?.setData?.('text/plain', this.cardKey(card))\n\t\t},\n\n\t\t/**\n\t\t * A drop on a column.\n\t\t *\n\t\t * @param {object} column The column dropped on.\n\t\t * @return {Promise<void>} Nothing.\n\t\t */\n\t\tasync onDrop(column) {\n\t\t\tif (!this.dragging) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst { card, fromKey } = this.dragging\n\t\t\tthis.dragging = null\n\t\t\tawait this.move(card, fromKey, column.key)\n\t\t},\n\n\t\t/**\n\t\t * Move to, from the card's own menu.\n\t\t *\n\t\t * @param {object} card The row.\n\t\t * @param {object} column Its column.\n\t\t * @param {Event} event The change event.\n\t\t * @return {Promise<void>} Nothing.\n\t\t */\n\t\tasync onMoveTo(card, column, event) {\n\t\t\tawait this.move(card, column.key, event?.target?.value ?? '')\n\t\t},\n\n\t\t/**\n\t\t * The one move, whichever gesture asked for it.\n\t\t *\n\t\t * @param {object} card The row.\n\t\t * @param {string} fromKey Where it was.\n\t\t * @param {string} toKey Where it is going.\n\t\t * @return {Promise<void>} Nothing.\n\t\t */\n\t\tasync move(card, fromKey, toKey) {\n\t\t\tthis.refusal = ''\n\n\t\t\tconst result = await runBoardDrop({\n\t\t\t\tcard,\n\t\t\t\tfromKey,\n\t\t\t\ttoKey,\n\t\t\t\tstatusField: this.statusField,\n\t\t\t\trunTransition: this.runTransition,\n\t\t\t\treread: this.reread,\n\t\t\t})\n\n\t\t\tif (result.outcome === DROP_OUTCOMES.MOVED) {\n\t\t\t\t/**\n\t\t\t\t * @event moved Emitted when the host's transition accepted the move and the card now sits in the new lane. Payload: `{ card, toKey }`.\n\t\t\t\t */\n\t\t\t\tthis.$emit('moved', { card: result.card, toKey })\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (result.outcome === DROP_OUTCOMES.REFUSED) {\n\t\t\t\t// The guard's own sentence when it gave one. Our own only when\n\t\t\t\t// it did not, so the two are never confused.\n\t\t\t\tthis.refusal = result.message || t('nextcloud-vue', 'That move was refused.')\n\t\t\t\t/**\n\t\t\t\t * @event refused Emitted when the guard turned the move down. Payload: `{ card, message }`, the message being the guard's own sentence when it gave one.\n\t\t\t\t */\n\t\t\t\tthis.$emit('refused', { card: result.card, message: this.refusal })\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (result.outcome === DROP_OUTCOMES.STALE) {\n\t\t\t\tthis.refusal = t('nextcloud-vue', 'Somebody else moved this card. It is shown where it is now.')\n\t\t\t\t/**\n\t\t\t\t * @event stale Emitted when somebody else moved the card first, so the board shows it where it is now. Payload: `{ card }`.\n\t\t\t\t */\n\t\t\t\tthis.$emit('stale', { card: result.card })\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.cn-board-view__columns {\n\tdisplay: flex;\n\tgap: 12px;\n\toverflow-x: auto;\n\talign-items: flex-start;\n}\n\n.cn-board-view__column {\n\tflex: 0 0 260px;\n\tbackground-color: var(--color-background-hover);\n\tborder-radius: var(--border-radius-large);\n\tpadding: 8px;\n}\n\n.cn-board-view__column-header {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\tgap: 8px;\n\tfont-size: 1rem;\n\tmargin: 0 0 8px;\n}\n\n.cn-board-view__count,\n.cn-board-view__empty,\n.cn-board-view__unusable {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-board-view__card {\n\tdisplay: block;\n\tbackground-color: var(--color-main-background);\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tpadding: 8px;\n\tmargin-bottom: 8px;\n}\n\n.cn-board-view__card-field {\n\tdisplay: block;\n}\n\n/* A late card: an edge in the error colour, drawn as an inset shadow so the\n card keeps its size and its rounded corners. The label below carries the\n meaning; the edge only helps a sighted reader find it. */\n.cn-board-view__card--overdue {\n\tborder-color: var(--color-error);\n\tbox-shadow: inset 3px 0 0 var(--color-error);\n}\n\n.cn-board-view__due {\n\tdisplay: block;\n\tfont-size: 0.85em;\n\tfont-weight: 700;\n}\n\n.cn-board-view__due--overdue {\n\tcolor: var(--color-error-text, var(--color-error));\n}\n\n.cn-board-view__due--soon {\n\tcolor: var(--color-warning-text, var(--color-main-text));\n\tfont-weight: 600;\n}\n\n/*\n * The card's opening control. The cursor and the focus ring live here now,\n * on the thing that actually does something, rather than on the box.\n */\n.cn-board-view__card-open {\n\tbackground: none;\n\tborder: none;\n\tpadding: 0;\n\tcursor: pointer;\n\tcolor: var(--color-primary-element);\n\tfont-size: 0.8rem;\n}\n\n.cn-board-view__card-open:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 2px;\n}\n\n.cn-board-view__lane-header {\n\tbackground: none;\n\tborder: none;\n\tfont-weight: bold;\n\tpadding: 8px 0;\n\tcursor: pointer;\n\tcolor: var(--color-main-text);\n}\n\n.cn-board-view__move-label {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.8rem;\n}\n\n.cn-board-view__refusal {\n\tcolor: var(--color-error);\n}\n</style>\n"],"names":["CnStatusBadge","t"],"mappings":";;;;;;;;;;;;AAgUA;;AAEC;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;AAGA;;;AAGA;;;AAGD,aAAe;AACd,CAAA,IAAI,EAAE,aAAa;;CAEnB,UAAU,EAAE,iBAAEA,UAAY,EAAG;;AAE7B,CAAA,MAAM,EAAE;AACP;;;;EAIA,MAAM,EAAE,EAAE,OAAO,EAAE,WAAU,EAAG;EAChC;;AAED,CAAA,KAAK,EAAE;;EAEN,IAAI,EAAE;GACL,IAAI,EAAE,KAAK;AACX,GAAA,OAAO,EAAE,MAAM,EAAE;GACjB;;;AAGD,EAAA,iBAAiB,EAAE;GAClB,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,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EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAA;AAC1C,IAAA;GACA;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnBoardView.vue2.js","sources":["../../../../src/components/CnBoardView/CnBoardView.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div\n\t\tclass=\"cn-board-view\"\n\t\t:class=\"{ 'cn-board-view--board': isBoardLook }\"\n\t\tdata-testid=\"cn-board-view\">\n\t\t<p v-if=\"!usable\" class=\"cn-board-view__unusable\" data-testid=\"cn-board-unusable\">\n\t\t\t{{ unusableText }}\n\t\t</p>\n\n\t\t<div\n\t\t\tv-for=\"lane in lanes\"\n\t\t\tv-else\n\t\t\t:key=\"`lane-${lane.key}`\"\n\t\t\tclass=\"cn-board-view__lane\"\n\t\t\tdata-testid=\"cn-board-lane\"\n\t\t\t:data-lane=\"lane.key\">\n\t\t\t<button\n\t\t\t\tv-if=\"lane.key !== ''\"\n\t\t\t\tclass=\"cn-board-view__lane-header\"\n\t\t\t\tdata-testid=\"cn-board-lane-header\"\n\t\t\t\t:aria-expanded=\"String(!isCollapsed(lane.key))\"\n\t\t\t\t@click=\"toggleLane(lane.key)\">\n\t\t\t\t{{ lane.label }} ({{ lane.count }})\n\t\t\t</button>\n\n\t\t\t<div\n\t\t\t\tv-show=\"!isCollapsed(lane.key)\"\n\t\t\t\tclass=\"cn-board-view__columns\"\n\t\t\t\trole=\"list\"\n\t\t\t\t:aria-label=\"lane.key === '' ? boardLabel : lane.label\">\n\t\t\t\t<section\n\t\t\t\t\tv-for=\"column in lane.columns\"\n\t\t\t\t\t:key=\"`col-${lane.key}-${column.key}`\"\n\t\t\t\t\tclass=\"cn-board-view__column\"\n\t\t\t\t\trole=\"listitem\"\n\t\t\t\t\tdata-testid=\"cn-board-column\"\n\t\t\t\t\t:data-column=\"column.key\"\n\t\t\t\t\t@dragover.prevent\n\t\t\t\t\t@drop=\"onDrop(column, $event)\">\n\t\t\t\t\t<!-- Board look: a dot, the label and a white count badge, with an\n\t\t\t\t\t optional sum line under it (screens-kanban-parity). -->\n\t\t\t\t\t<div v-if=\"isBoardLook\" class=\"cn-board-view__column-head\">\n\t\t\t\t\t\t<h2 class=\"cn-board-view__column-header cn-board-view__column-header--board\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclass=\"cn-board-view__dot\"\n\t\t\t\t\t\t\t\tdata-testid=\"cn-board-dot\"\n\t\t\t\t\t\t\t\t:style=\"{ background: dotColor(column) }\"\n\t\t\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t\t\t<span class=\"cn-board-view__column-title\">{{ column.label }}</span>\n\t\t\t\t\t\t\t<span class=\"cn-board-view__badge\" data-testid=\"cn-board-count\">\n\t\t\t\t\t\t\t\t{{ column.count }}<span v-if=\"paged\" class=\"hidden-visually\"> {{ t('nextcloud-vue', 'on this page') }}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tv-if=\"columnSum(column) !== ''\"\n\t\t\t\t\t\t\tclass=\"cn-board-view__sum\"\n\t\t\t\t\t\t\tdata-testid=\"cn-board-sum\">\n\t\t\t\t\t\t\t{{ columnSum(column) }}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<h3 v-else class=\"cn-board-view__column-header\">\n\t\t\t\t\t\t{{ column.label }}\n\t\t\t\t\t\t<span class=\"cn-board-view__count\" data-testid=\"cn-board-count\">\n\t\t\t\t\t\t\t{{ countLabel(column) }}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</h3>\n\n\t\t\t\t\t<!--\n\t\t\t\t\t\tA list of its own, so a reader is told how many cards\n\t\t\t\t\t\tthis column holds. The column is a listitem of the\n\t\t\t\t\t\tboard's list of columns; the cards are a list inside\n\t\t\t\t\t\tit, not more items of that same list.\n\t\t\t\t\t-->\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-if=\"column.cards.length > 0\"\n\t\t\t\t\t\tclass=\"cn-board-view__cards\"\n\t\t\t\t\t\trole=\"list\"\n\t\t\t\t\t\t:aria-label=\"column.label\">\n\t\t\t\t\t\t<!--\n\t\t\t\t\t\t\tThe card is a CONTAINER, and every action on it is\n\t\t\t\t\t\t\tits own control. It carries the drag and nothing\n\t\t\t\t\t\t\telse: no tabindex, no click, no key handler, and\n\t\t\t\t\t\t\tnever role=\"button\".\n\n\t\t\t\t\t\t\tšŸ”“ role=\"button\" HERE WOULD BREAK THE MOVE. An\n\t\t\t\t\t\t\telement with that role has presentational children,\n\t\t\t\t\t\t\tso the <select> below would be an interactive\n\t\t\t\t\t\t\tcontrol inside a button. That is invalid, and it\n\t\t\t\t\t\t\ttakes away the only way a keyboard user can move a\n\t\t\t\t\t\t\tcard. It would also collapse every field on the\n\t\t\t\t\t\t\tcard into one button label. See\n\t\t\t\t\t\t\topenspec/changes/board-card-role-and-keyboard.\n\n\t\t\t\t\t\t\tMeasured rather than argued: putting role=\"button\"\n\t\t\t\t\t\t\there makes axe report nested-interactive (serious,\n\t\t\t\t\t\t\t\"Interactive controls must not be nested\") and\n\t\t\t\t\t\t\taria-required-children (critical), and four tests\n\t\t\t\t\t\t\tin tests/a11y/CnBoardView.a11y.spec.js go red.\n\t\t\t\t\t\t\tGate 32 suggests exactly this change. The gate is a\n\t\t\t\t\t\t\tmechanical floor, not the standard.\n\t\t\t\t\t\t-->\n\t\t\t\t\t\t<article\n\t\t\t\t\t\t\tv-for=\"card in visibleCards(lane, column)\"\n\t\t\t\t\t\t\t:key=\"`card-${cardKey(card)}`\"\n\t\t\t\t\t\t\tclass=\"cn-board-view__card\"\n\t\t\t\t\t\t\t:class=\"[\n\t\t\t\t\t\t\t\tcardDueState(card) ? `cn-board-view__card--${cardDueState(card)}` : null,\n\t\t\t\t\t\t\t\t{ 'cn-board-view__card--board': isBoardLook },\n\t\t\t\t\t\t\t]\"\n\t\t\t\t\t\t\trole=\"listitem\"\n\t\t\t\t\t\t\tdata-testid=\"cn-board-card\"\n\t\t\t\t\t\t\t:data-card-id=\"cardKey(card)\"\n\t\t\t\t\t\t\t:draggable=\"canMove\"\n\t\t\t\t\t\t\t@dragstart=\"onDragStart(card, column, $event)\"\n\t\t\t\t\t\t\t@keydown=\"onCardKeydown(card, column, lane, $event)\">\n\t\t\t\t\t\t\t<!-- Board look: title link, sub line, pill, footer, and a\n\t\t\t\t\t\t\t menu button instead of the Move to select. -->\n\t\t\t\t\t\t\t<template v-if=\"isBoardLook\">\n\t\t\t\t\t\t\t\t<div class=\"cn-board-view__card-head\">\n\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\thref=\"#\"\n\t\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__card-title\"\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-open\"\n\t\t\t\t\t\t\t\t\t\t:data-card-id=\"cardKey(card)\"\n\t\t\t\t\t\t\t\t\t\t:aria-label=\"cardLabel(card, column)\"\n\t\t\t\t\t\t\t\t\t\t@click.prevent=\"openCard(card, $event)\"\n\t\t\t\t\t\t\t\t\t\t@mousedown=\"preventMiddleClickAutoscroll\"\n\t\t\t\t\t\t\t\t\t\t@auxclick=\"onCardAuxClick(card, $event)\">\n\t\t\t\t\t\t\t\t\t\t{{ roleText(card, roles.title) || cardKey(card) }}\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t<span class=\"cn-board-view__menu-wrap\">\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__menu-button\"\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-menu\"\n\t\t\t\t\t\t\t\t\t\t\t:data-card-id=\"cardKey(card)\"\n\t\t\t\t\t\t\t\t\t\t\taria-haspopup=\"menu\"\n\t\t\t\t\t\t\t\t\t\t\t:aria-expanded=\"String(isMenuOpen(card))\"\n\t\t\t\t\t\t\t\t\t\t\t:aria-label=\"menuButtonLabel(card)\"\n\t\t\t\t\t\t\t\t\t\t\t@click=\"toggleMenu(card)\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"cn-board-view__menu-dots\" aria-hidden=\"true\">&#8943;</span>\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\tv-if=\"isMenuOpen(card)\"\n\t\t\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__menu\"\n\t\t\t\t\t\t\t\t\t\t\trole=\"menu\"\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-menu-list\"\n\t\t\t\t\t\t\t\t\t\t\t:aria-label=\"menuButtonLabel(card)\"\n\t\t\t\t\t\t\t\t\t\t\t@keydown=\"onMenuKeydown(card, $event)\">\n\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\tv-if=\"canMove\"\n\t\t\t\t\t\t\t\t\t\t\t\trole=\"group\"\n\t\t\t\t\t\t\t\t\t\t\t\t:aria-label=\"moveLabel\">\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"cn-board-view__menu-heading\" aria-hidden=\"true\">{{ moveLabel }}</span>\n\t\t\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\t\t\tv-for=\"target in moveTargets(lane, column)\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t:key=\"`m-${cardKey(card)}-${target.key}`\"\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__menu-item\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-menu-move\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t:data-target=\"target.key\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t@click=\"onMenuMove(card, column, target)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t{{ target.label }}\n\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__menu-item\"\n\t\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-menu-new-tab\"\n\t\t\t\t\t\t\t\t\t\t\t\t@click=\"onMenuOpenNewTab(card)\">\n\t\t\t\t\t\t\t\t\t\t\t\t{{ openInNewTabLabel }}\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tv-if=\"roleText(card, roles.sub) !== ''\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__card-sub\"\n\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-sub\">\n\t\t\t\t\t\t\t\t\t{{ roleText(card, roles.sub) }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tv-if=\"roleText(card, roles.pill) !== ''\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__card-pills\">\n\t\t\t\t\t\t\t\t\t<CnStatusBadge\n\t\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__pill\"\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-pill\"\n\t\t\t\t\t\t\t\t\t\t:label=\"roleText(card, roles.pill)\"\n\t\t\t\t\t\t\t\t\t\t:variant=\"pillVariant(card)\" />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tv-if=\"dueText(card) !== '' || ownerName(card) !== ''\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__card-footer\"\n\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-footer\">\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__due-text\"\n\t\t\t\t\t\t\t\t\t\t:class=\"cardDueState(card) ? `cn-board-view__due-text--${cardDueState(card)}` : null\"\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-due\">\n\t\t\t\t\t\t\t\t\t\t{{ dueText(card) }}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tv-if=\"ownerName(card) !== ''\"\n\t\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__avatar\"\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-owner\"\n\t\t\t\t\t\t\t\t\t\t:title=\"ownerName(card)\"\n\t\t\t\t\t\t\t\t\t\trole=\"img\"\n\t\t\t\t\t\t\t\t\t\t:aria-label=\"ownerName(card)\">\n\t\t\t\t\t\t\t\t\t\t<span aria-hidden=\"true\">{{ ownerInitials(card) }}</span>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tv-if=\"dueLabel(card)\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__due\"\n\t\t\t\t\t\t\t\t\t:class=\"`cn-board-view__due--${dueState(card)}`\"\n\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-due\">\n\t\t\t\t\t\t\t\t\t{{ dueLabel(card) }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tv-for=\"field in cardFields\"\n\t\t\t\t\t\t\t\t\t:key=\"`f-${cardKey(card)}-${field}`\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__card-field\">\n\t\t\t\t\t\t\t\t\t{{ card[field] }}\n\t\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t\t<!--\n\t\t\t\t\t\t\t\tOpening the card. A native button, so Enter and\n\t\t\t\t\t\t\t\tSpace both work: the old markup handled Enter\n\t\t\t\t\t\t\t\tonly, and Space is what most people try on\n\t\t\t\t\t\t\t\tsomething that looks like a button.\n\t\t\t\t\t\t\t-->\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-board-view__card-open\"\n\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-card-open\"\n\t\t\t\t\t\t\t\t\t:data-card-id=\"cardKey(card)\"\n\t\t\t\t\t\t\t\t\t:aria-label=\"cardLabel(card, column)\"\n\t\t\t\t\t\t\t\t\t@click=\"openCard(card, $event)\"\n\t\t\t\t\t\t\t\t\t@mousedown=\"preventMiddleClickAutoscroll\"\n\t\t\t\t\t\t\t\t\t@auxclick=\"onCardAuxClick(card, $event)\">\n\t\t\t\t\t\t\t\t\t{{ openLabel }}\n\t\t\t\t\t\t\t\t</button>\n\n\t\t\t\t\t\t\t\t<!--\n\t\t\t\t\t\t\t\tThe keyboard's way to do what a drag does. A board\n\t\t\t\t\t\t\t\twhose only move is a drag is a board a keyboard\n\t\t\t\t\t\t\t\tuser cannot use at all, and \"drag the card\" is not\n\t\t\t\t\t\t\t\tan instruction you can follow with a keyboard.\n\t\t\t\t\t\t\t-->\n\t\t\t\t\t\t\t\t<label v-if=\"canMove\" class=\"cn-board-view__move\">\n\t\t\t\t\t\t\t\t\t<span class=\"cn-board-view__move-label\">{{ moveLabel }}</span>\n\t\t\t\t\t\t\t\t\t<select\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"cn-board-move\"\n\t\t\t\t\t\t\t\t\t\t:data-card-id=\"cardKey(card)\"\n\t\t\t\t\t\t\t\t\t\t:value=\"column.key\"\n\t\t\t\t\t\t\t\t\t\t@change=\"onMoveTo(card, column, $event)\">\n\t\t\t\t\t\t\t\t\t\t<option\n\t\t\t\t\t\t\t\t\t\t\tv-for=\"target in lane.columns\"\n\t\t\t\t\t\t\t\t\t\t\t:key=\"`t-${cardKey(card)}-${target.key}`\"\n\t\t\t\t\t\t\t\t\t\t\t:value=\"target.key\">\n\t\t\t\t\t\t\t\t\t\t\t{{ target.label }}\n\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</article>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<p\n\t\t\t\t\t\tv-else\n\t\t\t\t\t\tclass=\"cn-board-view__empty\"\n\t\t\t\t\t\tdata-testid=\"cn-board-column-empty\">\n\t\t\t\t\t\t{{ emptyColumnText }}\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<!-- A column cut by `columnLimit`: the rest behind one dashed\n\t\t\t\t\t button. The badge keeps showing the column's total. -->\n\t\t\t\t\t<button\n\t\t\t\t\t\tv-if=\"hiddenCount(lane, column) > 0\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"cn-board-view__show-more\"\n\t\t\t\t\t\tdata-testid=\"cn-board-show-more\"\n\t\t\t\t\t\t@click=\"showMore(lane, column)\">\n\t\t\t\t\t\t{{ showMoreLabel(hiddenCount(lane, column)) }}\n\t\t\t\t\t</button>\n\t\t\t\t</section>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<p\n\t\t\tv-if=\"refusal\"\n\t\t\tclass=\"cn-board-view__refusal\"\n\t\t\tdata-testid=\"cn-board-refusal\"\n\t\t\trole=\"alert\">\n\t\t\t{{ refusal }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport CnStatusBadge from '../CnStatusBadge/CnStatusBadge.vue'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { isBadgeVariant } from '../../utils/badgeVariants.js'\nimport { buildBoardColumns, resolveStageColor } from '../../utils/boardColumns.js'\nimport { buildSwimlanes } from '../../utils/boardSwimlanes.js'\nimport { DROP_OUTCOMES, runBoardDrop } from '../../utils/boardTransition.js'\nimport { daysUntil, dueStateForRow } from '../../utils/dueRule.js'\nimport { formatMetricValue } from '../../utils/formatMetric.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { isRowMiddleClick, preventMiddleClickAutoscroll } from '../../utils/rowAuxClick.js'\n\nimport '../../css/board.css'\n\n/**\n * CnBoardView — the index page's rows as a board, one column per stage.\n *\n * THE COLUMNS ARE THE SCHEMA'S, NOT THE DATA'S. `buildBoardColumns` decides\n * them and is tested on its own; this renders what it returns. A board that\n * built its columns from the values present would lose the stage nothing is\n * in, which is the one you drag a card into.\n *\n * šŸ”“ A MOVE GOES THROUGH THE HOST'S TRANSITION AND NEVER WRITES THE STATUS\n * FIELD. Writing it here would skip every guard, side effect and audit entry\n * the transition carries, and the board would become a way to move a case past\n * a rule the case page enforces. `runBoardDrop` owns that contract; this\n * component owns the gestures that reach it.\n *\n * šŸ”“ THERE ARE TWO GESTURES, ALWAYS. A board whose only move is a drag is a\n * board a keyboard user cannot use, and \"drag the card\" is not an instruction\n * anybody can follow with a keyboard. Move to on the card runs the identical\n * call.\n *\n * @event {object} card-click — A card was opened. Payload: the row.\n * @event {object} moved — A card moved. Payload: `{ card, toKey }`.\n * @event {object} refused — A move was refused. Payload: `{ card, message }`.\n * @event {object} stale — The card had already moved. Payload: `{ card }`.\n */\nexport default {\n\tname: 'CnBoardView',\n\n\tcomponents: { CnStatusBadge },\n\n\tinject: {\n\t\t/**\n\t\t * The look the app is drawn in, provided by CnAppRoot. The board look\n\t\t * draws the screens' board anatomy (screens-kanban-parity).\n\t\t */\n\t\tcnLook: { default: 'nextcloud' },\n\t},\n\n\tprops: {\n\t\t/** The rows the list holds. */\n\t\trows: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The status field's schema: its enum or its lifecycle states. */\n\t\tstatusFieldSchema: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The property a row's status lives on. */\n\t\tstatusField: {\n\t\t\ttype: String,\n\t\t\tdefault: 'status',\n\t\t},\n\n\t\t/** The fields a card shows. */\n\t\tcardFields: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** A second field to group the board into rows by. */\n\t\tswimlaneField: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The row key, so a card is identifiable. */\n\t\trowKey: {\n\t\t\ttype: String,\n\t\t\tdefault: 'id',\n\t\t},\n\n\t\t/**\n\t\t * The host's transition. Absent, the board is read-only: no drag, no\n\t\t * Move to, because a gesture that cannot do anything is worse than no\n\t\t * gesture at all.\n\t\t */\n\t\trunTransition: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Re-read one card, to check it has not moved under the dragger. */\n\t\treread: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Whether the counts are of one page. A count of a page shown as\n\t\t * though it were the total is a number somebody quotes in a meeting.\n\t\t */\n\t\tpaged: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Marks late cards: `{ field, soonDays? }`. `field` is the dot-path to\n\t\t * a card's due date. A date before today gets an error edge and the\n\t\t * label \"Overdue\"; a date within `soonDays` (default 3) gets \"Due\n\t\t * soon\" in the warning colour. `null` (the default) marks nothing.\n\t\t *\n\t\t * The same rule shape the table's date cell uses, so a list and its\n\t\t * board agree on what late means.\n\t\t *\n\t\t * @type {{field: string, soonDays?: number}|null}\n\t\t */\n\t\tdueRule: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The board look's card roles (manifest `config.board.card`):\n\t\t * `{ title, sub, pill, due, owner, pillColors? }`. `sub` is a field or\n\t\t * a list of fields joined by a middle dot; `pillColors` maps a pill\n\t\t * value to a badge variant. Missing, the first of `cardFields` is the\n\t\t * title and the rest form the sub line. The Nextcloud look ignores it.\n\t\t *\n\t\t * @type {{title?: string, sub?: string|Array<string>, pill?: string, due?: string, owner?: string, pillColors?: object}|null}\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-the-board-card-anatomy\n\t\t */\n\t\tcardRoles: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The field on a column's state that holds its dot colour (manifest\n\t\t * `config.board.colorField`). Empty, the lifecycle state's declared\n\t\t * `color` is used, else the secondary text colour.\n\t\t *\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-the-board-column-header\n\t\t */\n\t\tcolorField: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * A numeric field whose sum each column shows under its heading\n\t\t * (manifest `config.board.sumField`). Empty shows no sum line.\n\t\t *\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-the-board-column-header\n\t\t */\n\t\tsumField: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * How the sum is formatted, the metric format shape:\n\t\t * `{ style: 'currency', currency: 'EUR', decimals: 2 }`.\n\t\t *\n\t\t * @type {{style?: string, currency?: string, decimals?: number}|null}\n\t\t */\n\t\tsumFormat: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * How many cards a column draws before a \"Show N more\" button\n\t\t * (manifest `config.board.columnLimit`). 0 (the default) draws every\n\t\t * card.\n\t\t *\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-a-long-column-is-cut-with-a-show-more-button\n\t\t */\n\t\tcolumnLimit: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\t},\n\n\temits: ['card-click', 'card-aux-click', 'moved', 'refused', 'stale', 'load-more'],\n\n\tdata() {\n\t\treturn {\n\t\t\t/** Lanes the reader has collapsed, for as long as they are here. */\n\t\t\tcollapsed: [],\n\t\t\t/** The guard's own words, when it refused the last move. */\n\t\t\trefusal: '',\n\t\t\t/** The card being dragged, and where from. */\n\t\t\tdragging: null,\n\t\t\t/** The day late marking measures from. */\n\t\t\ttoday: new Date(),\n\t\t\t/** Columns the reader has expanded past `columnLimit` (lane::column). */\n\t\t\texpanded: [],\n\t\t\t/** The card whose menu is open (board look), by card key. */\n\t\t\topenMenuKey: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {boolean} Whether the status field can back a board at all. */\n\t\tusable() {\n\t\t\treturn this.board.usable\n\t\t},\n\n\t\t/** @return {object} The columns, from the schema. */\n\t\tboard() {\n\t\t\treturn buildBoardColumns({\n\t\t\t\tfield: this.statusFieldSchema,\n\t\t\t\trows: this.rows,\n\t\t\t\tstatusField: this.statusField,\n\t\t\t\toffBoardLabel: t('nextcloud-vue', 'Elsewhere'),\n\t\t\t\tcolorField: this.colorField,\n\t\t\t})\n\t\t},\n\n\t\t/** @return {boolean} Whether the app takes the board look. */\n\t\tisBoardLook() {\n\t\t\treturn normalizeLook(this.cnLook) === 'board'\n\t\t},\n\n\t\t/**\n\t\t * The card's roles: `cardRoles`, else the first of `cardFields` as the\n\t\t * title and the rest as the sub line.\n\t\t *\n\t\t * @return {{title: string, sub: Array<string>, pill: string, due: string, owner: string, pillColors: object}} The roles.\n\t\t */\n\t\troles() {\n\t\t\tconst given = this.cardRoles && typeof this.cardRoles === 'object' ? this.cardRoles : null\n\t\t\tconst fields = Array.isArray(this.cardFields) ? this.cardFields : []\n\t\t\tconst sub = given && given.sub !== undefined\n\t\t\t\t? (Array.isArray(given.sub) ? given.sub : [given.sub])\n\t\t\t\t: (given ? [] : fields.slice(1))\n\t\t\treturn {\n\t\t\t\ttitle: (given && given.title) || fields[0] || '',\n\t\t\t\tsub: sub.filter(Boolean),\n\t\t\t\tpill: (given && given.pill) || '',\n\t\t\t\tdue: (given && given.due) || '',\n\t\t\t\towner: (given && given.owner) || '',\n\t\t\t\tpillColors: (given && given.pillColors) || {},\n\t\t\t}\n\t\t},\n\n\t\t/** @return {string} The Open in new tab menu item. */\n\t\topenInNewTabLabel() {\n\t\t\treturn t('nextcloud-vue', 'Open in new tab')\n\t\t},\n\n\t\t/** @return {Array<object>} The board as rows of columns. */\n\t\tlanes() {\n\t\t\treturn buildSwimlanes({\n\t\t\t\tcolumns: this.board.columns,\n\t\t\t\tswimlaneField: this.swimlaneField,\n\t\t\t\tunassignedLabel: t('nextcloud-vue', 'Unassigned'),\n\t\t\t})\n\t\t},\n\n\t\t/** @return {boolean} Whether a move is possible at all. */\n\t\tcanMove() {\n\t\t\treturn typeof this.runTransition === 'function'\n\t\t},\n\n\t\t/** @return {string} What to say when the field cannot back a board. */\n\t\tunusableText() {\n\t\t\treturn t('nextcloud-vue', 'This list has no status field with stages, so it cannot be shown as a board.')\n\t\t},\n\n\t\t/** @return {string} The board's accessible name. */\n\t\tboardLabel() {\n\t\t\treturn t('nextcloud-vue', 'Board')\n\t\t},\n\n\t\t/** @return {string} The Move to control's label. */\n\t\tmoveLabel() {\n\t\t\treturn t('nextcloud-vue', 'Move to')\n\t\t},\n\n\t\t/**\n\t\t * The visible text on a card's opening control.\n\t\t *\n\t\t * Short, because it repeats on every card. Which card it opens is\n\t\t * said by the control's `aria-label`, so a reader hearing a list of\n\t\t * buttons hears the card's own name rather than \"Open\" nine times.\n\t\t *\n\t\t * @return {string} The label.\n\t\t */\n\t\topenLabel() {\n\t\t\treturn t('nextcloud-vue', 'Open')\n\t\t},\n\n\t\t/** @return {string} What an empty column says. */\n\t\temptyColumnText() {\n\t\t\treturn t('nextcloud-vue', 'Nothing here')\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\tpreventMiddleClickAutoscroll,\n\n\t\t/**\n\t\t * A card's due state under `dueRule`.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {'overdue'|'soon'|'ok'|null} The state, or null when no rule applies.\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-late-marking-on-board-cards\n\t\t */\n\t\tdueState(card) {\n\t\t\treturn dueStateForRow(card, this.dueRule, this.today)\n\t\t},\n\n\t\t/**\n\t\t * The due state of a card: in the board look from the card's `due`\n\t\t * role (under `dueRule` when given), else from `dueRule` as before.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {'overdue'|'soon'|'ok'|null} The state.\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-the-board-card-anatomy\n\t\t */\n\t\tcardDueState(card) {\n\t\t\tif (this.isBoardLook && this.roles.due !== '') {\n\t\t\t\tconst rule = { ...(this.dueRule || {}), field: this.roles.due }\n\t\t\t\treturn dueStateForRow(card, rule, this.today)\n\t\t\t}\n\t\t\treturn this.dueState(card)\n\t\t},\n\n\t\t/**\n\t\t * The text of one role on a card: a field's value, or a list of\n\t\t * fields joined by a middle dot. An empty value drops out together\n\t\t * with its separator.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @param {string|Array<string>} role The field or fields.\n\t\t * @return {string} The text, '' when every value is empty.\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-the-board-card-anatomy\n\t\t */\n\t\troleText(card, role) {\n\t\t\tconst fields = Array.isArray(role) ? role : [role]\n\t\t\treturn fields\n\t\t\t\t.filter((field) => typeof field === 'string' && field !== '')\n\t\t\t\t.map((field) => this.textOf(readPath(card, field)))\n\t\t\t\t.filter((value) => value !== '')\n\t\t\t\t.join(' \\u00b7 ')\n\t\t},\n\n\t\t/**\n\t\t * A value as text: a string or number as is, an object by its label.\n\t\t *\n\t\t * @param {unknown} value The raw value.\n\t\t * @return {string} The text.\n\t\t */\n\t\ttextOf(value) {\n\t\t\tif (value === null || value === undefined) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (typeof value === 'object') {\n\t\t\t\tconst named = value.displayName ?? value.name ?? value.label ?? value.title ?? ''\n\t\t\t\treturn String(named).trim()\n\t\t\t}\n\t\t\treturn String(value).trim()\n\t\t},\n\n\t\t/**\n\t\t * The pill's badge variant, from `cardRoles.pillColors`.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {string} A CnStatusBadge variant.\n\t\t */\n\t\tpillVariant(card) {\n\t\t\tconst raw = this.textOf(readPath(card, this.roles.pill))\n\t\t\tconst variant = this.roles.pillColors[raw] ?? this.roles.pillColors[raw.toLowerCase()]\n\t\t\treturn isBadgeVariant(variant) ? variant : 'default'\n\t\t},\n\n\t\t/**\n\t\t * The footer's due text: \"Due today\", \"Due 2 Nov\", or \"Overdue 2 Nov\"\n\t\t * for a date in the past. Words, so the late tone is not colour alone.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {string} The text, '' without a readable date.\n\t\t */\n\t\tdueText(card) {\n\t\t\tif (this.roles.due === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst value = readPath(card, this.roles.due)\n\t\t\tconst days = daysUntil(value, this.today)\n\t\t\tif (days === null) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (days === 0) {\n\t\t\t\treturn t('nextcloud-vue', 'Due today')\n\t\t\t}\n\t\t\tconst date = new Date(value)\n\t\t\tconst shown = Number.isNaN(date.getTime())\n\t\t\t\t? String(value)\n\t\t\t\t: date.toLocaleDateString(undefined, { day: 'numeric', month: 'short' })\n\t\t\treturn days < 0\n\t\t\t\t? t('nextcloud-vue', 'Overdue {date}', { date: shown })\n\t\t\t\t: t('nextcloud-vue', 'Due {date}', { date: shown })\n\t\t},\n\n\t\t/**\n\t\t * The owner's name.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {string} The name, '' when there is none.\n\t\t */\n\t\townerName(card) {\n\t\t\treturn this.roles.owner === '' ? '' : this.textOf(readPath(card, this.roles.owner))\n\t\t},\n\n\t\t/**\n\t\t * The owner's initials: the first letters of the first two words.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {string} Up to two capital letters.\n\t\t */\n\t\townerInitials(card) {\n\t\t\treturn this.ownerName(card)\n\t\t\t\t.split(/\\s+/)\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.slice(0, 2)\n\t\t\t\t.map((word) => word.charAt(0).toUpperCase())\n\t\t\t\t.join('')\n\t\t},\n\n\t\t/**\n\t\t * The colour of a column's dot.\n\t\t *\n\t\t * @param {object} column The column.\n\t\t * @return {string} A CSS colour or variable.\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-the-board-column-header\n\t\t */\n\t\tdotColor(column) {\n\t\t\treturn resolveStageColor(column.color)\n\t\t},\n\n\t\t/**\n\t\t * The sum of `sumField` over a column's cards, formatted.\n\t\t *\n\t\t * @param {object} column The column.\n\t\t * @return {string} The sum, '' when no `sumField` is set.\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-the-board-column-header\n\t\t */\n\t\tcolumnSum(column) {\n\t\t\tif (!this.sumField) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst total = column.cards.reduce((sum, card) => {\n\t\t\t\tconst n = Number(readPath(card, this.sumField))\n\t\t\t\treturn Number.isFinite(n) ? sum + n : sum\n\t\t\t}, 0)\n\t\t\treturn formatMetricValue(total, this.sumFormat || { style: 'decimal', decimals: 0 }, {})\n\t\t},\n\n\t\t/**\n\t\t * The cards a column draws: all of them, or the first `columnLimit`\n\t\t * until the reader shows the rest.\n\t\t *\n\t\t * @param {object} lane The lane.\n\t\t * @param {object} column The column.\n\t\t * @return {Array<object>} The cards.\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-a-long-column-is-cut-with-a-show-more-button\n\t\t */\n\t\tvisibleCards(lane, column) {\n\t\t\tconst limit = Number(this.columnLimit)\n\t\t\tif (!(limit > 0) || this.expanded.includes(this.expandKey(lane, column))) {\n\t\t\t\treturn column.cards\n\t\t\t}\n\t\t\treturn column.cards.slice(0, limit)\n\t\t},\n\n\t\t/**\n\t\t * How many cards of a column are cut.\n\t\t *\n\t\t * @param {object} lane The lane.\n\t\t * @param {object} column The column.\n\t\t * @return {number} The hidden count.\n\t\t */\n\t\thiddenCount(lane, column) {\n\t\t\treturn column.cards.length - this.visibleCards(lane, column).length\n\t\t},\n\n\t\t/**\n\t\t * @param {object} lane The lane.\n\t\t * @param {object} column The column.\n\t\t * @return {string} The key `expanded` holds.\n\t\t */\n\t\texpandKey(lane, column) {\n\t\t\treturn `${lane.key}::${column.key}`\n\t\t},\n\n\t\t/**\n\t\t * The show-more button's text.\n\t\t *\n\t\t * @param {number} count The hidden count.\n\t\t * @return {string} \"Show N more\".\n\t\t */\n\t\tshowMoreLabel(count) {\n\t\t\treturn t('nextcloud-vue', 'Show {count} more', { count })\n\t\t},\n\n\t\t/**\n\t\t * Show the rest of one column. With `paged` the host is also asked\n\t\t * for the column's next page (`load-more`), and the column is\n\t\t * expanded so the rows that arrive show.\n\t\t *\n\t\t * @param {object} lane The lane.\n\t\t * @param {object} column The column.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-a-long-column-is-cut-with-a-show-more-button\n\t\t */\n\t\tshowMore(lane, column) {\n\t\t\tif (this.paged) {\n\t\t\t\t/**\n\t\t\t\t * @event load-more Emitted when the reader presses \"Show N more\" on a paged board. Payload: `{ columnKey }`; the host loads that column's next page.\n\t\t\t\t */\n\t\t\t\tthis.$emit('load-more', { columnKey: column.key })\n\t\t\t}\n\t\t\tthis.expanded = [...this.expanded, this.expandKey(lane, column)]\n\t\t},\n\n\t\t/**\n\t\t * The columns a card can move to: every other column of its lane.\n\t\t *\n\t\t * @param {object} lane The lane.\n\t\t * @param {object} column The card's own column.\n\t\t * @return {Array<object>} The targets.\n\t\t */\n\t\tmoveTargets(lane, column) {\n\t\t\treturn lane.columns.filter((target) => target.key !== column.key)\n\t\t},\n\n\t\t/**\n\t\t * @param {object} card The card.\n\t\t * @return {boolean} Whether its menu is open.\n\t\t */\n\t\tisMenuOpen(card) {\n\t\t\treturn this.openMenuKey === this.cardKey(card)\n\t\t},\n\n\t\t/**\n\t\t * @param {object} card The card.\n\t\t * @return {string} The menu button's accessible name.\n\t\t */\n\t\tmenuButtonLabel(card) {\n\t\t\tconst name = this.roleText(card, this.roles.title) || this.cardKey(card)\n\t\t\treturn t('nextcloud-vue', 'Actions for {name}', { name })\n\t\t},\n\n\t\t/**\n\t\t * Open or close a card's menu, and put focus on its first item.\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @return {void}\n\t\t */\n\t\ttoggleMenu(card) {\n\t\t\tconst key = this.cardKey(card)\n\t\t\tthis.openMenuKey = this.openMenuKey === key ? null : key\n\t\t\tif (this.openMenuKey !== null) {\n\t\t\t\tthis.focusMenuItem(card, 0)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close the open menu, optionally returning focus to its button.\n\t\t *\n\t\t * @param {object} [card] The card whose button gets focus back.\n\t\t * @return {void}\n\t\t */\n\t\tcloseMenu(card) {\n\t\t\tthis.openMenuKey = null\n\t\t\tif (card && this.$el && typeof this.$el.querySelector === 'function') {\n\t\t\t\tthis.$nextTick(() => {\n\t\t\t\t\tconst button = this.$el.querySelector(`[data-testid=\"cn-board-card-menu\"][data-card-id=\"${this.cardKey(card)}\"]`)\n\t\t\t\t\tbutton?.focus?.()\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Focus the menu item at an index (opened menus only).\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @param {number} index The item's position.\n\t\t * @return {void}\n\t\t */\n\t\tfocusMenuItem(card, index) {\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tconst items = this.menuItems(card)\n\t\t\t\tconst item = items[((index % items.length) + items.length) % items.length]\n\t\t\t\titem?.focus?.()\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * @param {object} card The card.\n\t\t * @return {Array<HTMLElement>} The open menu's items.\n\t\t */\n\t\tmenuItems(card) {\n\t\t\tconst article = this.$el?.querySelector?.(`[data-testid=\"cn-board-card\"][data-card-id=\"${this.cardKey(card)}\"]`)\n\t\t\treturn article ? Array.from(article.querySelectorAll('[role=\"menuitem\"]')) : []\n\t\t},\n\n\t\t/**\n\t\t * Keys inside the open menu: arrows move, Escape closes.\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @param {KeyboardEvent} event The key press.\n\t\t * @return {void}\n\t\t */\n\t\tonMenuKeydown(card, event) {\n\t\t\tconst items = this.menuItems(card)\n\t\t\tconst at = items.indexOf(document.activeElement)\n\t\t\tif (event.key === 'Escape') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tevent.stopPropagation()\n\t\t\t\tthis.closeMenu(card)\n\t\t\t} else if (event.key === 'ArrowDown') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.focusMenuItem(card, at + 1)\n\t\t\t} else if (event.key === 'ArrowUp') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.focusMenuItem(card, at - 1)\n\t\t\t} else if (event.key === 'Tab') {\n\t\t\t\tthis.closeMenu()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * M on a card, or a control inside it, opens its menu. Only in the\n\t\t * board look and only when the card can move.\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @param {object} column Its column.\n\t\t * @param {object} lane Its lane.\n\t\t * @param {KeyboardEvent} event The key press.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/screens-kanban-parity/specs/board-view/spec.md#requirement-the-card-shows-no-form-controls-at-rest\n\t\t */\n\t\tonCardKeydown(card, column, lane, event) {\n\t\t\tif (!this.isBoardLook || !this.canMove) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif ((event.key === 'm' || event.key === 'M') && !event.ctrlKey && !event.metaKey && !event.altKey) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tif (!this.isMenuOpen(card)) {\n\t\t\t\t\tthis.openMenuKey = this.cardKey(card)\n\t\t\t\t\tthis.focusMenuItem(card, 0)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Choose a column from the card's menu: the identical call a drop runs.\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @param {object} column Its column.\n\t\t * @param {object} target The column chosen.\n\t\t * @return {Promise<void>} Nothing.\n\t\t */\n\t\tasync onMenuMove(card, column, target) {\n\t\t\tthis.closeMenu(card)\n\t\t\tawait this.move(card, column.key, target.key)\n\t\t},\n\n\t\t/**\n\t\t * Open the card in a new tab: the same event a ctrl-click emits.\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @return {void}\n\t\t */\n\t\tonMenuOpenNewTab(card) {\n\t\t\tthis.closeMenu(card)\n\t\t\tthis.openCard(card, new MouseEvent('click', { ctrlKey: true, bubbles: true }))\n\t\t},\n\n\t\t/**\n\t\t * The words a late card carries. Colour alone would not reach a reader\n\t\t * who cannot see it, or cannot tell red from amber.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {string} \"Overdue\", \"Due soon\", or '' for a card that is fine.\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-late-marking-on-board-cards\n\t\t */\n\t\tdueLabel(card) {\n\t\t\tconst state = this.dueState(card)\n\t\t\tif (state === 'overdue') {\n\t\t\t\treturn t('nextcloud-vue', 'Overdue')\n\t\t\t}\n\t\t\treturn state === 'soon' ? t('nextcloud-vue', 'Due soon') : ''\n\t\t},\n\n\t\t/**\n\t\t * Open one card. The pointer and the keyboard both come through here,\n\t\t * so a reader on Enter reaches the same record as a reader on click.\n\t\t *\n\t\t * @param {object} card The card the reader picked.\n\t\t * @param {MouseEvent|KeyboardEvent} [event] The originating event.\n\t\t * @return {void} Nothing.\n\t\t */\n\t\topenCard(card, event) {\n\t\t\t/**\n\t\t\t * @event card-click Emitted when a reader opens a card, by click or Enter. Payload: `(card, event)` — the card row and the native event, so the host can open it in a new tab on a ctrl/cmd/shift click. A middle click emits `card-aux-click` instead.\n\t\t\t */\n\t\t\tthis.$emit('card-click', card, event)\n\t\t},\n\n\t\t/**\n\t\t * Middle click on a card's open button: emits `card-aux-click`, not\n\t\t * `card-click`, so an existing listener that navigates never moves the\n\t\t * current tab away.\n\t\t *\n\t\t * @param {object} card The card the reader picked.\n\t\t * @param {MouseEvent} event The auxclick event.\n\t\t * @return {void} Nothing.\n\t\t */\n\t\tonCardAuxClick(card, event) {\n\t\t\tif (isRowMiddleClick(event)) {\n\t\t\t\t/**\n\t\t\t\t * @event card-aux-click Emitted when a reader middle-clicks a card, for opening it in a new tab (see `openRowTarget`). Payload: `(card, event)` — the card row and the native auxclick event.\n\t\t\t\t */\n\t\t\t\tthis.$emit('card-aux-click', card, event)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A card's identity.\n\t\t *\n\t\t * @param {object} card The row.\n\t\t * @return {string} Its key.\n\t\t */\n\t\tcardKey(card) {\n\t\t\treturn String(card?.[this.rowKey] ?? '')\n\t\t},\n\n\t\t/**\n\t\t * A column's count, said as a page count when that is what it is.\n\t\t *\n\t\t * @param {object} column The column.\n\t\t * @return {string} The count.\n\t\t */\n\t\tcountLabel(column) {\n\t\t\treturn this.paged\n\t\t\t\t? t('nextcloud-vue', '{count} on this page', { count: column.count })\n\t\t\t\t: String(column.count)\n\t\t},\n\n\t\t/**\n\t\t * What a card is called to somebody who cannot see which column it is in.\n\t\t *\n\t\t * @param {object} card The row.\n\t\t * @param {object} column Its column.\n\t\t * @return {string} The accessible name.\n\t\t */\n\t\tcardLabel(card, column) {\n\t\t\tconst name = this.cardFields.map((field) => card?.[field]).filter(Boolean).join(', ')\n\t\t\treturn t('nextcloud-vue', '{name}, in {column}', { name: name || this.cardKey(card), column: column.label })\n\t\t},\n\n\t\t/**\n\t\t * Whether a lane is collapsed.\n\t\t *\n\t\t * @param {string} key The lane.\n\t\t * @return {boolean} True when collapsed.\n\t\t */\n\t\tisCollapsed(key) {\n\t\t\treturn this.collapsed.includes(key)\n\t\t},\n\n\t\t/**\n\t\t * Collapse a lane, or open it again.\n\t\t *\n\t\t * Held in the component for as long as the reader is on the view, and\n\t\t * deliberately not persisted: a collapsed lane somebody forgot they\n\t\t * collapsed is work that has gone missing for them.\n\t\t *\n\t\t * @param {string} key The lane.\n\t\t */\n\t\ttoggleLane(key) {\n\t\t\tthis.collapsed = this.isCollapsed(key)\n\t\t\t\t? this.collapsed.filter((entry) => entry !== key)\n\t\t\t\t: [...this.collapsed, key]\n\t\t},\n\n\t\t/**\n\t\t * Remember which card is being dragged and where from.\n\t\t *\n\t\t * @param {object} card The row.\n\t\t * @param {object} column Its column.\n\t\t * @param {DragEvent} event The event.\n\t\t */\n\t\tonDragStart(card, column, event) {\n\t\t\tthis.dragging = { card, fromKey: column.key }\n\t\t\t// Firefox drops a drag that carries no data.\n\t\t\tevent?.dataTransfer?.setData?.('text/plain', this.cardKey(card))\n\t\t},\n\n\t\t/**\n\t\t * A drop on a column.\n\t\t *\n\t\t * @param {object} column The column dropped on.\n\t\t * @return {Promise<void>} Nothing.\n\t\t */\n\t\tasync onDrop(column) {\n\t\t\tif (!this.dragging) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst { card, fromKey } = this.dragging\n\t\t\tthis.dragging = null\n\t\t\tawait this.move(card, fromKey, column.key)\n\t\t},\n\n\t\t/**\n\t\t * Move to, from the card's own menu.\n\t\t *\n\t\t * @param {object} card The row.\n\t\t * @param {object} column Its column.\n\t\t * @param {Event} event The change event.\n\t\t * @return {Promise<void>} Nothing.\n\t\t */\n\t\tasync onMoveTo(card, column, event) {\n\t\t\tawait this.move(card, column.key, event?.target?.value ?? '')\n\t\t},\n\n\t\t/**\n\t\t * The one move, whichever gesture asked for it.\n\t\t *\n\t\t * @param {object} card The row.\n\t\t * @param {string} fromKey Where it was.\n\t\t * @param {string} toKey Where it is going.\n\t\t * @return {Promise<void>} Nothing.\n\t\t */\n\t\tasync move(card, fromKey, toKey) {\n\t\t\tthis.refusal = ''\n\n\t\t\tconst result = await runBoardDrop({\n\t\t\t\tcard,\n\t\t\t\tfromKey,\n\t\t\t\ttoKey,\n\t\t\t\tstatusField: this.statusField,\n\t\t\t\trunTransition: this.runTransition,\n\t\t\t\treread: this.reread,\n\t\t\t})\n\n\t\t\tif (result.outcome === DROP_OUTCOMES.MOVED) {\n\t\t\t\t/**\n\t\t\t\t * @event moved Emitted when the host's transition accepted the move and the card now sits in the new lane. Payload: `{ card, toKey }`.\n\t\t\t\t */\n\t\t\t\tthis.$emit('moved', { card: result.card, toKey })\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (result.outcome === DROP_OUTCOMES.REFUSED) {\n\t\t\t\t// The guard's own sentence when it gave one. Our own only when\n\t\t\t\t// it did not, so the two are never confused.\n\t\t\t\tthis.refusal = result.message || t('nextcloud-vue', 'That move was refused.')\n\t\t\t\t/**\n\t\t\t\t * @event refused Emitted when the guard turned the move down. Payload: `{ card, message }`, the message being the guard's own sentence when it gave one.\n\t\t\t\t */\n\t\t\t\tthis.$emit('refused', { card: result.card, message: this.refusal })\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (result.outcome === DROP_OUTCOMES.STALE) {\n\t\t\t\tthis.refusal = t('nextcloud-vue', 'Somebody else moved this card. It is shown where it is now.')\n\t\t\t\t/**\n\t\t\t\t * @event stale Emitted when somebody else moved the card first, so the board shows it where it is now. Payload: `{ card }`.\n\t\t\t\t */\n\t\t\t\tthis.$emit('stale', { card: result.card })\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.cn-board-view__columns {\n\tdisplay: flex;\n\tgap: 12px;\n\toverflow-x: auto;\n\talign-items: flex-start;\n}\n\n.cn-board-view__column {\n\tflex: 0 0 260px;\n\tbackground-color: var(--color-background-hover);\n\tborder-radius: var(--border-radius-large);\n\tpadding: 8px;\n}\n\n.cn-board-view__column-header {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\tgap: 8px;\n\tfont-size: 1rem;\n\tmargin: 0 0 8px;\n}\n\n.cn-board-view__count,\n.cn-board-view__empty,\n.cn-board-view__unusable {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-board-view__card {\n\tdisplay: block;\n\tbackground-color: var(--color-main-background);\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tpadding: 8px;\n\tmargin-bottom: 8px;\n}\n\n.cn-board-view__card-field {\n\tdisplay: block;\n}\n\n/* A late card: an edge in the error colour, drawn as an inset shadow so the\n card keeps its size and its rounded corners. The label below carries the\n meaning; the edge only helps a sighted reader find it. */\n.cn-board-view__card--overdue {\n\tborder-color: var(--color-error);\n\tbox-shadow: inset 3px 0 0 var(--color-error);\n}\n\n.cn-board-view__due {\n\tdisplay: block;\n\tfont-size: 0.85em;\n\tfont-weight: 700;\n}\n\n.cn-board-view__due--overdue {\n\tcolor: var(--color-error-text, var(--color-error));\n}\n\n.cn-board-view__due--soon {\n\tcolor: var(--color-warning-text, var(--color-main-text));\n\tfont-weight: 600;\n}\n\n/*\n * The card's opening control. The cursor and the focus ring live here now,\n * on the thing that actually does something, rather than on the box.\n */\n.cn-board-view__card-open {\n\tbackground: none;\n\tborder: none;\n\tpadding: 0;\n\tcursor: pointer;\n\tcolor: var(--color-primary-element);\n\tfont-size: 0.8rem;\n}\n\n.cn-board-view__card-open:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 2px;\n}\n\n.cn-board-view__lane-header {\n\tbackground: none;\n\tborder: none;\n\tfont-weight: bold;\n\tpadding: 8px 0;\n\tcursor: pointer;\n\tcolor: var(--color-main-text);\n}\n\n.cn-board-view__move-label {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.8rem;\n}\n\n.cn-board-view__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