Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix: make keyboard shortcuts work on windows

Brad Barbinb497a78f2243
diff --git a/apps/erp/app/components/Agent/Agent.ee.tsx b/apps/erp/app/components/Agent/Agent.ee.tsx
index 5aadaae651..fde5f8c3a9 100644
--- a/apps/erp/app/components/Agent/Agent.ee.tsx
+++ b/apps/erp/app/components/Agent/Agent.ee.tsx
@@ -49,7 +49,7 @@ const providerMetadata = {
const shortcut: ShortcutDefinition = {
key: "I",
- modifiers: ["meta"],
+ modifiers: ["mod"],
};
const getInitialPrompt = (): LanguageModelV1Prompt => [
diff --git a/apps/erp/app/components/Layout/Topbar/Search.tsx b/apps/erp/app/components/Layout/Topbar/Search.tsx
index 9cf538d306..ebfc24616f 100644
--- a/apps/erp/app/components/Layout/Topbar/Search.tsx
+++ b/apps/erp/app/components/Layout/Topbar/Search.tsx
@@ -70,7 +70,7 @@ type SearchResult = {
const shortcut: ShortcutDefinition = {
key: "K",
- modifiers: ["meta"],
+ modifiers: ["mod"],
};
const SearchModal = ({
@@ -174,7 +174,7 @@ const SearchModal = ({
className="rounded-lg translate-y-0 p-0 h-[343px]"
withCloseButton={false}
>
- <Command className="rounded-lg border shadow-md">
+ <Command>
<CommandInput
placeholder="Type a command or search..."
value={input}
diff --git a/apps/erp/app/routes/x+/_index.tsx b/apps/erp/app/routes/x+/_index.tsx
index d1a2e75169..ae5f8b30a5 100644
--- a/apps/erp/app/routes/x+/_index.tsx
+++ b/apps/erp/app/routes/x+/_index.tsx
@@ -1,15 +1,13 @@
import { Heading, cn } from "@carbon/react";
+import { useMode } from "@carbon/remix";
import { getLocalTimeZone } from "@internationalized/date";
import { useLocale } from "@react-aria/i18n";
-import { Link } from "@remix-run/react";
import { useMemo, type ComponentProps } from "react";
-import { useModules, useUser } from "~/hooks";
-import type { Authenticated, NavItem } from "~/types";
+import { useUser } from "~/hooks";
export default function AppIndexRoute() {
const user = useUser();
- // const permissions = usePermissions();
- const modules = useModules();
+
const { locale } = useLocale();
const date = new Date();
@@ -22,52 +20,32 @@ export default function AppIndexRoute() {
[locale]
);
+ const { company } = useUser();
+ const mode = useMode();
+ let logo = mode === "dark" ? company?.logoDark : company?.logoLight;
+ if (!logo) {
+ logo = mode === "dark" ? "/carbon-word-dark.svg" : "/carbon-word-light.svg";
+ }
+
+ console.log({ logo });
+
return (
- <div className="p-8 w-full h-full bg-muted">
+ <div className="p-8 w-full flex flex-col h-[calc(100dvh-var(--header-height)*2)] bg-muted">
<Heading size="h3">Hello, {user.firstName}</Heading>
<Subheading>{formatter.format(date)}</Subheading>
- <Hr />
- <div className="grid grid-cols-[repeat(auto-fill,minmax(min(100%,300px),1fr))] gap-6 mb-8">
- {/* {permissions.can("view", "production") && (
- <ModuleCard
- module={{
- name: "Schedule",
- to: path.to.schedule,
- icon: LuCalendarClock,
- }}
- />
- )} */}
- {modules
- .filter((mod) => mod.name !== "Settings")
- .map((module) => (
- <ModuleCard key={module.name} module={module} />
- ))}
+ <div className="flex flex-col flex-grow items-center justify-center p-8">
+ <img
+ src={logo}
+ alt="Carbon"
+ className="max-w-lg w-full -mt-[var(--header-height)]"
+ />
</div>
</div>
);
}
-const Hr = () => (
- <hr className="h-px my-8 bg-black/10 border-0 dark:bg-white/10" />
-);
-
const Subheading = ({ children, className }: ComponentProps<"p">) => (
<p className={cn("text-muted-foreground text-base font-light", className)}>
{children}
</p>
);
-
-const ModuleCard = ({ module }: { module: Authenticated<NavItem> }) => (
- <Link
- to={module.to}
- prefetch="intent"
- className="aspect-video flex flex-col gap-3 items-center justify-center py-8 shadow-button-base bg-gradient-to-bl from-card from-50% to-background rounded-lg text-center group ring-2 ring-transparent hover:ring-white/10 cursor-pointer hover:scale-105 transition-all duration-300"
- >
- <div className="p-4 rounded-lg border">
- <module.icon className="text-2xl" />
- </div>
- <span className="text-sm py-1 px-4 border border-border rounded-full group-hover:bg-accent font-medium tracking-tight">
- {module.name}
- </span>
- </Link>
-);