Skip to content

Redesign filey-erp to the Filey Inventory Management design system - #6

Draft
iamveer82 wants to merge 30 commits into
mainfrom
claude/general-session-cIdbL
Draft

iamveer82 wants to merge 30 commits into
mainfrom
claude/general-session-cIdbL

Conversation

@iamveer82

Copy link
Copy Markdown
Owner

Summary

Rebuilds the filey-erp desktop app around a new Filey Inventory Management design system — a warm yellow/cream, Poppins-based, card-first UI — and adopts the mockup's navigation IA.

Note: filey-erp did not exist on main; it was sourced from feat/montek-blue-redesign and then fully redesigned on this branch. The diff vs main therefore includes the whole filey-erp module plus the redesign on top.

Design system (design.md)

  • Replaced the Montek blue ERP/CRM spec with the new system: #FFD600 primary, #FFBA3D secondary, #F3EBD6 background, #CBBEAA surface, #222222 text, Poppins, 16px card / 12px button radius, 4px spacing base, line icons.

Foundation

  • tailwind.config.js: new primary (yellow) + warm brand neutral ramp, secondary, semantic colors, Poppins font, type scale, radii, soft shadows.
  • index.css: restyled card / btn-* / chip / input / table classes (old .bento-card kept as alias so reused pages reskin automatically).
  • index.html: Inter → Poppins.

Navigation & layout

  • Adopted the mockup IA: Overview, Inventory, Orders, Quoting, Suppliers, Purchase, Reports, Settings (apps.ts, App.tsx).
  • Layout.tsx: light icon-first sidebar, storage-usage ring + "Upgrade Storage" card, quick-access icon row, and a topbar with ⌘K search, notification bell, and user chip.

Pages (card-based, wired to existing Supabase API)

  • Overview — KPI cards, Orders summary, delivery status + trend chart, recent activity, stock breakdown, dark reorder spotlight, top low-stock list.
  • Inventory / Orders / Suppliers / Purchase / Reports — new glanceable card + table screens.
  • Quoting reuses the existing invoice builder; Settings reuses the tools console (both reskinned via shared classes).
  • Removed orphaned CRM/HR/Finance/Dashboard/Launcher/Erp pages no longer in the nav.

UI primitives

  • Added Card, MetricCard, InfoCard, Delta to components/ui.tsx.

Test plan

  • tsc --noEmit passes
  • npm run build (tsc + vite) passes
  • Visual QA of dashboard/pages in-app — not done in this environment: the app is gated behind Supabase auth (no credentials configured here), so only Login/SetupNotice render without a configured backend. Recommend a manual run with Supabase env vars to verify the redesigned screens.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM


Generated by Claude Code

claude added 30 commits May 16, 2026 20:58
Rebuild the desktop ERP UI around the new warm yellow/cream design
system and a card-first, glanceable layout.

- design.md: replace Montek blue ERP/CRM spec with the Filey
  Inventory Management system (yellow primary, warm neutrals, Poppins,
  16px card / 12px button radius, 4px spacing base)
- tailwind.config.js + index.css: new color tokens, Poppins font,
  restyled card/button/chip/input/table component classes
- Layout: light icon-first sidebar, storage usage ring + upgrade
  card, quick-access row, search + notifications + user topbar
- Navigation adopts the mockup IA: Overview, Inventory, Orders,
  Quoting, Suppliers, Purchase, Reports, Settings
- New card-based pages: Overview (KPI/orders/activity/stock/reorder),
  Inventory, Orders, Suppliers, Purchase, Reports; Quoting reuses the
  invoice builder, Settings reuses the tools console
- ui.tsx: add Card / MetricCard / InfoCard / Delta primitives
- Remove orphaned CRM/HR/Finance/Dashboard/Launcher/Erp pages no
  longer in the new navigation

Typecheck and production build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
…ice templates

- Add a fully-local PDF toolkit (pdf-lib MIT + pdfjs-dist Apache-2.0):
  merge, split, extract, delete, rotate, images→PDF, PDF→images,
  page numbers, watermark, compress. All processing runs in the
  desktop webview — no external service, no AGPL code from PDFCraft.
- Settings page: new "Company Details" tab (logo upload + name,
  address, email, phone, TRN, default template/accent) saved once and
  auto-placed on every invoice; new "PDF Tools" tab hosting the
  toolbox; tabs restyled to the new chip design.
- Invoicing/Quoting: expand from 3 to 10 professional templates
  (minimal, classic, modern, corporate, elegant, bold, tech,
  creative, receipt, monogram), all auto-filling company branding.

Typecheck and production build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
Move the local PDF toolkit out of Settings into its own top-level
sidebar item ("Tools", /tools) with a dedicated page. Settings keeps
Company Details, Users, System and Audit tabs.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
- Critical: guard splitEvery against NaN/0/negative chunk size — an
  invalid "pages per file" value previously spun an infinite loop
  and hung the app.
- Load all PDFs with ignoreEncryption so common empty-owner-password
  files work instead of hard-failing.
- Watermark now auto-sizes to the page diagonal and is properly
  centred (was running off long pages / with long text).
- Tool dialog: clear stale results/errors when new files are picked,
  reset the file input so the same file can be re-selected, disable
  "Run tool" until a file is chosen, and close on Escape like every
  other modal.

Typecheck and production build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
…customer add

- Invoicing: rebuild the editor to the new "Create Invoice" layout —
  numbered steps (Choose Template carousel + view-all, Invoice
  Details, Items table, Additional Settings) with a sticky live
  Preview panel (device toggle, zoom, Change Template, PDF).
- CRM: new drag-and-drop pipeline board (native HTML5 DnD) — drag
  opportunities across qualification → won/lost, optimistic move
  persisted via crm.setOppStage, plus pipeline KPI cards and a
  new-opportunity modal.
- Add Customer modal (UAE FTA): capture legal/company name, address,
  email, phone and 15-digit TRN with validation; saved to CRM
  customers and auto-filled onto the invoice (TRN carried on the
  document as FTA requires); pick saved customers from a dropdown.
- Nav: rename Quoting → Invoicing (/invoicing), add CRM (/crm).

Typecheck and production build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
Rebuild Login as a two-panel layout — a gradient brand panel
(logo, headline, feature highlights, testimonial) beside a clean
form panel. All auth logic preserved: email/phone segmented,
password & one-time-code sign-in, sign-up, and the OTP screen.
Restyled to the warm Filey design system.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
- Replace leftover Montek-blue default invoice accent (#2563EB) and
  near-black fallbacks with the on-brand Text/Dark #222222 so new
  invoices match the design system out of the box.
- Normalize chrome heading weights to the spec's max (700 Bold;
  Poppins only ships 400/500/600/700) on ProfileSetup & SetupNotice.
- Invoicing list header now reads "Invoicing" to match the nav label.
- Sync design.md §03 nav to the shipped sections (Overview,
  Inventory, Orders, Invoicing, CRM, Suppliers, Purchase, Reports,
  Tools, Settings).

Typecheck and production build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
- Tools: redesign into a dashboard — Quick Access tiles, real
  Recent Activity (localStorage run log), pinnable Favorite Tools,
  Tool Categories filter, Files + Storage Overview. PdfToolbox
  refactored to export PDF_TOOLS/ToolRunner so tiles launch the
  working local tools directly.
- CRM: redesign into a dashboard — KPI cards, customer overview
  chart, sales pipeline funnel, recent activity, top customers
  (derived from opportunities) and Tasks & Follow-ups (real
  crm.activities with toggle + add). Drag-and-drop pipeline kept
  behind a Dashboard/Pipeline toggle.
- Quoting: new "Create Quotation" builder — stepper, template
  carousel, quotation details, products table with per-line
  discount/tax, Import from Inventory, live preview, Save Draft +
  Saved Templates (localStorage), New Customer modal.
- Nav: add Quoting (/quoting); CRM desc updated.

Typecheck and production build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
Schema (supabase/schema.sql — idempotent, RLS owner-scoped, added to
the policy/trigger loop):
- quotations + quotation_items (header + per-line qty/rate/discount/tax)
- quotation_templates (saved custom templates)
- tool_runs (Tools recent-activity log)

API (src/lib/api.ts): new offline-first modules mirroring `billing`
- quotes: listDocs / getDoc / saveDoc / deleteDoc / setStatus
- quoteTemplates: list / create / remove
- toolRuns: list / log

Wiring:
- Quoting: Save Draft now persists via quotes.saveDoc (keeps the
  returned id for updates); Saved Templates read/write quoteTemplates.
  Dropped the localStorage shims.
- Tools: Recent Activity now reads/writes tool_runs (favorites stay
  device-local as a UI preference).

Note: schema.sql must be re-run in the Supabase SQL editor to
provision the new tables; the offline-first layer degrades gracefully
until then. Typecheck and build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
…uild

- Extract pure money math (lib/money.ts: invoiceTotals/quotationTotals)
  and page-range parsing (lib/ranges.ts); wire api.ts, Invoicing and
  Quoting to the single source of truth.
- Add Vitest + 15 unit tests covering VAT/discount/total math and
  range parsing (the finance-critical logic).
- Add a React ErrorBoundary so a render fault no longer white-screens
  the desktop app.
- Vite manualChunks (react / charts / pdf) — resolves the oversized
  bundle warning and splits load.
- GitHub Actions CI: typecheck + unit tests + production build on
  every push/PR touching filey-erp.
- package.json: add test / test:watch / typecheck scripts.

Typecheck, 15/15 tests, and production build all pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
auth.tsx writes profiles rows as { id, email, name, company, org_id }
but schema.sql defined `full_name` and no `org_id`, so profile
creation / ProfileSetup would fail on a fresh project with
"column does not exist". Rename profiles.full_name -> name, add
org_id, and update handle_new_user() accordingly.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
… row

Drop the storage usage card and the decorative bottom icon row from
the sidebar (neither was wired to anything). Nav now fills the
sidebar cleanly. Removes the unused StorageRing + icon imports.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
The content column lacked min-w-0, so wide tables/builders pushed the
layout past the viewport and clipped on the right. Add min-w-0 to the
content column and main, make main overflow-auto, and clamp the root
with w-full overflow-hidden so wide pages scroll within the content
area instead of overflowing the app.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
Remove the forced min-w on every data table (shared DataTable, CRM
top-customers, Invoicing & Quoting line items) so they flow to the
content width instead of forcing a 560–640px floor that caused
left/right scrolling. Tighten the Invoicing/Quoting two-pane grid
(preview column 340–440px) so the form side has room to fit.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
Add a VAT Yes/No toggle to the Invoicing and Quoting builders.
- Yes: current behaviour (invoice 5% default & editable rate;
  quotation per-line tax).
- No: zero VAT — the tax rate/column, the VAT summary line, and the
  VAT column in the live preview are all hidden, and the Invoicing
  "TAX INVOICE" heading falls back to "INVOICE".
Quotations persist line tax as 0 when VAT is off.

Typecheck, 15/15 tests, and build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
Settings (mockup parity):
- Left sub-nav (Company Details, Account & Profile, Users & Roles,
  Preferences, Billing, Security, Notifications, Integrations,
  Backup, Activity Log) + right Account Management panel.
- Company Details: logo, name, business type, TRN, address/city/zip,
  phone, email, website, currency + Tax Information (tax type, VAT
  number, default tax rate). Saved via billing.saveCompany.
- Account & Profile (edit name/company), Users & Roles, Activity Log
  wired to real data; working Change Password (supabase.auth);
  remaining sections are clearly-labelled placeholders.

Auto-fill: invoices & quotations now pull currency and default tax
rate from the saved company, so the user only enters customer +
products. CompanyProfile extended (+business_type, city, zip,
vat_number, tax_type, website, currency, default_tax_rate) with
idempotent additive schema ALTERs.

Input polish: hide number-input spinners app-wide; zero-default
numeric fields now show empty with a "0" placeholder instead of a
literal 0; invoice Due Date is now optional (empty by default,
sanitised to NULL on save).

Typecheck, 15/15 tests, build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
Rebuild the Settings → Account & Profile section to match the design:
- Profile Information: avatar (upload + edit), Full Name, Email
  (read-only), Phone, Role + Save Changes (persists via profile).
- Login Credentials: login email with Verified/Unverified badge +
  Change Email (Supabase updateUser), Username + Change Username.
  Connected Accounts shown but honestly marked "OAuth not configured".
- Preferences: Language / Timezone / Date & Time format + Save
  (persisted on the profile).
- Change Password card: current + new + confirm with show/hide eyes
  and a live rules checklist; verifies the current password via
  re-auth before calling updateUser.

Profile model + schema extended (idempotent ALTERs): phone, role,
username, avatar, language, timezone, date_format, time_format.
PwInput hoisted to module scope to avoid focus loss.

Typecheck, 15/15 tests, build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
…tests

Release & verification:
- Cross-platform release workflow (.github/workflows/filey-erp-release.yml):
  macOS/Windows/Linux `tauri build` via tauri-action on tag
  `filey-erp-v*` or manual dispatch; typecheck+tests gate the build;
  uploads installers as artifacts and a draft GitHub release; wired
  for optional Apple/updater signing secrets.
- Tauri prod hardening: real CSP (replaces csp:null) allowing only
  self + Supabase + Google Fonts + blob workers; bundle metadata
  (productName, publisher, category, descriptions, copyright).
- Component-test harness (vitest + jsdom + Testing Library):
  ErrorBoundary fallback and ui statusTone/Badge/Delta tests.
  Suite now 22 tests across 5 files.

Typecheck, 22/22 tests, production build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
- Module registry (src/modules/registry.tsx): every screen is a
  self-contained module with a manifest (id, label, icon, route,
  element, core flag).
- ModulesProvider/useModules (src/lib/modules.tsx): per-user
  enable/disable persisted in app_settings ("modules.disabled");
  core modules (Overview, Settings) always on.
- App routes + sidebar nav are now generated from enabled modules;
  disabled non-core routes render a "module disabled" panel.
- Settings → "Apps & Modules": toggle modules on/off (live).
- Open-sourced under the MIT License (filey-erp/LICENSE).
- Removed the old static lib/apps.ts (superseded by the registry).

Typecheck, 22/22 tests, production build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
Replace the Tauri starter README with a proper project README:
overview, features, tech stack, Supabase quick-start, desktop build,
module system, scripts, honest status/roadmap, MIT license and
acknowledgements. Add CONTRIBUTING.md with setup, the CI checks
contributors must pass, and good first issues.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
…repo

Add filey-erp/.github/workflows/{ci,release}.yml configured for
filey-erp at the repo root, so they travel with the project when it
is extracted into its own public repository. (GitHub ignores nested
.github in the monorepo; the existing root workflows still cover the
monorepo.)

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
Schema (idempotent, backward-compatible):
- organizations + org_members tables; current_org() and
  is_org_admin() SECURITY DEFINER helpers (no RLS recursion).
- Every business table gains org_id (default current_org()); RLS
  switched from per-user to per-org (org_id = current_org()).
  Pre-existing single-user data backfills to the 'default' org and
  keeps working unchanged.
- handle_new_user now provisions a personal organization + owner
  membership per signup, so new tenants are isolated by default.
- profiles: added per-org read policy so teammates are visible.

App:
- auth Profile gains org_id; createProfile no longer clobbers it.
- api `org` module: get / members / create / join / setRole / remove.
- Settings → Users & Roles rebuilt as Organization management:
  workspace + copyable join code, create/join org, members table
  with role changes & removal (owner/admin only).

Security-sensitive RLS rewrite — must re-run schema.sql and verify
multi-account isolation before production. Typecheck, 22/22 tests,
build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
Add two functional-spine modules, both using the design system
(MetricCard / DataTable / PageHeader / cards) and wired to the
existing hr & fin APIs (no new tables needed):

- People (/people): headcount/present/on-leave/payroll KPIs,
  employee list with status toggle, Add Employee modal.
- Accounting (/accounting): net profit/revenue/expenses/cash KPIs,
  Journal entries + Chart of Accounts tabs, New Account & Journal
  Entry modals.

Registered in the module registry with line icons (Contact,
Landmark), so they appear automatically in the left sidebar (every
nav item shows its icon) and as routes; toggleable from
Settings → Apps & Modules.

Typecheck, 22/22 tests, build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
Replace the Placeholder stub with real panels (design-system styled):

- Preferences: document defaults (currency/template/tax from company)
  + persisted app prefs (rows per page, KPI indicators) via
  app_settings.
- Notifications: low-stock / new-order / quote / weekly toggles,
  persisted via app_settings (honest note: delivery needs an email
  integration).
- Billing & Subscription: self-hosted/MIT plan card + real usage
  counts (products, orders, quotations, invoices, customers).
- Integrations: live status — Supabase (configured host), Local PDF
  Tools (on-device), Email/Webhooks (not configured).
- Backup & Restore: working JSON export of company + products +
  orders + invoices + quotations + customers + expenses; restore
  guidance.

No Settings section is a placeholder anymore. Typecheck, 22/22
tests, build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
The offline read-cache keyed data by a global key (e.g. "erp_products"),
so on a shared device data from one org could briefly surface in
another after switching/joining an org. Namespace every cached read
by the active org (setCacheOrg), updated from auth on login, profile
load, org switch and sign-out. Closes the multi-tenancy cache-bleed
gap flagged in review.

Typecheck, 22/22 tests, build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
…mpose

Desktop (Rust): new send_email Tauri command via lettre (rustls,
no native-tls) for Gmail App Password SMTP; AppError::Email variant;
registered in lib.rs.

Frontend:
- lib/email.ts: config load/save (on-device only), desktop guard,
  sendEmail bridge, branded HTML shell.
- Settings → Email: connection form (from name, Gmail address, app
  password, host/port), Save, Send test, and Compose & send. Honest
  notes (App Password required, desktop-only, stored locally).
- Invoicing "Save & Send" now emails the customer an invoice
  summary; Quoting gains an "Email" action for quotations.

Rust SMTP path is unverified in this environment (Tauri build needs
OS WebKit/GTK libs); frontend typecheck, 22/22 tests and build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
Add reusable OrdersStatCard (vivid solid-yellow KPI card with stacked
value/label rows and a mini bar-chart flourish) and StockBreakdownCard
(orange gradient card with dot legend + a yellow number badge and a
soft dot pattern) to the design system, and use them on the Overview
for the Orders and Stock cards — matching the design.md card mockup.

Typecheck, 22/22 tests, build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
The Invoicing live preview rendered a fixed 760px sheet at zoom 100,
overflowing the ~440px preview pane and forcing horizontal scroll.
New FitPreview component measures the column and content, scales the
sheet to fit the available width by default (zoom multiplies on top),
and reserves correctly-sized layout space so there's no overflow or
gap. Vertical scroll still works for long invoices.

Typecheck, 22/22 tests, build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
The non-functional sidebar storage widget + quick-access icon row were
already removed from Layout earlier. Remove the last illustrative
storage bits too: the Tools page "Storage Overview" card (fake GB
usage + Upgrade button) and the Overview "Storage Used" KPI — there
is no storage quota (data lives in the user's Supabase). Overview now
shows a real "Inventory Value" KPI instead; Files spans full width.

Typecheck, 22/22 tests, build pass.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
Delete filey-erp/bot/ (telegram-claude-bot.mjs + its package files) —
it's unrelated to the ERP and shouldn't ship in the open-source repo.
No app/code references it; typecheck and build unaffected.

https://claude.ai/code/session_01LLjcT1pnqTCQPBAawiGyvM
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.

2 participants