Skip to content

Feat | Widgets Constructor - #7

Merged
TheGeniusOfEternity merged 9 commits into
mainfrom
feature/widgets-constructor
Aug 2, 2026
Merged

Feat | Widgets Constructor#7
TheGeniusOfEternity merged 9 commits into
mainfrom
feature/widgets-constructor

Conversation

@TheGeniusOfEternity

Copy link
Copy Markdown
Owner

No description provided.

@TheGeniusOfEternity TheGeniusOfEternity self-assigned this Aug 2, 2026
@TheGeniusOfEternity TheGeniusOfEternity added enhancement New feature or request improvement make something better, simplier & more effective labels Aug 2, 2026
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
widgecode Ignored Ignored Preview Aug 2, 2026 4:51pm

Copilot AI 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.

Pull request overview

Introduces the widget “constructor” feature end-to-end: server-side widget/block schemas + CRUD services/routes (including public rendering via stats aggregation), plus a new client-side gallery/editor/public widget page flow that consumes these APIs.

Changes:

  • Added widget/block registry + validation, widget CRUD + block CRUD services/controllers/routes, and a public widget render endpoint.
  • Added GitHub + LeetCode stats fetching with caching for block-level rendering and preview.
  • Added client gallery UX updates (create modal, open/configure/copy), a full widget editor page, and a public widget page for iframe embedding.

Reviewed changes

Copilot reviewed 53 out of 53 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
server/src/widgets/registry.ts Defines widget/block types, presets, and Zod schemas for validation/normalization.
server/src/widgets.test.ts Adds API-level tests for widget creation, blocks, preview, access control, and limits.
server/src/services/widgetService.ts Implements widget CRUD, slug generation, block CRUD, and layout validation logic.
server/src/services/statsService.ts Implements cached external data fetching and block rendering for previews/public widgets.
server/src/routes/widgets.ts Adds protected widget/block routes and a rate-limited public widgets route.
server/src/lib/prisma.ts Ensures env loading before Prisma client initialization.
server/src/lib/env.ts Centralizes dotenv loading with multiple candidate .env locations.
server/src/index.ts Switches to centralized env loader instead of dotenv/config.
server/src/controllers/widgetController.ts Adds request validation + handlers for widget/block CRUD, preview, and public fetch.
server/src/app.ts Wires widgets/blocks/public widgets routers into the Express app.
server/prisma/schema.prisma Adds Widget.slug as a unique field.
server/prisma/migrations/20260801120000_add_widget_slug/migration.sql Backfills slugs for existing widgets and enforces uniqueness/non-null.
server/prisma/migrations/20260801130000_remove_legacy_widget_blocks/migration.sql Data migration intended to remove legacy blocks and re-pack positions.
server/prisma/migrations/20260801140000_restore_two_column_widget_grid/migration.sql Restores two-column grid config in widget JSON where previously persisted as 1.
server/prisma.config.ts Adds Prisma config for schema/migrations paths and DATABASE_URL loading.
prompts/phase-4-render.md Documents public widget rendering + iframe embedding flow.
prompts/phase-3-builder.md Documents server/client builder architecture and routes.
prompts/phase-2-auth.md Documents authentication implementation details and flows.
prompts/phase-1-infra.md Documents project setup/infrastructure approach and scripts.
opencode.json Adds MCP config for Figma integration in local tooling.
client/src/widgets/sidebar/ui/Sidebar.tsx Updates recent widgets list to open existing widgets by id/title.
client/src/widgets/sidebar/ui/Sidebar.module.css Introduces a CSS variable for expanded sidebar width.
client/src/shared/locale/content.ts Adds localization strings for new gallery/editor/public widget features.
client/src/shared/api/widgets.ts Adds typed client API wrappers for widgets/blocks/public widgets.
client/src/shared/api/index.ts Re-exports widget API helpers from shared API index.
client/src/pages/widgets-gallery/ui/WidgetsGalleryPage.tsx Adds create modal, empty state, open/copy wiring, and updated widget card handling.
client/src/pages/widgets-gallery/ui/WidgetsGalleryPage.module.css Styles the gallery empty state.
client/src/pages/widgets-gallery/ui/WidgetsGalleryHeader.tsx Wires “Create widget” CTA to open the create modal.
client/src/pages/widgets-gallery/ui/CreateWidgetModal.tsx Implements modal for widget creation (source + preset selection).
client/src/pages/widgets-gallery/ui/CreateWidgetModal.module.css Styles the create widget modal UI.
client/src/pages/widget-editor/ui/WidgetEditorPage.tsx Adds a full widget editor with layout drag/resize, config panels, autosave, publish/copy.
client/src/pages/widget-editor/ui/WidgetEditorPage.module.css Styles the widget editor layout and interactions.
client/src/pages/widget-editor/index.ts Exports the widget editor page entrypoint.
client/src/pages/public-widget/ui/PublicWidgetPage.tsx Adds a public widget page that fetches and renders a widget by slug.
client/src/pages/public-widget/ui/PublicWidgetPage.module.css Styles public widget page layout/status.
client/src/pages/public-widget/index.ts Exports the public widget page entrypoint.
client/src/entities/widget/ui/WidgetCard.tsx Updates widget cards to use persisted widget data, published state, copy/configure actions.
client/src/entities/widget/ui/WidgetCard.module.css Updates widget card styling and responsive action visibility.
client/src/entities/widget/ui/WidgetCanvas.tsx Adds reusable widget canvas + block renderer with live/rendered data support.
client/src/entities/widget/ui/WidgetCanvas.module.css Adds styles for the widget canvas and block rendering states.
client/src/entities/widget/model/types.ts Adds shared widget/block/public payload TypeScript types.
client/src/entities/widget/model/registry.ts Adds client-side presets, block definitions, palette tokens, and default configs.
client/src/entities/widget/model/index.ts Exports widget model registry and types.
client/src/entities/widget/index.ts Re-exports widget UI + model for consumption across the app.
client/src/app/App.tsx Adds routing for editor/public pages and integrates real widget CRUD via API.
client/src/app/App.module.css Adds layout styling for editor/public routes and prevents horizontal overflow.
api/widgets/index.ts Vercel function entrypoint wiring to server Express bundle.
api/widgets/[id].ts Vercel function entrypoint for widget by id route wiring.
api/widgets/[widgetId]/blocks/index.ts Vercel function entrypoint wiring for blocks under a widget.
api/widgets/[widgetId]/blocks/reorder.ts Vercel function entrypoint wiring for layout reorder route.
api/blocks/[id].ts Vercel function entrypoint wiring for block by id routes.
api/public/widgets/[slug].ts Vercel function entrypoint wiring for public widget by slug route.
.env.example Updates example env vars (including GitHub token section) for new functionality.
Suppressed comments (1)

server/src/services/widgetService.ts:306

  • removeBlock deletes a block but does not re-pack remaining position values. With the current addBlock logic (and even with max+1), this leaves gaps/duplicates over time and makes ordering less predictable. After deletion, decrement positions greater than the removed block’s position to keep ordering stable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread server/src/services/widgetService.ts
Comment thread server/prisma/migrations/20260801130000_remove_legacy_widget_blocks/migration.sql Outdated
Comment thread server/src/services/statsService.ts
Comment thread server/src/widgets/registry.ts Outdated
Comment thread client/src/widgets/sidebar/ui/Sidebar.tsx
Comment thread client/src/pages/widget-editor/ui/WidgetEditorPage.tsx
@TheGeniusOfEternity
TheGeniusOfEternity merged commit 63f38e0 into main Aug 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request improvement make something better, simplier & more effective

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants