Skip to content

refactor(portal-plugin-dashboard, portal-framework-ui): revamp account profile and widget layout#446

Merged
pcfreak30 merged 1 commit intodevelopfrom
libs/portal-plugin-dashboard
Aug 6, 2025
Merged

refactor(portal-plugin-dashboard, portal-framework-ui): revamp account profile and widget layout#446
pcfreak30 merged 1 commit intodevelopfrom
libs/portal-plugin-dashboard

Conversation

@pcfreak30
Copy link
Copy Markdown
Member

@pcfreak30 pcfreak30 commented Aug 6, 2025

  • Replaced Account component with new profile and bio widgets
  • Updated widget area implementation to use bin-pack library instead of binpackingjs
  • Added email update form with dialog integration
  • Improved form handling with auto-save functionality
  • Restructured account routes and components
  • Updated dependencies including @refinedev/core to 4.57.10
  • Enhanced UI styling and layout organization

Summary by CodeRabbit

  • New Features

    • Introduced account profile and bio widgets, and a profile management page with editable forms and autosave for user settings.
    • Added support for bearer token authorization and custom headers in REST data provider.
    • Enhanced form system with autosave, flexible field registration, and unified form adapter support.
    • Added a dedicated dialog and form configuration for updating user email.
    • Added new dashboard routes and widget registrations for account management.
  • Improvements

    • Refactored widget layout engine for profile area, simplifying grid logic and improving layout reliability.
    • Updated UI components and imports for consistency and maintainability.
    • Streamlined dialog rendering and form context handling.
    • Improved form autosave integration and UI feedback.
    • Enhanced validation schema for email update form.
  • Bug Fixes

    • Ensured user identity includes account creation date for richer profile displays.
  • Chores

    • Updated multiple dependencies and patched libraries for compatibility and stability.
    • Cleaned up and optimized Tailwind CSS assets and configuration.
  • Removals

    • Removed legacy account settings components and redundant or unused code.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Aug 6, 2025

⚠️ No Changeset found

Latest commit: eb63041

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 6, 2025

Walkthrough

This update introduces new account profile and widget features to the dashboard plugin, refactors form and dialog infrastructure for autosave and flexible field registration, and replaces the bin-packing algorithm in the core UI. Several files are reorganized, dependencies are updated, and legacy account management components are replaced with modular widgets and dialogs.

Changes

Cohort / File(s) Change Summary
Dependency Updates
package.json, libs/advanced-rest/package.json, libs/portal-framework-auth/package.json, libs/portal-framework-core/package.json, libs/portal-framework-ui/package.json, libs/portal-plugin-abuse/package.json, libs/portal-plugin-admin/package.json, libs/portal-plugin-dashboard/package.json
Updated various dependencies: @refinedev/core to 4.57.10, added qs-esm, error-stack-parser-es, bin-pack, react-is, and date-fns; removed binpackingjs and some dev dependencies; added/updated patches and overrides.
Patches & Module Wrappers
patches/@refinedev__devtools-internal.patch, patches/papaparse.patch, patches/pluralize.patch, patches/warn-once.patch
Updated or added patches for dependency compatibility and module system support, including ESM/CJS/UMD wrappers and import changes.
Tailwind CSS & Asset Cleanup
shared/assets/tailwind-plugin.css, shared/assets/tailwind.css, libs/portal-framework-ui-core/src/tailwind-plugin.css
Refined Tailwind CSS imports and removed redundant or duplicated CSS, ensuring only essential base and utility styles remain.
Widget Packing Refactor
libs/portal-framework-core/src/components/WidgetArea.tsx
Replaced custom bin-packing logic with bin-pack library, simplified widget validation, and removed unused props.
Form Infrastructure Overhaul
libs/portal-framework-ui/src/components/form/SchemaForm.tsx, libs/portal-framework-ui/src/components/form/adapters.tsx, libs/portal-framework-ui/src/components/form/context.tsx, libs/portal-framework-ui/src/components/form/types.ts, libs/portal-framework-ui/src/components/form/fields/registry.ts, libs/portal-framework-ui/src/components/form/FormRenderer.tsx, libs/portal-framework-ui/src/components/form/fields/Input.tsx
Added autosave support, unified form instance types, extended form config and field types, improved context, and removed unnecessary wrappers. Registry now allows string keys.
Dialog & App Structure
libs/portal-framework-ui/src/components/app/AppComponent.tsx, libs/portal-framework-ui/src/components/dialog/Dialog.renderer.tsx, libs/portal-framework-ui/src/components/actions/ActionListRenderer.tsx
Centralized dialog rendering at the app level, streamlined dialog renderer logic, disabled some animations, and improved layout spacing.
Portal Framework Core Exports & Types
libs/portal-framework-core/src/index.ts, libs/portal-framework-core/src/types/portal.ts
Added WidgetRegistration export and extended Identity type with created_at property.
Advanced REST Data Provider
libs/advanced-rest/src/provider.ts
Added setAuthToken method, bearer token support, and flexible per-request headers.
Portal Framework Auth Enhancements
libs/portal-framework-auth/src/capabilities/sdk.ts, libs/portal-framework-auth/src/dataProviders/auth.ts
Simplified subdomain logic, included created_at in identity, and updated header logic.
Dashboard Plugin - Widgetization & Account Refactor
libs/portal-plugin-dashboard/plugin.config.ts, libs/portal-plugin-dashboard/src/index.ts, libs/portal-plugin-dashboard/src/widgetRegistrations.ts, libs/portal-plugin-dashboard/src/routes.ts, libs/portal-plugin-dashboard/src/capabilities/refineConfig.ts, libs/portal-plugin-dashboard/src/ui/routes/account.profile.tsx, libs/portal-plugin-dashboard/src/ui/widgets/account/profile.tsx, libs/portal-plugin-dashboard/src/ui/widgets/account/bio.tsx, libs/portal-plugin-dashboard/src/ui/forms/editProfile.tsx, libs/portal-plugin-dashboard/src/ui/forms/fields/AccountEmail.tsx, libs/portal-plugin-dashboard/src/ui/forms/updateEmail.tsx, libs/portal-plugin-dashboard/src/ui/dialogs/updateEmail.tsx
Added new widgets and routes for account profile/bio, modularized forms (edit profile, update email), dialog configs, widget registrations, and new capability for refine config.
Dashboard Plugin - UI Import Reorganization
libs/portal-plugin-dashboard/src/ui/components/EmailVerificationBanner.tsx, libs/portal-plugin-dashboard/src/ui/components/ManagementCard.tsx, libs/portal-plugin-dashboard/src/ui/components/NavigationButton.tsx, libs/portal-plugin-dashboard/src/ui/components/account/ChangePasswordForm.tsx, libs/portal-plugin-dashboard/src/ui/components/account/DeleteAccountDialog.tsx, libs/portal-plugin-dashboard/src/ui/components/account/DisableTwoFactorDialog.tsx, libs/portal-plugin-dashboard/src/ui/components/account/SetupTwoFactorDialog.tsx, libs/portal-plugin-dashboard/src/ui/components/uploads/Manager.tsx, libs/portal-plugin-dashboard/src/ui/routes/AccountVerify.tsx, libs/portal-plugin-dashboard/src/ui/routes/ApiKeys.tsx
Switched imports from UI to UI-core packages for shared components and icons; no functional changes.
Dashboard Plugin - Legacy Account Removal
libs/portal-plugin-dashboard/src/ui/routes/Account.tsx, libs/portal-plugin-dashboard/src/ui/components/account/ChangeEmailForm.tsx
Deleted legacy account management page and change-email form in favor of new widget-based and dialog-based approach.
Dashboard Plugin - Schema/Validation Updates
libs/portal-plugin-dashboard/src/ui/forms/updateEmail.schema.ts
Renamed schema field retypePassword to password_confirm and updated validation logic accordingly.
Dashboard Plugin - Miscellaneous
libs/portal-plugin-dashboard/src/ui/components/account/ChangeEmailForm.tsx
File deleted (see above).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AppComponent
    participant DialogProvider
    participant DialogRenderer
    participant SchemaForm
    participant FormAdapter
    participant DataProvider

    User->>AppComponent: Loads app
    AppComponent->>DialogProvider: Renders DialogProvider
    DialogProvider->>DialogRenderer: Renders DialogRenderer at top level
    User->>SchemaForm: Interacts with form (e.g., edit profile)
    SchemaForm->>FormAdapter: Handles form logic (with autosave)
    FormAdapter->>DataProvider: Submits data (with auth token if set)
    DataProvider->>DataProvider: Adds Authorization header if token present
    DataProvider->>External API: Makes REST request
    External API-->>DataProvider: Returns response
    DataProvider-->>FormAdapter: Returns result
    FormAdapter-->>SchemaForm: Updates form state
    SchemaForm-->>User: Shows autosave indicator/status
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Poem

🐇✨
A dashboard blooms with widgets new,
Profile, bio—fresh forms in view.
Autosave hums, dialogs align,
Bin-packers pack in record time.
Old account pages hop away,
Core and UI now light and fey.
With every patch, the garden grows—
A rabbit’s joy, as progress shows!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0352a61 and eb63041.

⛔ Files ignored due to path filters (2)
  • libs/portal-sdk/src/account/generated/accountAPI.schemas.ts is excluded by !**/generated/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (57)
  • libs/advanced-rest/package.json (1 hunks)
  • libs/advanced-rest/src/provider.ts (8 hunks)
  • libs/portal-framework-auth/package.json (1 hunks)
  • libs/portal-framework-auth/src/capabilities/sdk.ts (1 hunks)
  • libs/portal-framework-auth/src/dataProviders/auth.ts (1 hunks)
  • libs/portal-framework-core/package.json (2 hunks)
  • libs/portal-framework-core/src/components/WidgetArea.tsx (3 hunks)
  • libs/portal-framework-core/src/index.ts (1 hunks)
  • libs/portal-framework-core/src/types/portal.ts (1 hunks)
  • libs/portal-framework-ui-core/src/tailwind-plugin.css (1 hunks)
  • libs/portal-framework-ui/package.json (0 hunks)
  • libs/portal-framework-ui/src/components/actions/ActionListRenderer.tsx (1 hunks)
  • libs/portal-framework-ui/src/components/app/AppComponent.tsx (1 hunks)
  • libs/portal-framework-ui/src/components/dialog/Dialog.renderer.tsx (4 hunks)
  • libs/portal-framework-ui/src/components/form/FormRenderer.tsx (1 hunks)
  • libs/portal-framework-ui/src/components/form/SchemaForm.tsx (7 hunks)
  • libs/portal-framework-ui/src/components/form/adapters.tsx (2 hunks)
  • libs/portal-framework-ui/src/components/form/context.tsx (2 hunks)
  • libs/portal-framework-ui/src/components/form/fields/Input.tsx (1 hunks)
  • libs/portal-framework-ui/src/components/form/fields/registry.ts (1 hunks)
  • libs/portal-framework-ui/src/components/form/types.ts (3 hunks)
  • libs/portal-framework-ui/tsdown.config.ts (2 hunks)
  • libs/portal-plugin-abuse/package.json (1 hunks)
  • libs/portal-plugin-admin/package.json (1 hunks)
  • libs/portal-plugin-dashboard/package.json (1 hunks)
  • libs/portal-plugin-dashboard/plugin.config.ts (1 hunks)
  • libs/portal-plugin-dashboard/src/capabilities/refineConfig.ts (1 hunks)
  • libs/portal-plugin-dashboard/src/index.ts (1 hunks)
  • libs/portal-plugin-dashboard/src/routes.ts (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/EmailVerificationBanner.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/ManagementCard.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/NavigationButton.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/account/ChangeEmailForm.tsx (0 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/account/ChangePasswordForm.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/account/DeleteAccountDialog.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/account/DisableTwoFactorDialog.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/account/SetupTwoFactorDialog.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/uploads/Manager.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/dialogs/updateEmail.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/forms/editProfile.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/forms/fields/AccountEmail.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/forms/updateEmail.schema.ts (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/forms/updateEmail.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/routes/Account.tsx (0 hunks)
  • libs/portal-plugin-dashboard/src/ui/routes/AccountVerify.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/routes/ApiKeys.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/routes/account.profile.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/widgets/account/bio.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/widgets/account/profile.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/widgetRegistrations.ts (1 hunks)
  • package.json (4 hunks)
  • patches/@refinedev__devtools-internal.patch (1 hunks)
  • patches/papaparse.patch (1 hunks)
  • patches/pluralize.patch (1 hunks)
  • patches/warn-once.patch (1 hunks)
  • shared/assets/tailwind-plugin.css (1 hunks)
  • shared/assets/tailwind.css (0 hunks)
💤 Files with no reviewable changes (4)
  • shared/assets/tailwind.css
  • libs/portal-plugin-dashboard/src/ui/components/account/ChangeEmailForm.tsx
  • libs/portal-plugin-dashboard/src/ui/routes/Account.tsx
  • libs/portal-framework-ui/package.json
✅ Files skipped from review due to trivial changes (11)
  • libs/portal-plugin-dashboard/src/ui/components/NavigationButton.tsx
  • libs/portal-plugin-dashboard/src/ui/components/EmailVerificationBanner.tsx
  • libs/portal-plugin-dashboard/src/ui/components/ManagementCard.tsx
  • libs/portal-plugin-dashboard/package.json
  • libs/advanced-rest/package.json
  • libs/portal-plugin-dashboard/src/ui/routes/ApiKeys.tsx
  • libs/portal-framework-core/src/index.ts
  • libs/portal-framework-ui/src/components/actions/ActionListRenderer.tsx
  • libs/portal-plugin-dashboard/src/ui/routes/AccountVerify.tsx
  • libs/portal-plugin-dashboard/src/ui/components/account/SetupTwoFactorDialog.tsx
  • patches/@refinedev__devtools-internal.patch
🚧 Files skipped from review as they are similar to previous changes (40)
  • libs/portal-plugin-dashboard/src/ui/components/account/DeleteAccountDialog.tsx
  • libs/portal-plugin-dashboard/src/ui/components/uploads/Manager.tsx
  • libs/portal-plugin-abuse/package.json
  • libs/portal-plugin-dashboard/src/ui/forms/editProfile.tsx
  • libs/portal-plugin-dashboard/src/ui/components/account/DisableTwoFactorDialog.tsx
  • libs/portal-framework-ui/src/components/form/fields/Input.tsx
  • libs/portal-plugin-dashboard/plugin.config.ts
  • patches/papaparse.patch
  • patches/warn-once.patch
  • libs/portal-framework-auth/src/capabilities/sdk.ts
  • libs/portal-framework-ui/tsdown.config.ts
  • package.json
  • libs/portal-framework-ui/src/components/form/fields/registry.ts
  • libs/advanced-rest/src/provider.ts
  • libs/portal-plugin-dashboard/src/routes.ts
  • libs/portal-plugin-dashboard/src/ui/widgets/account/bio.tsx
  • libs/portal-framework-auth/package.json
  • libs/portal-framework-ui/src/components/dialog/Dialog.renderer.tsx
  • libs/portal-plugin-dashboard/src/ui/forms/fields/AccountEmail.tsx
  • libs/portal-framework-ui/src/components/form/adapters.tsx
  • libs/portal-framework-ui-core/src/tailwind-plugin.css
  • libs/portal-plugin-dashboard/src/index.ts
  • libs/portal-framework-core/package.json
  • libs/portal-framework-core/src/types/portal.ts
  • libs/portal-plugin-admin/package.json
  • libs/portal-plugin-dashboard/src/ui/components/account/ChangePasswordForm.tsx
  • shared/assets/tailwind-plugin.css
  • libs/portal-framework-ui/src/components/form/types.ts
  • libs/portal-framework-ui/src/components/form/FormRenderer.tsx
  • libs/portal-plugin-dashboard/src/capabilities/refineConfig.ts
  • libs/portal-plugin-dashboard/src/ui/forms/updateEmail.schema.ts
  • libs/portal-framework-ui/src/components/app/AppComponent.tsx
  • libs/portal-plugin-dashboard/src/ui/forms/updateEmail.tsx
  • libs/portal-framework-auth/src/dataProviders/auth.ts
  • libs/portal-plugin-dashboard/src/widgetRegistrations.ts
  • libs/portal-plugin-dashboard/src/ui/routes/account.profile.tsx
  • libs/portal-plugin-dashboard/src/ui/widgets/account/profile.tsx
  • libs/portal-plugin-dashboard/src/ui/dialogs/updateEmail.tsx
  • libs/portal-framework-core/src/components/WidgetArea.tsx
  • libs/portal-framework-ui/src/components/form/context.tsx
🔇 Additional comments (13)
libs/portal-framework-ui/src/components/form/SchemaForm.tsx (13)

9-9: Import additions look appropriate for new functionality.

The added imports align well with the autosave feature implementation:

  • AutoSaveIndicator and related types from @refinedev/core
  • UnifiedFormReturnType from adapters
  • FormAutosaveConfig from types

Also applies to: 11-16, 21-21, 24-25


37-52: Well-structured helper function for autosave configuration.

The computeAutoSaveConfig function properly normalizes different autosave input formats (boolean, object, or undefined) into a consistent configuration object with sensible defaults.


58-58: Variable renaming improves clarity.

Renaming setFormMethods to setFormInstance provides better semantic alignment with the actual usage and the renamed variable throughout the component.


70-70: Good separation of concerns with autosave configuration.

Computing the autosave configuration separately from form instance creation makes the code more readable and maintainable.


72-84: Enhanced form configuration with proper conditional logic.

The form instance creation properly integrates autosave config and conditional ID assignment based on form action. The logic for setting ID only for "edit" and "clone" actions is appropriate.


86-90: Improved type safety for autosave props extraction.

The updated code addresses the previous type assertion concern by using a proper type guard ("refineCore" in formInstance) before the type assertion. This prevents runtime errors when formInstance doesn't have the expected structure.


93-96: Consistent variable usage in useEffect.

The useEffect properly uses the renamed formInstance variable and dependency, maintaining consistency throughout the component.


108-108: Clear autosave condition computation.

The isRefineWithAutosave variable clearly encapsulates the conditions for showing autosave functionality.


113-113: FormProvider integration with new props structure.

The FormProvider properly receives the new autoSave and formInstance props as defined in the updated interface.

Also applies to: 115-115


119-125: Improved CSS class logic with proper conditional spacing.

The updated className logic properly handles different layout types and only adds vertical spacing when the layout is not "grid", which is more precise than the previous implementation.


126-131: Consistent formInstance usage in form submission.

All form submission logic properly uses formInstance instead of the previous methods, maintaining consistency throughout the component.

Also applies to: 140-141, 143-144


164-164: Footer rendering updated with correct variable.

The footer function call and form state access properly use formInstance, maintaining consistency with the variable renaming.

Also applies to: 173-173


181-186: AutoSaveIndicator integration looks solid.

The conditional rendering of AutoSaveIndicator properly checks for both refine usage and autosave enablement, and passes the required props including custom autosave states from config.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch libs/portal-plugin-dashboard

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 20

🧹 Nitpick comments (11)
libs/portal-plugin-dashboard/src/ui/components/ManagementCard.tsx (1)

1-7: Same import switch as above – watch for unused bundle bloat

Switching every consumer to *-ui-core is fine, but keep an eye on bundle size: if the old package is still pulled by transitive deps you may now be shipping both. A quick npm ls @lumeweb/portal-framework-ui will tell you.

libs/portal-plugin-dashboard/src/ui/components/account/DisableTwoFactorDialog.tsx (1)

16-17: Prefer a single-source import for related hooks/components

useApiUrl is still imported from @lumeweb/portal-framework-ui while all UI primitives now come from @lumeweb/portal-framework-ui-core.
If useApiUrl has also moved to *-core, leaving it here will create an extra bundle chunk and duplicate peer-deps at runtime.

-import { useApiUrl } from "@lumeweb/portal-framework-ui";
+import { useApiUrl } from "@lumeweb/portal-framework-ui-core";

Verify the hook’s actual package location and update accordingly.

libs/portal-plugin-dashboard/src/ui/routes/ApiKeys.tsx (2)

166-167: Fix HTML entity typos rendered to users

&apost is an invalid entity, so the literal text &apost will appear in the dialog.

-... it won&apost
+... it won&apos;t

Apply the same correction to Line 182.

Also applies to: 182-183


194-195: Terminate &quot entities

Missing semicolons will output the raw string.

-API key &quot
+API key &quot;
libs/portal-plugin-dashboard/src/ui/forms/updateEmail.schema.ts (1)

10-14: superRefine should not return true

zod ignores the return value of superRefine; returning a boolean is misleading.

-    return true;

Also consider trimming the email/password fields to avoid trailing-space errors.

libs/portal-plugin-dashboard/src/ui/forms/editProfile.tsx (1)

8-11: Enhance auto-save user feedback.

The idle state renders an empty fragment, which provides no visual feedback to users about the auto-save status. Consider showing a subtle indicator when changes are saved.

     autoSaveStates: {
-      idle: <></>,
+      idle: <span className="text-xs text-gray-500">Changes saved</span>,
     },
libs/portal-plugin-dashboard/src/ui/widgets/account/profile.tsx (1)

23-23: Consider adding error boundary for form rendering.

While the current implementation is clean, consider wrapping the SchemaForm in an error boundary to gracefully handle potential form configuration or rendering errors.

libs/portal-plugin-dashboard/src/ui/widgets/account/bio.tsx (1)

22-23: Improve display name construction.

Consider using a more robust approach for constructing the display name that handles edge cases better.

-  const displayName =
-    `${identity?.firstName || ""} ${identity?.lastName || ""}`.trim();
+  const displayName = [identity?.firstName, identity?.lastName]
+    .filter(Boolean)
+    .join(' ') || 'Anonymous User';
libs/portal-plugin-dashboard/src/ui/dialogs/updateEmail.tsx (1)

14-14: Fix misleading parameter name.

The parameter updatePasswordHook is misleading since this function handles email updates, not password updates.

-  updatePasswordHook: UseCustomMutationReturnType<FormValues, any>,
+  updateEmailHook: UseCustomMutationReturnType<FormValues, any>,

And update the usage:

-      return updatePasswordHook.mutateAsync({
+      return updateEmailHook.mutateAsync({
libs/portal-plugin-dashboard/src/capabilities/refineConfig.ts (2)

16-16: Remove or utilize the unused version property.

The version property is declared but never initialized or used throughout the class.

Consider either removing it or initializing it with a meaningful value if it's intended for future use.


19-19: Consider adding cleanup logic or removing the async keyword.

The destroy method is empty. If no cleanup is needed, remove the async keyword. Otherwise, add appropriate cleanup logic or a TODO comment.

-  async destroy() {}
+  destroy() {
+    // No cleanup needed
+  }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3b2fb2 and 0352a61.

⛔ Files ignored due to path filters (2)
  • libs/portal-sdk/src/account/generated/accountAPI.schemas.ts is excluded by !**/generated/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (57)
  • libs/advanced-rest/package.json (1 hunks)
  • libs/advanced-rest/src/provider.ts (8 hunks)
  • libs/portal-framework-auth/package.json (1 hunks)
  • libs/portal-framework-auth/src/capabilities/sdk.ts (1 hunks)
  • libs/portal-framework-auth/src/dataProviders/auth.ts (1 hunks)
  • libs/portal-framework-core/package.json (1 hunks)
  • libs/portal-framework-core/src/components/WidgetArea.tsx (3 hunks)
  • libs/portal-framework-core/src/index.ts (1 hunks)
  • libs/portal-framework-core/src/types/portal.ts (1 hunks)
  • libs/portal-framework-ui-core/src/tailwind-plugin.css (1 hunks)
  • libs/portal-framework-ui/package.json (0 hunks)
  • libs/portal-framework-ui/src/components/actions/ActionListRenderer.tsx (1 hunks)
  • libs/portal-framework-ui/src/components/app/AppComponent.tsx (1 hunks)
  • libs/portal-framework-ui/src/components/dialog/Dialog.renderer.tsx (5 hunks)
  • libs/portal-framework-ui/src/components/form/FormRenderer.tsx (1 hunks)
  • libs/portal-framework-ui/src/components/form/SchemaForm.tsx (7 hunks)
  • libs/portal-framework-ui/src/components/form/adapters.tsx (2 hunks)
  • libs/portal-framework-ui/src/components/form/context.tsx (2 hunks)
  • libs/portal-framework-ui/src/components/form/fields/Input.tsx (1 hunks)
  • libs/portal-framework-ui/src/components/form/fields/registry.ts (1 hunks)
  • libs/portal-framework-ui/src/components/form/types.ts (3 hunks)
  • libs/portal-framework-ui/tsdown.config.ts (2 hunks)
  • libs/portal-plugin-abuse/package.json (1 hunks)
  • libs/portal-plugin-admin/package.json (1 hunks)
  • libs/portal-plugin-dashboard/package.json (1 hunks)
  • libs/portal-plugin-dashboard/plugin.config.ts (1 hunks)
  • libs/portal-plugin-dashboard/src/capabilities/refineConfig.ts (1 hunks)
  • libs/portal-plugin-dashboard/src/index.ts (1 hunks)
  • libs/portal-plugin-dashboard/src/routes.ts (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/EmailVerificationBanner.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/ManagementCard.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/NavigationButton.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/account/ChangeEmailForm.tsx (0 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/account/ChangePasswordForm.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/account/DeleteAccountDialog.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/account/DisableTwoFactorDialog.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/account/SetupTwoFactorDialog.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/components/uploads/Manager.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/dialogs/updateEmail.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/forms/editProfile.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/forms/fields/AccountEmail.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/forms/updateEmail.schema.ts (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/forms/updateEmail.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/routes/Account.tsx (0 hunks)
  • libs/portal-plugin-dashboard/src/ui/routes/AccountVerify.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/routes/ApiKeys.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/routes/account.profile.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/widgets/account/bio.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/ui/widgets/account/profile.tsx (1 hunks)
  • libs/portal-plugin-dashboard/src/widgetRegistrations.ts (1 hunks)
  • package.json (4 hunks)
  • patches/@refinedev__devtools-internal.patch (1 hunks)
  • patches/papaparse.patch (1 hunks)
  • patches/pluralize.patch (1 hunks)
  • patches/warn-once.patch (1 hunks)
  • shared/assets/tailwind-plugin.css (1 hunks)
  • shared/assets/tailwind.css (0 hunks)
💤 Files with no reviewable changes (4)
  • shared/assets/tailwind.css
  • libs/portal-framework-ui/package.json
  • libs/portal-plugin-dashboard/src/ui/routes/Account.tsx
  • libs/portal-plugin-dashboard/src/ui/components/account/ChangeEmailForm.tsx
🔇 Additional comments (70)
patches/pluralize.patch (1)

9-9: Code formatting changes look good.

The formatting updates (removing spaces around function parameters, updating comments) improve consistency and readability without affecting functionality.

Also applies to: 17-17, 19-19, 27-27, 31-31

shared/assets/tailwind-plugin.css (1)

1-2: LGTM! Standard Tailwind CSS setup completed.

Adding the @tailwind base; and @tailwind components; directives completes the standard Tailwind CSS configuration alongside the existing utilities directive. This ensures all Tailwind styles are properly included.

libs/portal-framework-ui-core/src/tailwind-plugin.css (1)

1-1: LGTM! Import path correctly updated.

The import path adjustment from ./shared/assets/tailwind-plugin.css to ../../../shared/assets/tailwind-plugin.css properly reflects the repository structure and aligns with the shared assets organization.

patches/warn-once.patch (1)

9-10: LGTM! Module system modernization applied correctly.

The patch successfully converts the export from CommonJS (module.exports) to ES module syntax (export default), modernizing the module system while preserving the original functionality.

patches/papaparse.patch (1)

10-24: LGTM! UMD wrapper enhances module compatibility.

The Universal Module Definition wrapper correctly detects and supports multiple module systems (AMD, CommonJS, ESM, and browser globals) while preserving the original PapaParse functionality. This improves library interoperability across different JavaScript environments.

libs/portal-plugin-dashboard/src/ui/components/uploads/Manager.tsx (1)

1-1: LGTM! Import source updated for UI refactoring.

The import change from @lumeweb/portal-framework-ui to @lumeweb/portal-framework-ui-core aligns with the broader UI modularization effort mentioned in the PR objectives, ensuring the Tabs component is imported from the correct package.

libs/portal-plugin-dashboard/src/ui/components/NavigationButton.tsx (1)

1-1: Import path updated to core UI package – looks good

The switch to @lumeweb/portal-framework-ui-core matches the new repo-wide convention and should resolve any tree-shaking / bundle-size issues tied to the old umbrella package.

libs/portal-plugin-dashboard/src/ui/components/account/SetupTwoFactorDialog.tsx (1)

14-16: Consistent core-package import – no issues spotted

FormLabel, FormMessage, and Input now come from @lumeweb/portal-framework-ui-core, aligning with the migration pattern. Hook utilities remain in the non-core package, which is expected.

libs/portal-plugin-abuse/package.json (1)

23-25: Peer-dependency bump is appropriate – verify lockfile

Raising @refinedev/core to ^4.57.10 keeps this package in sync with the rest of the mono-repo. After merging, regenerate the root lockfile to avoid mix-version installs.

libs/advanced-rest/package.json (1)

5-7: Dependency bump aligns with provider refactor

@refinedev/core ^4.57.10 is required for the new setAuthToken helper added elsewhere. Good catch.

libs/portal-framework-auth/package.json (1)

28-33: Peer-dependency version harmonised

Updating to ^4.57.10 preserves compatibility across all auth-related libraries. Nothing else to flag.

libs/portal-plugin-dashboard/src/ui/components/EmailVerificationBanner.tsx (1)

7-13: Confirm that the new @lumeweb/portal-framework-ui-core package actually re-exports these components

All UI primitives are now pulled from the *-ui-core package. If any of Alert, AlertDescription, AlertTitle, or Button were only available from the previous umbrella package, the file will fail to compile at runtime (tree-shaken builds won’t show the error until they hit that import). Run a quick tsc --noEmit/vite build to be certain the new barrel exports are present and have identical named-export spellings.

libs/portal-plugin-dashboard/src/ui/components/account/DeleteAccountDialog.tsx (1)

3-11: Import path switched – double-check tree-shaken re-exports

Same note as the other files: be certain every named export exists in @lumeweb/portal-framework-ui-core; otherwise the dialog will break at runtime and the whole MF-fed bundle may refuse to initialise.

libs/portal-plugin-admin/package.json (1)

18-20: Dependency bump to @refinedev/core is consistent and non-breaking

Patch-level upgrade from 4.57.94.57.10 keeps the peer range aligned with other workspaces and should be safe.
No further action required.

libs/portal-plugin-dashboard/src/ui/components/account/ChangePasswordForm.tsx (1)

5-16: Import source swap correctly targets ui-core

Switching the component set to @lumeweb/portal-framework-ui-core matches the broader migration away from the umbrella UI package. Tree-shaking and bundle size will benefit; no code changes needed.

libs/portal-framework-ui/src/components/form/fields/Input.tsx (1)

20-21: Verify new bg-input utility exists in the design system

The previous class bg-modal-input is replaced with bg-input.
Please confirm that bg-input is defined in Tailwind’s theme; if not, inputs will render with an unintended default background.

libs/portal-framework-core/src/index.ts (1)

55-56: Exporting WidgetRegistration improves DX

Re-exporting the type from the root barrel lets downstream packages type their widget arrays without deep import paths. Looks good.

libs/portal-framework-ui/src/components/actions/ActionListRenderer.tsx (1)

30-34: Added gap-4 for horizontal layout enhances spacing

The flex gap utility simplifies spacing semantics compared to individual margins—nice incremental polish.

libs/portal-plugin-dashboard/src/ui/routes/ApiKeys.tsx (1)

21-22: Import change looks good

Migrating primitives to @lumeweb/portal-framework-ui-core keeps the bundle slim and follows the new module split.

package.json (1)

22-26: Confirm ESM-only packages don’t leak into CJS builds

qs-esm ships pure ESM. If any server-side tooling still expects CommonJS (jest, Node < 20’s older loaders, etc.) this will cause runtime errors. Ensure all consumers are ESM-ready or fall back to qs.

libs/portal-framework-ui/src/components/form/FormRenderer.tsx (1)

41-45: Form field spacing is preserved by SchemaForm.tsx

The parent <form> in SchemaForm.tsx still applies the appropriate Tailwind spacing (e.g. space-y-4 for vertical layouts or flex flex-row gap-4 for horizontal), so removing the space-y-4 wrapper in FormRenderer does not affect field spacing.

• In libs/portal-framework-ui/src/components/form/SchemaForm.tsx, the <form> element uses:

  • "space-y-4": cConfig.layout !== "grid"
  • "flex flex-col space-y-4": cConfig.layout === "vertical" || !cConfig.layout
  • "flex flex-row gap-4 items-end": cConfig.layout === "horizontal"

• SchemaForm.spec.tsx also asserts that the form has the space-y-4 class.

No further changes required.

libs/portal-framework-auth/src/dataProviders/auth.ts (1)

147-156: LGTM! Clean addition of created_at field to user identity.

The addition of the created_at field to the user identity object is well-implemented and aligns with the Identity type extension mentioned in the PR objectives.

libs/portal-plugin-dashboard/plugin.config.ts (1)

12-15: LGTM! Well-organized expose mappings for the account refactor.

The new expose entries properly support the modular account widgets and routes, replacing the monolithic Account component approach.

libs/portal-framework-ui/src/components/app/AppComponent.tsx (1)

273-273: LGTM! Good architectural improvement for dialog management.

Moving DialogRenderer to the top level centralizes dialog rendering and prevents multiple instances from being created for each route, which improves performance and consistency.

libs/portal-framework-auth/src/capabilities/sdk.ts (1)

30-30: Subdomain Preservation Logic Is Correctly Aligned

The update to use preserveSubdomain: env.VITE_PORTAL_DOMAIN_IS_ROOT now respects the core default in getApiBaseUrl (which does env.VITE_PORTAL_DOMAIN_IS_ROOT || explicitPreserveSubdomain) rather than always forcing preservation. This ensures:

  • When VITE_PORTAL_DOMAIN_IS_ROOT is false, the hostname is stripped to the root domain (desired for auth calls).
  • When it’s true, full hostnames—including subdomains—are retained (matching default behavior and existing tests).

All related implementations (dashboard, admin, and core tests) confirm this pattern. No further changes needed.

libs/portal-plugin-dashboard/src/ui/forms/updateEmail.tsx (2)

4-26: Well-structured form configuration with clear field definitions.

The form configuration approach is clean and follows modern declarative patterns. The field definitions are clear with appropriate types, and the horizontal action button layout provides good UX.


21-21: Field name password_confirm is consistent with its validation schema

Both the form and its schema use the same password_confirm field:

• libs/portal-plugin-dashboard/src/ui/forms/updateEmail.tsx (name: "password_confirm")
• libs/portal-plugin-dashboard/src/ui/forms/updateEmail.schema.ts (defines and validates password_confirm)

No further changes needed here—this matches as intended.

libs/portal-framework-ui/tsdown.config.ts (2)

7-7: Appropriate external module exclusion for @refinedev packages.

Adding /@refinedev\/.*/ to the external array correctly excludes these dependencies from bundling, which aligns with the dependency updates mentioned in the PR.


27-27: Good addition for disabled file exclusion pattern.

The exclusion pattern for .disabled.{ts,tsx} files provides useful flexibility for temporarily disabling test and story files without removing them from the codebase.

libs/portal-plugin-dashboard/src/ui/routes/AccountVerify.tsx (1)

1-5: Excellent import reorganization for better modularity.

The refactoring of imports demonstrates good architectural improvements:

  • Moving Button to @lumeweb/portal-framework-ui-core suggests better separation of core vs extended components
  • Consolidating image imports to the dedicated images package improves organization
  • Separating the useSdk import improves readability

These changes align well with the broader modularization efforts in the PR.

libs/portal-plugin-dashboard/src/ui/routes/account.profile.tsx (2)

3-20: Clean and well-structured profile route component.

The component follows React best practices with:

  • Clear functional component structure
  • Semantic HTML with proper header/content organization
  • Good use of Tailwind classes for consistent styling
  • Proper integration with the widget system via WidgetArea

The modular approach using widgets allows for flexible content management in the profile section.


17-17: Widget area “core:dashboard:profile” registration verified
The following entries exist in libs/portal-plugin-dashboard/src/widgetRegistrations.ts, so the <WidgetArea widgetAreaId="core:dashboard:profile"> will render the intended widgets:

  • widgets/account/bio (cols: 1, rows: 1)
  • widgets/account/profile (cols: 2, rows: 2)

No further changes needed.

libs/portal-plugin-dashboard/src/widgetRegistrations.ts (4)

1-2: Good addition of proper typing with WidgetRegistration import.

Adding the WidgetRegistration type import provides better type safety for the widget registration objects.


8-19: Well-configured widget registrations for the profile area.

The two widget registrations are appropriately configured:

  • Bio widget (1x1) for compact user information display
  • Profile widget (2x2) for more detailed profile management
  • Both target the correct "core:dashboard:profile" area matching the AccountProfile route

The grid sizing makes logical sense for the different widget purposes.


20-20: Excellent use of satisfies for type safety.

The satisfies WidgetRegistration[] provides compile-time type checking while maintaining type inference, which is a modern TypeScript best practice.


10-10: Widget component references verified

Both widgets/account/bio and widgets/account/profile map to existing files under libs/portal-plugin-dashboard/src/ui/widgets/account and each exports a default function (Bio and Profile, respectively). No further changes are needed.

libs/portal-plugin-dashboard/src/ui/forms/editProfile.tsx (1)

28-32: Custom email field type is properly registered
Confirmed that "core:dashboard:account.email" is registered via registerFormComponent in the codebase. No further action is required.

• libs/portal-plugin-dashboard/src/ui/forms/fields/AccountEmail.tsx (line 58):
registerFormComponent("core:dashboard:account.email", AccountEmail);

libs/portal-plugin-dashboard/src/ui/widgets/account/profile.tsx (1)

12-27: LGTM! Clean widget implementation.

The Profile widget component is well-structured with proper Card layout, clear visual hierarchy, and good separation of concerns by importing the form configuration.

libs/portal-plugin-dashboard/src/routes.ts (1)

16-31: LGTM! Well-structured nested routing.

The new account route structure properly implements nested routing with a layout component and index route. The navigation metadata and route IDs are well-defined.

libs/portal-plugin-dashboard/src/index.ts (2)

17-22: LGTM! Proper plugin capability and widget registration.

The additions properly extend the plugin with widget registrations and the new Refine configuration capability. The capability array structure is maintained correctly.


28-30: Input registration timing is correct.

The initialize hook is invoked during the plugin load phase—before any UI or form components are rendered—so calling registerInput() there safely registers the AccountEmail field in time. No changes are needed.

libs/portal-plugin-dashboard/src/ui/dialogs/updateEmail.tsx (1)

25-56: Well-structured dialog configuration.

The dialog configuration follows good patterns with proper error handling, notifications, and async success callbacks. The conditional refetch logic is clean and the mutation setup is comprehensive.

libs/portal-plugin-dashboard/src/ui/forms/fields/AccountEmail.tsx (1)

57-59: Good registration pattern.

The component registration using a separate exported function is a clean pattern that allows for conditional registration during plugin initialization.

libs/portal-framework-ui/src/components/form/adapters.tsx (2)

20-22: Good approach to unify form return types.

The UnifiedFormReturnType union effectively handles the different form hook implementations. This provides flexibility while maintaining type safety.


29-31: Safety confirmed: no type narrowing needed for current usages
All existing references to methods across the codebase access only shared properties—such as formState, getValues, setValue, and handleSubmit—which are available on both sides of the UnifiedFormReturnType union. There are no direct calls to adapter-specific fields (e.g. refineCore) in consuming code. You can merge as-is. If you later need to use implementation-specific APIs, introduce a type guard or cast at that time.

libs/portal-framework-ui/src/components/dialog/Dialog.renderer.tsx (2)

23-23: Good import consolidation.

Consolidating the form component imports into a single import statement improves maintainability and aligns with the form module restructuring.


312-319: Clean className refactoring.

The refactored className construction using the cn utility with conditional expressions significantly improves readability and maintainability compared to inline ternary operators.

libs/portal-framework-ui/src/components/form/types.ts (4)

1-9: LGTM: Clean import additions for autosave functionality.

The new type imports are well-organized and correctly added to support the autosave feature integration.


60-69: LGTM: Well-structured autosave configuration properties.

The new optional properties are appropriately typed and maintain backward compatibility while enabling autosave functionality.


71-72: LGTM: Clean type alias for autosave configuration.

The type alias provides a clear abstraction for the autosave configuration, improving code readability and maintainability.


111-111: LGTM: Enhanced type flexibility for form fields.

Expanding the type property to accept generic strings in addition to FormFieldType provides good extensibility while maintaining type safety.

libs/advanced-rest/src/provider.ts (7)

50-55: LGTM: Clean bearer token implementation.

The auth token management is well-implemented with proper closure scoping and a clean API for setting the token externally.


61-71: LGTM: Proper header handling with authorization support.

The authorization header is conditionally added and headers are properly merged, allowing for flexible per-request customization.


120-132: LGTM: Consistent header extraction pattern.

The header extraction using optional chaining and passing to baseFetch is implemented consistently and safely.


142-166: LGTM: Consistent implementation across methods.

The header handling follows the same clean pattern established in other methods.


173-181: LGTM: Consistent header support in deleteOne method.

The implementation maintains consistency with other CRUD methods while adding proper header support.


269-276: LGTM: Consistent header support across all methods.

All data provider methods now consistently support headers from the meta parameter, maintaining a clean and uniform API.


283-290: LGTM: Complete header support implementation.

The update method completes the consistent header support implementation across all CRUD operations.

libs/portal-framework-ui/src/components/form/context.tsx (3)

3-17: LGTM: Improved type safety with structured form context.

The replacement of generic methods with properly typed formInstance and structured autoSave object significantly improves type safety and code clarity.


21-33: LGTM: FormProvider correctly updated for new structure.

The provider component properly accepts and provides the new structured context properties while maintaining clean React patterns.


35-43: LGTM: Clean formatting improvement.

The multiline generic formatting improves readability while maintaining the same functionality and type safety.

patches/@refinedev__devtools-internal.patch (2)

1-50: LGTM: Consistent TypeScript declaration updates.

The patch systematically updates all TypeScript declaration files to use the new error-stack-parser-es package, including proper source map updates.


51-96: LGTM: Correct API usage update for new package.

The compiled bundles are properly updated to use the new error-stack-parser-es package API, changing from ErrorStackParser.parse() to the named parse() export.

libs/portal-framework-core/src/components/WidgetArea.tsx (4)

2-10: LGTM: Clean dependency updates for refactoring.

The import changes properly support the transition to the bin-pack library and ReactIs for component validation while maintaining the public API.


98-98: LGTM: Improved component validation with ReactIs.

Using ReactIs.isValidElementType is more reliable than custom component validation and follows React best practices.


107-126: LGTM: Simplified bin-packing implementation.

The new implementation using the bin-pack library is much cleaner and more maintainable than the previous custom logic. The mapping between widget format and pack format is clear and correct.


128-130: LGTM: Good optimization for empty state.

The early return for empty widgets prevents unnecessary grid rendering while maintaining consistent spacing with the gap-4 class.

libs/portal-framework-ui/src/components/form/SchemaForm.tsx (3)

9-25: Import changes look good.

The new imports for autosave functionality and form types are properly organized and necessary for the enhanced features.


37-52: Well-structured autosave configuration helper.

The computeAutoSaveConfig function properly normalizes different autosave configuration formats with good defensive checks and sensible defaults.


179-184: Autosave indicator implementation looks good.

The conditional rendering correctly checks for both refine adapter and autosave enablement before rendering the indicator. The non-null assertion is safe due to the preceding conditional check.

Comment on lines 32 to 34
"@lumeweb/portal-sdk": "workspace:*",
"binpackingjs": "^3.0.2"
"bin-pack": "^1.0.2",
"react-is": "^19.1.1"
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Verification agent

❓ Verification inconclusive

bin-pack & react-is ship as CJS only – check ESM interop & type safety

  1. bin-pack (1.0.2) is CommonJS and ships no typings. With "type": "module" in this package, importing it with import binPack from "bin-pack" triggers Node’s CJS → ESM interop which works at runtime but leaves the symbol typed as any.

    // after build you’ll get implicit any ↓
    import binPack from "bin-pack";

    Consider:

    • Adding @types/bin-pack (doesn’t exist today) or authoring a minimal local .d.ts.
    • Importing with createRequire/dynamic await import() if build tooling complains.
  2. react-is duplicates React as a prod dep; usually it’s a peer. Verify you don’t end up bundling a second copy by accident.


Action Required: Ensure ESM Typing for bin-pack & Prevent Duplicate React via react-is

• bin-pack (v1.0.2) is CJS-only and ships no TypeScript declarations. With "type": "module" in your package.json,

import binPack from "bin-pack";
// → typed as `any`

To restore type safety, choose one:
– Add a minimal declaration file (e.g. libs/portal-framework-core/src/types/bin-pack.d.ts).
– Import it dynamically (await import("bin-pack")) or via createRequire to avoid the default‐import shim.

• react-is is intended as a peer dependency and can pull in React if bundled. To avoid shipping a second React copy:
– Move react-is from dependencies into peerDependencies (alongside react).
– Configure your bundler (Rollup/Webpack/etc.) to externalize both react and react-is.

Pinpoint locations:

  • libs/portal-framework-core/package.json (add types path and adjust peerDependencies)
  • Your bundler config (e.g. rollup.config.js or webpack.config.js) to mark react/react-is as external
🤖 Prompt for AI Agents
In libs/portal-framework-core/package.json around lines 32 to 35, fix the
bin-pack import typing by adding a minimal TypeScript declaration file (e.g.,
libs/portal-framework-core/src/types/bin-pack.d.ts) to provide type safety, or
alternatively use dynamic import or createRequire to avoid default-import
issues. Also, move react-is from dependencies to peerDependencies alongside
react to prevent bundling a duplicate React copy. Finally, update your bundler
configuration (rollup.config.js or webpack.config.js) to mark both react and
react-is as external dependencies to avoid including them in the bundle.

Comment on lines +8 to 9
created_at: string;
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Naming style drifts (created_at vs camelCase) – consider a canonical field

All existing props follow camelCase (firstName, lastName), but the new field is snake_case. This inconsistency leaks into the rest of the TS codebase and forces consumers to silence ESLint/TS naming rules.

-  created_at: string;
+  /** ISO-8601 timestamp of account creation (UTC) */
+  createdAt: string;
+  /**
+   * @deprecated kept for wire-format compatibility; will be removed once the API
+   * switches to camelCase.
+   */
+  created_at?: string;

Keeping both for a short deprecation window avoids breaking the data provider while letting the UI consume the idiomatic createdAt.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
created_at: string;
};
/** ISO-8601 timestamp of account creation (UTC) */
createdAt: string;
/**
* @deprecated kept for wire-format compatibility; will be removed once the API
* switches to camelCase.
*/
created_at?: string;
};
🤖 Prompt for AI Agents
In libs/portal-framework-core/src/types/portal.ts around lines 8 to 9, the field
`created_at` uses snake_case which is inconsistent with the camelCase naming
style used elsewhere like `firstName` and `lastName`. To fix this, rename
`created_at` to `createdAt` to follow camelCase conventions. To maintain
backward compatibility during a short deprecation period, keep both `created_at`
and `createdAt` fields in the type, marking `created_at` as deprecated, so the
data provider continues to work while the UI transitions to the idiomatic
camelCase field.

…t profile and widget layout

- Replaced Account component with new profile and bio widgets
- Updated widget area implementation to use bin-pack library instead of binpackingjs
- Added email update form with dialog integration
- Improved form handling with auto-save functionality
- Restructured account routes and components
- Updated dependencies including @refinedev/core to 4.57.10
- Enhanced UI styling and layout organization
@pcfreak30 pcfreak30 force-pushed the libs/portal-plugin-dashboard branch from 0352a61 to eb63041 Compare August 6, 2025 16:48
@pcfreak30 pcfreak30 merged commit 064073a into develop Aug 6, 2025
1 of 2 checks passed
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