Skip to content

refactor(ui): rename Widget Lab → Widget Library (#914) - #958

Merged
alfredo1996 merged 2 commits into
devfrom
refactor/issue-914-widget-library-rename
Jun 6, 2026
Merged

refactor(ui): rename Widget Lab → Widget Library (#914)#958
alfredo1996 merged 2 commits into
devfrom
refactor/issue-914-widget-library-rename

Conversation

@alfredo1996

@alfredo1996 alfredo1996 commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Closes #914.

Summary

"Lab" implied a prototyping playground; the actual feature is a curated collection of reusable widget templates. "Library" is the conventional name in the design-tool space (Figma component library, Storybook) and matches user expectation.

What changes

  • Route `/widget-lab` → `/widget-library` (directory `git mv` preserves history)
  • Sidebar label + page heading + `FlaskConical` → `Library` icon (lucide-react)
  • `WidgetLabPage()` → `WidgetLibraryPage()`
  • Production UI text: "Save to Widget Lab" → "Save to Widget Library" (in dashboard-container and save-template-dialog)
  • Comments / docstrings across `dashboard-container`, `widget-editor-modal`, `schema.ts`, `capture-preview.test.ts`
  • E2E spec: `widget-lab.spec.ts` → `widget-library.spec.ts` (~50 refs updated)
  • Component test: testid auto-updates (synthesized from label)
  • Sidebar test: `sidebar-item-Widget Lab` → `...Library`
  • Docs: `APP_IMPLEMENTATION_GUIDE.md` (3 lines), `widgets.mdx` (5 refs + screenshot), `migration-from-neodash.mdx` (1 row)
  • Screenshot: `widget-lab.png` → `widget-library.png`

Backwards-compatibility

Adds a permanent (308) redirect in `next.config.ts` from `/widget-lab` → `/widget-library` so bookmarked URLs survive and SEO carries. E2E covers both the new path and the legacy redirect (new test `legacy /widget-lab URL redirects to /widget-library`).

Intentionally untouched

These were already correctly named:

  • DB column / table (`widget_template`)
  • API routes (`/api/widget-templates`)
  • Storage keys

Test plan

  • `npm -w app run test` — 2889/2889 pass
  • `npm run lint` — no new errors (5 pre-existing issues unchanged)
  • `npm run build` — passes
  • `cd app && npx playwright test widget-library` — 18 passed, 1 flaky-on-retry (unrelated timing on `filter by connector type`)
  • CI: E2E shards — deferred to CI
  • Manual: visit `/widget-lab`, confirm browser lands on `/widget-library` with the new heading

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a permanent redirect from /widget-lab to /widget-library to preserve existing bookmarks and links.
  • Refactor

    • Renamed "Widget Lab" to "Widget Library" across UI labels, sidebar, page headers, and action menus.
  • Tests

    • Updated end-to-end and unit tests to use the Widget Library routes, labels, and visibility expectations.
  • Documentation

    • Updated docs and migration guides to reflect Widget Library terminology and routes.

"Lab" implied a prototyping playground; the actual feature is a curated
collection of reusable widget templates. "Library" is the conventional
name in the design-tool space (Figma component library, Storybook) and
matches user expectation.

Renames in this PR:
- Route /widget-lab → /widget-library (directory git-mv preserves history)
- Sidebar label, page heading, FlaskConical → Library icon
- WidgetLabPage() → WidgetLibraryPage()
- Production UI text: "Save to Widget Lab" → "Save to Widget Library"
- Comments / docstrings across dashboard-container, widget-editor-modal,
  schema.ts, capture-preview.test.ts
- E2E spec: widget-lab.spec.ts → widget-library.spec.ts (~50 refs)
- Component test: testid auto-updates (synthesized from label)
- Sidebar test: "sidebar-item-Widget Lab" → "...Library"
- Docs: APP_IMPLEMENTATION_GUIDE.md, widgets.mdx (5 refs + screenshot),
  migration-from-neodash.mdx
- Screenshot file: widget-lab.png → widget-library.png

Adds a permanent (308) redirect /widget-lab → /widget-library in
next.config.ts so bookmarked URLs survive and SEO carries. E2E covers
both the new path and the legacy redirect.

Untouched (already correctly named):
- DB column / table (widget_template)
- API routes (/api/widget-templates)
- Storage keys

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

PR changed again? Review this PR in Change Stack to compare snapshots and stay oriented.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e5004f0d-0e74-42ca-a04f-d6922d6dee30

📥 Commits

Reviewing files that changed from the base of the PR and between 44cc0bc and 25f4989.

📒 Files selected for processing (1)
  • app/src/lib/api/__tests__/openapi-spec.test.ts

Walkthrough

Renames "Widget Lab" to "Widget Library" across routes, UI labels, sidebar navigation, save dialogs, E2E tests, internal comments, and docs; adds a permanent redirect from /widget-lab to /widget-library.

Changes

Widget Lab → Widget Library Rename

Layer / File(s) Summary
Route Configuration and Redirect
app/next.config.ts
Next.js config defines a permanent 308 redirect from /widget-lab to /widget-library.
Dashboard Navigation and Sidebar
app/src/app/(dashboard)/layout.tsx, app/src/app/(dashboard)/__tests__/layout.test.tsx
Sidebar icon changes to Library, label becomes "Widget Library", active path and click navigation updated; layout test assertion adjusted.
Widget Library Page Component
app/src/app/(dashboard)/widget-library/page.tsx
Default export renamed to WidgetLibraryPage and PageHeader title updated to "Widget Library".
Save Action and Template Dialog
app/src/components/dashboard-container.tsx, app/src/components/save-template-dialog.tsx, app/src/components/__tests__/dashboard-container-branches.test.tsx
Save-as-template action label and JSDoc updated to "Save to Widget Library"; SaveTemplateDialog title and dashboard-container branch test updated to match.
End-to-End Test Suite
app/e2e/widget-library.spec.ts
E2E spec refocused to /widget-library: suite titles, navigation checks, redirect test, all template save/delete/edit/consumption flows, and view-mode visibility assertions updated to new labels/paths.
Internal Documentation and Comments
app/src/components/widget-editor-modal.tsx, app/src/lib/db/schema.ts, app/src/lib/__tests__/dashboard/capture-preview.test.ts
JSDoc and inline comments updated to reference "Widget Library"; test comment updated to reference widget-library.spec.ts.
Product Documentation
docs/APP_IMPLEMENTATION_GUIDE.md, docs/src/content/docs/concepts/widgets.mdx, docs/src/content/docs/getting-started/migration-from-neodash.mdx
Implementation guide and docs updated to use widget-library/ paths and "Widget Library" wording.
OpenAPI Spec Test Typing
app/src/lib/api/__tests__/openapi-spec.test.ts
Introduces OARoute type narrowing SPEC.paths and updates helper typing and casts used in pagination tests.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • alfredo1996/neoboard#523: Related changes to widget template consumption E2E coverage (duplicate/filter/search) now pointing to /widget-library.
  • alfredo1996/neoboard#475: Earlier work on the "save widget as template" view-mode flow that this PR renames to "Widget Library".
  • alfredo1996/neoboard#91: Prior PR that introduced the original "Widget Lab" UI/route that this change renames and redirects.

Suggested labels

pkg:app, area:widgets, area:dashboard, documentation, testing, enhancement

🚥 Pre-merge checks | ✅ 3 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning One unrelated change detected: the OpenAPI pagination test in openapi-spec.test.ts was modified to introduce stricter route typing with OARoute interface and adjusted test assertions, which is outside the #914 Widget Library rename scope. Remove OpenAPI spec test changes from this PR and address the OARoute typing in a separate issue, or clarify why these changes were necessary for the rename.
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No pull request description was provided for evaluation. A description is needed to document the change rationale and any implementation notes beyond the title. Add a PR description explaining the migration strategy and confirming all acceptance criteria from #914 have been met.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor(ui): rename Widget Lab → Widget Library (#914)' accurately and concisely describes the main change: renaming the UI feature from Widget Lab to Widget Library across the codebase.
Linked Issues check ✅ Passed The PR fully implements all coding requirements from #914: routes migrated to /widget-library with 308 redirect [#914], UI strings updated (sidebar, heading, buttons), component renamed, E2E tests refactored, internal comments updated, and docs synchronized. DB table/API routes intentionally preserved.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/issue-914-widget-library-rename

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

The SPEC object is declared `as const`, which makes its nested
`parameters` arrays readonly tuples. After #945 merged the new tuple
literal at /api/connections etc, the test's `OAParam[]` (mutable) cast
no longer overlaps with the readonly source — tsc rejected it.

Accept `readonly OAParam[]` and cast via `unknown` so the runtime
behaviour is unchanged and the test stays a pure structural assertion.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Jun 6, 2026

Copy link
Copy Markdown

@alfredo1996
alfredo1996 merged commit aa4583c into dev Jun 6, 2026
14 checks passed
@alfredo1996
alfredo1996 deleted the refactor/issue-914-widget-library-rename branch July 3, 2026 12:42
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.

[P2] Rename 'Widget Lab' → 'Widget Library' across UI, routes, docs, tests

2 participants