Files
joel kalema 702a02bb28 Fix/documents actions column (#10323)
* fix(docs-ui): let the table row kebab open its actions menu

nbContextMenu's click trigger listens on document, so stopping the click on the button meant the menu never opened. The table's row-open handler already ignores clicks from buttons.

* docs(docs-ui): update the table double-click guard comment

* fix(docs-ui): let the card kebab open its actions menu

The card body now skips clicks, double clicks and Enter coming from its kebab instead of the kebab stopping propagation, which kept nbContextMenu from ever opening.

* fix(docs-ui): keep a tree node from activating on a kebab click

Override the tree's mouse click action so a click on the node menu button does not toggle the active node.

* fix(docs-ui): let the tree node kebab open its actions menu

Drop the stopPropagation that kept nbContextMenu (and the Shift+F10 path) from opening the node menu.

* feat(docs-ui): add column icons and column chooser strings

Per-column Eva icons and the DOCS.TABLE strings for the column count, the locked and auto-hidden hints, Show all and Reset to default.

* feat(docs-ui): add show-all, reset and visibility state to the column chooser

Visible-column count, whether any preference is stored, which columns the narrow-viewport defaults hid, and actions to show every column or drop the stored preferences.

* fix(docs-ui): open the column chooser and redesign it

nbTooltip and nbPopover on the same button shared one NbDynamicOverlay, so a click only ever showed the tooltip. The tooltip now sits on a wrapper.

The chooser becomes a list of switch rows with column icons, a locked Name row, an auto-hidden hint for narrow screens, a live count and Show all / Reset to default actions.

* feat(docs-ui): group the document actions menu and make it context-aware

Every item gets an icon and the menu is split into sections (open, create, organize, share, AI, destructive) with dividers only between non-empty ones. Delete is marked danger and the tree shows its F2 and Del shortcuts.

A FILE row offers Preview instead of a second, identical Open; Open on a folder or page says where it goes; Duplicate with children is dropped for a container the list reports as empty.

* feat(docs-ui): tag the table, card and tree action menus with a shared class

Pass DOCS_ACTION_MENU_CLASS through nbContextMenuClass so the three kebab menus can be styled as one.

* style(docs-ui): restyle the document actions menu

Compact rows with icons, rounded hover, section dividers, key-cap shortcut hints and a red Delete. Global on purpose: the menu renders in the CDK overlay, and the shell wraps every Documents route.

* feat(docs-ui): add the actions menu to folder cards

Folder cards had no kebab, so in card view a folder could only be drilled into. The kebab sits beside the folder card button in a wrapper, since a button may not contain another one.

* refactor(docs-ui): mark template-only members protected

Follows the Angular guideline for the column chooser members and the action menu class added in this branch.

* fix(docs-ui): keep tree key handling off the node menu button

The tree handles Enter and Space on body and calls preventDefault, which cancelled the menu button's own click. The button now stops their propagation without preventing the default. Also marks the tree's actionMenuClass protected.
2026-09-28 13:39:43 +02:00
..
2026-09-28 13:39:43 +02:00

@gauzy/plugin-docs-ui

Angular UI plugin providing the Documents hub for the Gauzy platform: a single tree of folders, authored wiki pages and uploaded files with processing status, AI-knowledge state, review workflow, filters, uploads and bulk actions.

Backed by the @gauzy/plugin-docs API plugin (/api/plugins/docs). The binding specifications live in the specs/documents suite (04-frontend-plugin.md is the engineering contract for this package).

Features (M1)

  • DocsUiPlugin: PluginUiDefinition — top-level Documents nav section (before focus), route /pages/documents at page-sections, DOCS translation namespace, gated on FEATURE_DOCUMENTS + DOCS_READ.
  • Shell layout: collapsible in-page tree column (@ali-hm/angular-tree-component, lazy children, drag & drop re-parent with client-side cycle check), content outlet and the ?id= detail side panel.
  • Browse page: server-paginated angular2-smart-table (custom cells for kind icon + name, status/knowledge/source badges, category/tag chips), preset chips with live facet counts, multi-select facets, date ranges, name-vs-content search toggle, full URL round-tripping (§6 contract).
  • Upload: page-wide dropzone + hidden multi file input, classification dialog (categories/tags/AI-classify/add-to-knowledge), per-file progress rows and a self-stopping 5 s processing poll.
  • Detail panel: metadata, AI summary, inline taxonomy editing, searchable and AI-knowledge toggles, review banner with approve/reject, extracted-text correction dialog, linked records, favorite star.
  • Review queue (/pages/documents/review, DOCS_REVIEW) and the DOCS_MANAGE bulk bar (≤ 200 ids, per-id error report).
  • page/:id — lazily loaded read-only PAGE viewer placeholder; the TipTap editor replaces it in the editor wave.

Registration

// apps/gauzy/src/plugin-ui.config.ts
import { DocsUiPlugin } from '@gauzy/plugin-docs-ui';

export const uiPluginConfig = {
	plugins: [DocsUiPlugin]
};

Routes contributed by other plugins at the 'documents-sections' page-route location render inside the Documents shell automatically.

Required global stylesheet — KaTeX

The editor renders mathematics with @tiptap/extension-mathematics, which draws KaTeX markup into the ProseMirror DOM at runtime. Because that markup is created by ProseMirror rather than by an Angular template it never carries a component's _ngcontent-* attribute, so KaTeX must be loaded as a global stylesheet — an inlined component style would be rewritten by view encapsulation and match nothing. The host app adds it to its build styles (all browser targets):

// apps/gauzy/project.json — targets.{build,desktop-ui,server-ui}.options.styles
"styles": [
	/* … */
	"node_modules/katex/dist/katex.min.css"
]

Referencing the package's own stylesheet keeps its url(fonts/…) declarations resolvable (they are relative to node_modules/katex/dist) so the bundler emits the KaTeX web fonts automatically — no assets entry and no vendored copy.

Building

yarn nx build plugin-docs-ui

Testing

yarn nx test plugin-docs-ui