Skip to content

feat: Load optional UI plugin layers - #115

Merged
nfebe merged 4 commits into
devfrom
feat/optional-ui-plugin-layers
Oct 23, 2026
Merged

nfebe merged 4 commits into
devfrom
feat/optional-ui-plugin-layers

Conversation

@nfebe

@nfebe nfebe commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Load optional pages and translations from installed plugin layers. Hide integration links when their pages are absent.

@nfebe
nfebe force-pushed the feat/optional-ui-plugin-layers branch from eacbb7e to cb30023 Compare October 20, 2026 21:35
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Deploying trakli-dev with  Cloudflare Pages  Cloudflare Pages

Latest commit: 312126d
Status: ✅  Deploy successful!
Preview URL: https://f5aa4d1b.trakli-dev.pages.dev
Branch Preview URL: https://feat-optional-ui-plugin-laye.trakli-dev.pages.dev

View logs

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Deploying webui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 312126d
Status: ✅  Deploy successful!
Preview URL: https://d2a743aa.webui-9fh.pages.dev
Branch Preview URL: https://feat-optional-ui-plugin-laye.webui-9fh.pages.dev

View logs

@sourceant

sourceant Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Code Review Summary

Adds support for optional UI plugin layers via the TRAKLI_UI_LAYERS environment variable, wired into nuxt.config.ts and vitest.config.ts so layer pages, translations, tests, and aliases load alongside the host app. Extension slot contributions now skip links pointing at local routes that do not exist, and a new check:plugins script lints and format-checks configured layers. Documentation is added in PLUGINS.md.

🚀 Key Improvements

  • TRAKLI_UI_LAYERS lets installed Nuxt layers extend routes, translations, and components without changing host code.
  • useExtensionSlots hides sidebar and settings links whose local route is not installed, with test coverage.
  • npm run check:plugins lints and format-checks configured plugin layers using the host's ESLint and Prettier config.

💡 Minor Suggestions

  • Review coverage is incomplete. Inspect the execution details before approving.

@sourceant sourceant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. See the overview comment for a summary.

continue;
}

const href = ui.onboarding?.href || ui.card?.href;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|| takes the first present href, so a contribution is gated on onboarding.href even when the card's own card.href route exists (and vice versa). A working link then disappears from a slot. Check every local href and skip only when none resolve.

Suggested change
const href = ui.onboarding?.href || ui.card?.href;
const localHrefs = [ui.onboarding?.href, ui.card?.href].filter(
(href): href is string => typeof href === 'string' && href.startsWith('/')
);
if (localHrefs.length && localHrefs.every((href) => !router.resolve(href).matched.length)) {
continue;
}

@nfebe
nfebe force-pushed the feat/optional-ui-plugin-layers branch from cb30023 to 312126d Compare October 23, 2026 11:05

@sourceant sourceant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. See the overview comment for a summary.

@nfebe
nfebe merged commit a04e73a into dev Oct 23, 2026
6 checks passed
@nfebe
nfebe deleted the feat/optional-ui-plugin-layers branch October 23, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant