Repository: strapi/strapi
File: packages/core/review-workflows/admin/src/index.ts (TypeScript)

Code before:
      });

      app.widgets.register({
        icon: SealCheck,
        title: {
          id: `${PLUGIN_ID}.widget.assigned.title`,
          defaultMessage: 'Assigned to me',
        },
        component: async () => {
          const { AssignedWidget } = await import('./components/Widgets');
          return AssignedWidget;
        },
        pluginId: PLUGIN_ID,
        id: 'assigned',
        permissions: [{ action: 'plugin::content-manager.explorer.read' }],
      });

      // Always put the assigned to me widget last in the list of widgets
      app.widgets.register((widgets: Record<string, WidgetType>) => {
        const assignedPluginUid = 'plugin::review-workflows.assigned';
        const ordered = [
          ...Object.values(widgets).filter((w) => !assignedPluginUid.includes(w.uid)),
          widgets['plugin::review-workflows.assigned'],
        ];
        return Object.fromEntries(ordered.map((w) => [w.uid, w]));
      });
    } else if (!window.strapi.features.isEnabled(FEATURE_ID) && window.strapi?.flags?.promoteEE) {
      app.addSettingsLink('global', {
        id: PLUGIN_ID,
        to: `purchase-review-workflows`,
        intlLabel: {
          id: `${PLUGIN_ID}.plugin.name`,
          defaultMessage: 'Review Workflows',
        },
        licenseOnly: true,
        permissions: [],
        async Component() {
          const { PurchaseReviewWorkflows } = await import('./routes/purchase-review-workflows');
          return { default: PurchaseReviewWorkflows };
        },
      });
    }
  },
  bootstrap(app: StrapiApp) {
    if (window.strapi.features.isEnabled(FEATURE_ID)) {
      app.getPlugin('content-manager').injectComponent('preview', 'actions', {
        name: 'review-workflows-assignee',
        Component: Header,
      });
    }
  },

Review comment (suggestion):
Here you're calling `register()` once to register the widget, and then a second time to change the widgets order. Instead you should call it a single time to add the widget precisely in the position you want it

Code after:
        },
      });

      // Always put the assigned to me widget last in the list of widgets
      app.widgets.register((widgets: WidgetArgs[]) => [
        ...widgets,
        {
          icon: SealCheck,
          title: {
            id: `${PLUGIN_ID}.widget.assigned.title`,
            defaultMessage: 'Assigned to me',
          },
          component: async () => {
            const { AssignedWidget } = await import('./components/Widgets');
            return AssignedWidget;
          },
          pluginId: PLUGIN_ID,
          id: 'assigned',
          permissions: [{ action: 'plugin::content-manager.explorer.read' }],
        },
      ]);
    } else if (!window.strapi.features.isEnabled(FEATURE_ID) && window.strapi?.flags?.promoteEE) {
      app.addSettingsLink('global', {
        id: PLUGIN_ID,
        to: `purchase-review-workflows`,
        intlLabel: {
          id: `${PLUGIN_ID}.plugin.name`,
          defaultMessage: 'Review Workflows',
        },
        licenseOnly: true,
        permissions: [],
        async Component() {
          const { PurchaseReviewWorkflows } = await import('./routes/purchase-review-workflows');
          return { default: PurchaseReviewWorkflows };
        },
      });
    }
  },
  bootstrap(app: StrapiApp) {
    if (window.strapi.features.isEnabled(FEATURE_ID)) {
      app.getPlugin('content-manager').injectComponent('preview', 'actions', {
        name: 'review-workflows-assignee',
        Component: Header,
      });
    }
  },
  async registerTrads({ locales }: { locales: string[] }) {
    const importedTrads = await Promise.all(
      locales.map((locale) => {
        return import(`./translations/${locale}.json`)
          .then(({ default: data }) => {