diff --git a/.dockerignore b/.dockerignore index e65974b3..610f3fda 100644 --- a/.dockerignore +++ b/.dockerignore @@ -53,3 +53,6 @@ frontend/node_modules # Rebuilt from source in the builder stage dist/ + +# Design-Kit submodule: only used by `npm run tokens:sync`, never by builds. +design-kit/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..3a61fb8f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "design-kit"] + path = design-kit + url = https://github.com/SpaceWorks-Labs/Design-Kit.git + shallow = true diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..f1c8f6b0 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22.18 diff --git a/AGENTS.md b/AGENTS.md index ec6ba63e..539a6ffb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -53,6 +53,7 @@ Tenancy is strict: `Workspace` is the tenant boundary. | `Dockerfile`, `compose.production.yml`, `docker/vps/`, `install.sh` | Container image and the single-VPS stack (see `docs/DEPLOYMENT_VPS.md`) | | `charts/`, `render.yaml`, `.do/`, `deploy/cloudflare-cron/` | Kubernetes, Render, DigitalOcean and the cron Worker (`docs/DEPLOYMENT_*.md`) | | `tests/unit`, `tests/integration`, `tests/e2e` | Vitest unit, PostgreSQL integration (`*.db.test.ts`), Playwright | +| `design-kit/` | Git submodule (SpaceWorks-Labs/Design-Kit): source of truth for tokens and fonts; `npm run tokens:sync` regenerates `app/styles/palette.css`, `motion.css`, the token fixture and `public/brand/fonts`. Never needed by builds or CI | | `docs/` | `DESIGN.md` (brand and UI), `ARCHITECTURE.md` (services and flows), `ROADMAP-BUILD.md` (area ownership for parallel builds) | `prisma/schema.prisma` is authoritative for the data model. It already holds @@ -112,7 +113,8 @@ messaging + notification routing). Read it before adding anything. Follow [docs/DESIGN.md](docs/DESIGN.md). Colours come only from tokens (`app/styles/tokens.css` mapped in `app/globals.css`): `bg-canvas`, `bg-panel`, `bg-primary`, `bg-sidebar`, `sw-*` brand colours, etc. Never -hard-code hex in components. Gilroy everywhere; Unbounded (`font-accent`) only +hard-code hex in components. Outfit for text, Gilroy ExtraBold only for display +headings; Unbounded (`font-accent`) only for one accent phrase on auth/empty-state heroes, never in app chrome. Teal primary actions, Workshop Orange only as a fill with an ink label (and never in the app chrome as a button), Citron text-only sidebar with a teal active @@ -171,6 +173,20 @@ navigation config), `lib/instanceSettings.ts` (`getAssistantSettings`, `lib/search/documents.ts`, `lib/activity.ts`, `lib/teamAccess.ts` and `lib/scheduled/.ts` (periodic jobs). +Tasks: every task write (app, assistant, MCP, REST) goes through +`lib/tasks/service` and its single gate `loadEditableTask(actor, id, { action })` +with the rules in `lib/tasks/capabilities.ts` (`restrictTaskEdits`, claim, +unclaim). Assignment changes use `assignTask` / `unassignTask` / `claimTask` / +`unclaimTask` / `setAssignees` (row lock, real diffs only); never write +`TaskAssignee` directly. Assistant and API callers build the actor with +`principalToActor` (`lib/assistant/tools/tasks/actor.ts`) so history records +the source. + +Design tokens: never edit `app/styles/palette.css`, `motion.css` or +`tests/fixtures/design-tokens.json` by hand; update the `design-kit` submodule +(`git submodule update --init --depth 1 design-kit`) and run +`npm run tokens:sync`. + Parallel builds: [docs/ROADMAP-BUILD.md](docs/ROADMAP-BUILD.md) lists, per area, the routes, models and helpers it owns and the shared core nobody else edits. @@ -186,6 +202,13 @@ npm run test:integration # wipes data in TEST_DATABASE_URL npm run build ``` +`npm run typecheck` needs `NODE_OPTIONS=--max-old-space-size=8192` on Node 26. +Local Playwright runs (`npx playwright test`) need `AUTH_URL=http://127.0.0.1:3100` +(the e2e server's origin); the first logins against a cold dev server can flake, +so use `--retries=2` like CI. +The files integration test needs local Silo: `docker compose up -d --wait silo silo-init` +(creates the `sww-dev` and `sww-docsfiles` buckets). + Run lint, typecheck and unit tests before every hand-off, integration tests for data or permission changes, and a build at least once per phase. Report anything you did not run. diff --git a/CHANGELOG.md b/CHANGELOG.md index c7475707..042f3178 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,43 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Tasks: one-click **Assign to me** / **Unassign me** on cards, the task drawer (`i`) and list rows; the assignee picker lists you first. +- Tasks: per-project **Restrict task edits** (creator, assignees, project owner and admins edit; any member can still take an unassigned task; comments stay open). +- Tasks: assignment history records who assigned whom; people removed from a task are notified (`task.unassigned`). +- Tasks: per-project task types (icon, tone, default) with a type filter and type chips on cards and list rows. +- Tasks: move a task (with its subtasks) to another project; old links redirect to the new key. +- My Tasks tabs: Assigned to me, Assigned by me, My team (direct reports) and Created by me, with a quick add that assigns to you. +- List view: inline editing of status, priority, assignees and due date, and bulk edit of up to 50 tasks with per-task results. +- Board: accessible drag and drop (pointer, touch and keyboard with screen-reader announcements), a per-card "Move to…" menu, rapid quick add and the `c` shortcut; each project remembers its view and filters. +- Activity entries show where a change came from (web, assistant, MCP or API). +- MCP tools `sw_add_comment`, `sw_archive_task`, `sw_move_task` (columns or another project), `sw_assign_task` and `sw_claim_task`; `sw_create_task` / `sw_update_task` accept `type` and `assignees`. +- REST: `POST /api/v1/tasks/{ref}/comments|assignees|archive|move|transfer` and `POST`/`DELETE /api/v1/tasks/{ref}/claim`. +- Design-Kit is a git submodule (`design-kit/`); `npm run tokens:sync` regenerates the palette, motion tokens, token fixture and brand fonts. +- `npm run loc` and the codebase audit in `docs/AUDIT-2026-11.md`; new light and dark README banners. +- Collapsible groups everywhere: sidebar groups, list-view groups, board columns and My Tasks sections, each remembered per browser. +- Loading skeletons for every major page, a route progress bar, and token-driven motion for dialogs, drawers, menus, toasts, cards and rows (off under reduced motion). +- Project task lists and My Tasks in the README screenshots. + +### Changed + +- Design tokens follow Design-Kit 0.12.0: solid-black dark palette, scrim overlay and motion tokens (durations, easing, reduced motion). +- Typography follows Design-Kit: Outfit for body and UI, Gilroy ExtraBold for display headings, Unbounded for one accent phrase. PDFs use Gilroy Light and ExtraBold. +- MCP/REST task writes now go through the same services as the app (archived projects reject writes, disabled members can't be assigned, tasks keep board order, dates use the workspace time zone, completing unblocks dependants). +- README, docs index, CONTRIBUTING and package READMEs rewritten; Node is pinned to 22.18 or newer (`engines`, `.nvmrc`). +- Sidebar regrouped around daily work: personal items first, then Work, Chat, Knowledge, Community and People; Operations, Support & IT, Outreach, Finance, Settings and Preferences collapse by default. Clearer labels (Organisation, Companies, Blockers, Notification rules, Volunteer hours, Official documents). +- Task filters ordered by use with view options separated; project tabs put Board and Timeline together; project settings grouped into Basics, Ownership and Task rules. +- Light mode is the default; the sidebar shows "Workspace" under the Space Works lockup; Inbox and the top-bar notifications are icons. + +### Fixed + +- Concurrent assignee edits no longer overwrite each other (assignments lock the task and apply only real changes). + +### Removed + +- Unlicensed Gilroy Regular, Medium, SemiBold and Bold font files. + ## [0.6.7] - 2026-10-29 ### Fixed diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 371def4a..5308b04e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,26 +22,48 @@ a fix before disclosing. ## Local setup +Use Node.js 22.18 or newer (`.nvmrc` pins major 22), npm and Docker. + ```bash -npm install -docker compose up -d # PostgreSQL, Redis, Silo and Mailpit -cp .env.example .env # fill in AUTH_SECRET and the encryption keys -npm run storage:init # create the private bucket -npm run db:migrate -npm run dev # then open /setup +git clone --recurse-submodules https://github.com/SpaceWorks-Labs/SpaceWorks-Workspace.git +cd SpaceWorks-Workspace +npm ci +cp .env.example .env # fill in AUTH_SECRET and the encryption keys +docker compose up -d --wait # PostgreSQL, Redis, Silo and Mailpit +npm run db:deploy +npm run storage:init # create the private bucket +DEMO_PASSWORD='choose-12-or-more-characters' npm run db:seed:demo +PORT=3290 npm run dev:stack # web, worker and beat; open http://localhost:3290 ``` +[docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) is the full guide. Without a seed, open `/setup` +to create the first workspace. Add a migration with `npm run db:migrate -- --name `. Never commit `.env` or real secrets. +The Design-Kit submodule in `design-kit/` is optional: builds use the generated +files that are already committed. Only when you change design tokens, run +`git submodule update --init --depth 1` and then `npm run tokens:sync` to +regenerate `app/styles/palette.css`, `app/styles/motion.css` and the token fixture. + ## Before opening a pull request -- Branch from `dev` as `feat/` (or `fix/`). +- Branch from `dev` as `feat/` (or `fix/`) and open the + pull request against `dev`. Only maintainers merge `dev` into `main`. - Follow the conventions in [AGENTS.md](AGENTS.md) and the design system in [docs/DESIGN.md](docs/DESIGN.md). -- Run `npm run lint`, `npm run typecheck`, `npm run test:unit`, and - `npm run test:integration` for data or permission changes. +- Keep every hand-written file (source, tests, scripts, CSS) at 300 lines or + fewer. Split by responsibility. Generated files, the Prisma schema, + migrations and lockfiles are exempt. +- Run `npm run lint`, `npm run typecheck` and `npm run test:unit`. Run + `npm run test:integration` against a disposable `TEST_DATABASE_URL` for data or + permission changes (`npm run db:test:prepare` applies migrations to it), and `npm run test:e2e` + for user-facing flows. - Every schema change ships a Prisma migration. +- Update the relevant docs and [CHANGELOG.md](CHANGELOG.md) with behaviour changes. - Write "Space Works" in copy; keep UI text short, warm and specific. +- Commit messages are one short line in conventional style, for example + `fix: stop assignment losing updates`, `docs(cli): document registry install` + or `chore(deps): bump next`. By contributing you agree that your contributions are licensed under the AGPL-3.0-or-later. diff --git a/NOTICE b/NOTICE index 487d51ff..4519f96b 100644 --- a/NOTICE +++ b/NOTICE @@ -13,6 +13,6 @@ design system (https://github.com/SpaceWorks-Labs/SpaceWorks-Design). Fonts in public/brand/fonts keep their own licences and are not covered by the AGPL (see public/brand/fonts/LICENSES): -- Gilroy, by Radomir Tinkov, used under its own licence. +- Gilroy (Light and ExtraBold only), by Radomir Tinkov, used under its free-font licence; Outfit and Unbounded under the SIL OFL 1.1. All from the Space Works Design-Kit. - Unbounded, Copyright 2022 The Unbounded Project Authors, licensed under the SIL Open Font License, Version 1.1. diff --git a/README.md b/README.md index 1e68ff76..abb53376 100644 --- a/README.md +++ b/README.md @@ -1,350 +1,188 @@ - Space Works Workspace. Make room. Build together. A private home for your community’s work. + Space Works Workspace. The self-hosted workspace for maker organisations: projects, chat, docs, finance, assistant and MCP.

+ Version 0.6.7 Licence: AGPL-3.0-or-later + Node 22.18 or newer Next.js 16 - Node 22 - Deploy with Docker + PostgreSQL 16 + Quality gate workflow status

- Host on a VPS · - Free cloud hosting · - Quick start · + Features · + Quick start · + Deploy · Documentation · - Contributing · - Credits + Contributing

-**Space Works Workspace is the free, open-source, self-hosted operations tool -for the team that runs an organisation.** Non-profits, NGOs, community offices, -makerspace operating teams and small startups plan work, run money, look after -people, keep governance in order and manage application secrets in one place. -It started with the Space Works maker community at TinkerSpace Kochi. Every -record, file and secret stays on infrastructure you control, with separate -workspaces, roles and an audit trail. +**Space Works Workspace is a free, open-source, self-hosted operations tool for +the team that runs a maker organisation, NGO or community office.** Plan work, +run the money, look after people, keep governance in order and manage +application secrets in one place, on infrastructure you control. -Member-facing work lives in the sibling apps: [Space Works](https://github.com/SpaceWorks-Labs/SpaceWorks) -for the makerspace itself, [Space Works Events](https://github.com/SpaceWorks-Labs/SpaceWorks-Events) -for events and tickets, and [Space Works Organization](https://github.com/SpaceWorks-Labs/SpaceWorks-Organization) -for memberships. +## Why -## What you can do +Small organisations stitch together a task tracker, a chat app, a document +store, a spreadsheet for money and a password manager, and then lose track of +who owns what. Space Works Workspace puts them in one tenant-isolated +application with roles, an audit trail and an AI assistant that works with the +same permissions as the person using it. Every record, file and secret stays on +your own server. It started with the Space Works maker community at TinkerSpace +Kochi. Member-facing work lives in sibling apps: +[Space Works](https://github.com/SpaceWorks-Labs/SpaceWorks), +[Events](https://github.com/SpaceWorks-Labs/SpaceWorks-Events) and +[Organization](https://github.com/SpaceWorks-Labs/SpaceWorks-Organization). -Simple tools with manual entry, grouped the way an operating team works. +## Features -### Work and projects +### Work -- Projects with kanban boards, a timeline, milestones, dependencies, blockers and weekly status updates. -- Tasks with assignees, priorities, subtasks, recurrence, checklists and short task links; printable project reports. -- Meetings with agendas, decisions and action items; goals, key results, polls and ideas. -- A team calendar with recurring meetings, invitations, RSVPs, Google Calendar sync and Google Meet links. +- **Projects** with kanban boards, timeline and report views, milestones, cycles and weekly status updates. +- **Tasks** with subtasks, dependencies, labels, recurrence, attachments, mentions and per-project task types; move a task to another project at any time. + - Multiple assignees, one-click **Assign to me** and **Unassign me** on cards and in the drawer (shortcut `i`), and an assignment history that shows who assigned whom. + - **My Tasks** tabs: Assigned to me, Assigned by me, My team and Created by me. + - A **list view** with inline editing and bulk edit of up to 50 tasks. + - A per-project **Restrict task edits** switch limits edits to the creator, assignees, project owner and admins. + - An accessible drag-and-drop board (keyboard and touch) with a **Move to...** menu, and notifications when you are assigned or unassigned. +- **Docs** with revisions, review reminders and controlled access; private **files** with versions. +- **Chat** with channels, direct messages, threads, reactions and mentions, plus a team calendar, meetings, goals, polls and ideas. -### Chat and knowledge +### Operations -- Channels, direct messages, threads, reactions, mentions and live updates. -- Rich-text docs with revisions, SOP review reminders and controlled access; private files with versions in Silo. -- Global search and a command palette that only show what each member can open. +- **Finance**: income and expenses, funds, budgets, supplier bills, purchase requests with approvals, reimbursements, rent and recurring costs, remittances, payroll records, funding and donor receipts. +- **People**: profiles, org chart, onboarding, skills, leave, attendance, hiring, rota and a confidential help desk. **Governance**: compliance calendar, board packs, registers and safeguarding cases. +- **Analytics**: one report desk across money, people, work and operations, with drill-down, CSV export and printable packs. +- **Monitoring**: HTTP, TCP, DNS, TLS and heartbeat checks, incidents, on-call and public status pages. +- **Social** analytics and comments, app store reviews, and **SEO** (Search Console metrics and page audits). -### People and organisation +### Intelligence -- Member profiles, departments, reporting lines and an org chart; a responsibilities register with backups. -- Onboarding and offboarding, skills, training sign-offs, leave balances, attendance and volunteer hours. -- Hiring openings and candidates, rota and shift swaps, escalation paths, a confidential help desk and a safety log. +- **AI assistant** that can search and act in the workspace with the caller's permissions. +- **MCP server** at `/api/mcp` with OAuth or API-key scopes (`read:tasks`, `write:tasks` and more). Task tools include assign, claim, comment, move and archive. See [docs/MCP.md](docs/MCP.md). +- **REST API** at `/api/v1` for tasks, projects and more, with scoped tokens. See [docs/API.md](docs/API.md). -### Money +### Platform -- Income and expenses, funds and restricted funds, cost centres, budgets and month-end close. -- Supplier bills, purchase requests with approvals, reimbursements, receipt uploads and spend review. -- Rent, utilities and other recurring costs; PF, ESI, PT and TDS remittances; staff advances, loan EMIs and insurance premiums, all on one upcoming-dues list. -- Payroll records and disbursements, petty cash, deposits, depreciation and TDS registers. -- Funding: grants, CSR, donations, campaigns, pledges, donor receipts and impact reports. -- Documents: GST invoices and notes, receipts, 80G and utilisation certificates, and letters. +- OWNER, ADMIN, MEMBER and GUEST roles, strict workspace isolation and **private teams** that hide their projects, channels and files from non-members. +- **Notification channels**: in-app, email, WhatsApp, Telegram, Slack, Discord and Mattermost, sent by the background worker. +- Audit log, rate limits, CSP nonces, MFA, session revocation and optional Google/OIDC sign-in. +- **Secrets**: envelope encryption, version history, audited reveal and machine identities, with the `sww` command line ([Secrets CLI](#secrets-cli)). -### Governance +See the [area guides](docs/README.md#feature-areas) for contracts and limits. -- A compliance calendar, board meetings and resolutions, vendors and contracts. -- Insurance and statutory registers, risks and drills, conflict-of-interest links and frozen board packs. -- Restricted safeguarding and POSH cases with explicit case access. - -### Product, marketing and IT - -- A roadmap, releases with approvals, an issue and QA tracker, prototype tests and a change log. -- BOM cost estimates for funding proposals, with GST, contingency and a printable budget sheet. -- A content calendar, a brand asset library, and proposals and outreach with follow-ups. -- Device and licence registers, a security incident log, access reviews and restore-test records. - -### Secrets - -- Application secrets by project, environment and folder, in the spirit of [Infisical](https://github.com/Infisical/infisical). -- Envelope encryption under a rotatable root key, version history, snapshots and point-in-time rollback. -- Masked values with audited reveal and copy, fresh-MFA access to production and change approvals. -- Machine identities with short-lived access tokens, one-time share links and a security overview. -- The `sww` command line and Node SDK, installed with npm from GitHub Packages (see [Secrets CLI](#secrets-cli)). - -### Reports and analytics - -- One report desk across money, funding, people, work and operations, with period comparisons. -- Drill-down from every number, CSV exports, a cash-flow forecast and printable management and board packs. - -### Services, alerts and integrations - -- HTTP, TCP, DNS, TLS and heartbeat checks; incidents, maintenance, on-call and public status pages. -- Cloud accounts and costs for DigitalOcean, AWS, Vercel, Contabo and other providers. -- Reminders and alerts by email, WhatsApp, Telegram, Slack, Discord and Mattermost, sent by the background worker. -- Social analytics and comments, app store reviews, GitHub, and the Space Works Assistant. -- A private notepad with to-dos for every member. - -### Run it safely - -- Strict workspace isolation and OWNER, ADMIN, MEMBER and GUEST roles. -- Invite-only membership, password and optional Google/OIDC sign-in, MFA and session revocation. -- Audit, rate limits, CSP nonces and private object storage in Silo. -- Background jobs on a BullMQ worker and beat, two release images, guided VPS operations and encrypted off-site backups. - -See the [area guides](docs/README.md#feature-areas) for implemented contracts and limits. - -## A look around +## Screenshots Taken on the seeded demo workspace with `scripts/capture-readme-screens.mjs`. - + - - - - - - + + - - + + - - + + - - - - - - - - - +
My day in Space Works Workspace

My day. Tasks, meetings, dues and recent activity in one place.

My day in Space Works Workspace

My day. Tasks, meetings, dues and activity.

Project board in Space Works Workspace

Project board. Milestones, blockers and the next build.

Calendar in Space Works Workspace

Calendar. Meetings, deadlines and Google Meet links together.

Chat in Space Works Workspace

Chat. Channels, threads and the team’s conversations.

Docs in Space Works Workspace

Docs. SOPs and shared knowledge with history and controlled access.

Notepad in Space Works Workspace

Notepad. Your private notes and to-dos.

My tasks in Space Works Workspace

My tasks. Assigned to me, assigned by me, my team and created by me.

Project task list in Space Works Workspace

Task list. Inline editing, grouping and bulk edit.

Finance, dark mode in Space Works Workspace

Finance, dark mode. Funds, bills and recent spending.

Upcoming dues in Space Works Workspace

Upcoming dues. Rent, utilities, remittances, EMIs and premiums on one list.

Chat in Space Works Workspace

Chat. Channels, threads and conversations.

Docs in Space Works Workspace

Docs. SOPs with history and controlled access.

Funding in Space Works Workspace

Funding. Grants, CSR, donations and the reports funders expect.

Reports in Space Works Workspace

Reports. Period comparisons, drill-downs and board packs.

Finance in dark mode in Space Works Workspace

Finance, dark mode. Funds, bills and spending.

Reports in Space Works Workspace

Reports. Comparisons, drill-downs and board packs.

Secrets in Space Works Workspace

Secrets. Environments, masked values and audited reveal.

BOM estimates in Space Works Workspace

BOM estimates. Cost a project for a funding proposal.

Governance in Space Works Workspace

Governance. Compliance dates, board decisions and registers.

Organisation in Space Works Workspace

Organisation. Departments, reporting lines and responsibilities.

Services in Space Works Workspace

Services. Checks, incidents and uptime in one place.

Help desk in Space Works Workspace

Help desk. Internal requests with owners, targets and confidential handling.

Governance in Space Works Workspace

Governance. Compliance dates, decisions and registers.

-## Secrets CLI - -Install Node 20 or newer. GitHub Packages is the primary registry for the `sww` -command line and Node SDK. Authenticate first, then install the package: - -```bash -npm login --scope=@spaceworks-labs --auth-type=legacy --registry=https://npm.pkg.github.com -npm install --global @spaceworks-labs/workspace-cli -``` - -At the prompts, enter your GitHub username and a personal access token -(classic) with `read:packages` as the password. Authorize the token for your -organization's SSO if required. Enter it only at the prompt, not in a command -argument or a committed file. GitHub Packages requires authentication even for -public packages; see [GitHub's npm registry guide](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry). - -Then link a repository and run your app with its secrets injected: - -```bash -sww login --host https://workspace.example.org -sww init --project PROJECT_ID --env dev -sww run --env dev -- npm run dev -``` +## Quick start -Export a file when you need one (production needs a fresh MFA code), or log -in as a machine identity in CI: +Requires Node.js 22.18 or newer and Docker. The development Compose file provides +PostgreSQL 16, Redis 7, private Silo storage and Mailpit for captured email. ```bash -sww export --env production --format dotenv --mfa 123456 > .env -export SWW_TOKEN="$(sww login --method=universal-auth --client-id "$CLIENT_ID" --client-secret "$CLIENT_SECRET" --plain --silent)" -sww scan --staged +git clone --recurse-submodules https://github.com/SpaceWorks-Labs/SpaceWorks-Workspace.git +cd SpaceWorks-Workspace +npm ci +cp .env.example .env +docker compose up -d --wait +npm run db:deploy +npm run storage:init +DEMO_PASSWORD='choose-12-or-more-characters' npm run db:seed:demo +PORT=3290 npm run dev:stack ``` -Main releases automatically publish the CLI to GitHub Packages at the same -base version as the images. Publishing to npmjs.com is optional and requires -the repository's `NPM_TOKEN` secret. A bare install against the default public -npm registry can return 404 when that optional publication is not configured; -use the authenticated GitHub Packages flow above. - -The [CLI guide](packages/cli/README.md) covers the SDK, keychain storage and -secret scanning. - -## Host it on a VPS with Docker - -**Yes — the complete application runs on your own VPS, installed with one line.** -It ships as a **backend** image (the API, which also runs the -database migrations and operator tools) and a **frontend** image (the website). -The production Docker Compose stack runs them with **PostgreSQL 16**, -**Redis 7**, private **[Silo](https://github.com/pgsty/silo)** object storage (the -maintained, S3-compatible fork of the archived MinIO) for private documents and files, -automatic public HTTPS with Caddy, database migrations, a BullMQ worker and -beat for scheduled jobs. Only a domain and an authenticated SMTP relay are external; Render, -Supabase, Upstash and Cloudflare are optional hosting choices. +The `design-kit/` submodule is optional: builds use the generated files that are +committed, so a plain `git clone` works too. Set `AUTH_URL` and +`NEXT_PUBLIC_BASE_URL` to `http://localhost:3290`, open it and sign in as +`owner@tinkerspace.test` with your demo password. Captured email is at +`http://localhost:8025`. Without a seed, open `/setup` to create the first +workspace. Details, including PowerShell and `local.sh`, are in +[Local development](docs/DEVELOPMENT.md). -### Install in one line +## Deploy -On a 64-bit Linux server (Ubuntu/Debian, Fedora/RHEL/Alma/Rocky, Arch or openSUSE), -as root or a user with `sudo`: +On a 64-bit Linux VPS the installer asks every question first and changes +nothing until you confirm. It sets up Docker, generates secrets, pulls the +release images and runs migrations, with updates, rollback, encrypted backups +and recovery in the same menu: ```bash curl -fsSL https://raw.githubusercontent.com/SpaceWorks-Labs/SpaceWorks-Workspace/main/install.sh | bash ``` -It checks the server, picks the latest [release](https://github.com/SpaceWorks-Labs/SpaceWorks-Workspace/releases) -and asks every question first: the layout (by default the website and API -containers both on this VPS, at `workspace.example.com` and `api.workspace.example.com`; -or one app container on one hostname; or the website on Netlify), hostnames, the -super-admin email, HTTPS (automatic Let's Encrypt, a LAN/trial certificate, or -your existing reverse proxy), file storage (bundled Silo or an external S3/R2 -bucket), your SMTP relay (Brevo is prefilled on port 2525) and whether to set up -automatic deploys. Invalid answers are asked again. One summary lists every choice and host -change, and **nothing changes until you confirm it**. Then it installs Docker if -needed, generates every secret and internal TLS certificate without printing them, -downloads the release's ready-made images from -[GitHub Packages](docs/CONTAINER_IMAGES.md) (amd64 and arm64), migrates and -checks that each service is healthy. The application images are prebuilt; the -bundled standard Caddy edge is compiled locally from pinned source with patched -Go and dependencies. An existing reverse proxy skips that build. - -**Before you start:** 2 vCPU, 4 GB RAM with swap available and 30 GB SSD as a -starting estimate for the bundled edge and a small instance, DNS A -records pointing at the server (two for the default layout), inbound ports 80 and 443, an SMTP -relay on a verified sending domain, and your super-admin email. - -### Update, back up and check - -Run the same command again. An existing installation shows a menu: - -1. **Update to the latest release** — backs up the database and configuration, - downloads the new images while the site keeps running, migrates and restarts. If - the new release is not healthy, the previous one is restored automatically. -2. **Back up now** — database, configuration and uploaded files, into - `/etc/spaceworks-workspace/backups/`. -3. **Check status and health** — services, disk, newest backup and live checks. -4. **Backups** — nightly schedule, retention, encryption to a key you keep off the - server (`age`), and copies to an off-site S3 bucket. Check backup freshness from the installer status command. -5. **Change settings** — hostnames, outgoing email (SMTP) or bucket credentials; - rolled back automatically if the checks fail. -6. **Server security** — a firewall allowing only SSH, HTTP and HTTPS, automatic - security updates and fail2ban. -7. **Automatic deploys** — install (or remove) a GitHub Actions runner so every - published release updates the server by itself, when each release is published. -8. **Recover super-admin access** — for a lost authenticator or password: resets - MFA and prints a one-hour reset link. -9. **Support bundle** — checks and recent logs with secrets redacted. -10. **Uninstall** — keeps the data, secrets and backups unless you type `DELETE DATA`. - -`0` (the default) cancels without changing anything. - -The internal service certificates renew themselves before they expire (a weekly -systemd check), and setup asks about backups and hardening up front. - -Releases live in `/opt/spaceworks-workspace/releases/` with `current` pointing -at the running one; secrets stay in `/etc/spaceworks-workspace`. Options: `--release` -for a specific release, `--ref` to build a branch or commit from source (needs -4 GB of memory), `--repo` for a fork, `--dir` for another location and `--update` -to skip the menu; `bash install.sh --help` lists them. A new release is published -by the first `main` build of each new `VERSION`. A restore is a -deliberate step: `sudo bash /opt/spaceworks-workspace/current/scripts/vps-restore.sh `. - -The installer does not change DNS or provision SMTP. The -**[complete VPS guide](docs/DEPLOYMENT_VPS.md)** covers manual -installation from a checkout, updates, rollback, backups and restores, internal -certificate renewal and monitoring. Use `compose.production.yml`; the development -and staging Compose files are not production setups. - -### Netlify + VPS - -Choose **3** in the installer to render the shared Next.js UI on Netlify while -authentication, tenant data, files, jobs and actions stay on the VPS. Browser -APIs use the frontend origin; authenticated realtime streams go directly to the -backend with short-lived, one-use tickets. The default VPS layout uses the same -`frontend/` workspace in a container. - -Copy the generated `frontend.env` values to Netlify, set **Package directory = -frontend**, keep **Base directory = repository root**, and use -`frontend/netlify.toml`. Deploy the same source revision on both hosts. The -frontend holds only URLs, a private gateway credential and its own action key. -Follow [Netlify + VPS](docs/DEPLOYMENT_SPLIT.md). - -Private repositories and packages can use `SWW_GITHUB_TOKEN`; public installs -need nothing. See [private installs](docs/DEPLOYMENT_VPS.md#private-repositories-and-packages). - -## Cloud hosting - -The [Render Blueprint](render.yaml) runs web, worker and beat on paid compute, -with managed PostgreSQL, persistent native Redis and private object storage. -A free web plan needs an independently hosted worker; Cloudflare cron can -replace beat by calling the two enqueue endpoints every minute. Worker handles -email, notifications, scheduled jobs, syncs and monitor checks. - -```mermaid -flowchart LR - browser([Browser]) --> app["Render · Next.js 16"] - app --> db[(PostgreSQL)] - app --> redis[(Redis)] - beat[Beat] --> redis - redis --> worker[Worker] - worker --> db - worker --> storage[Private objects] - worker --> mail[SMTP] -``` +Prefer to read it first: download `install.sh`, review it, then run +`bash install.sh`. Needs 2 vCPU, 4 GB RAM, DNS records for the host names, ports +80 and 443, and an SMTP relay. -[Deploy to Render](https://render.com/deploy?repo=https://github.com/SpaceWorks-Labs/SpaceWorks-Workspace). -The [cloud guide](docs/DEPLOYMENT_CLOUD.md) covers secrets, TLS, SMTP, workers, -first-run setup and free-plan limits. [Jobs operations](docs/areas/jobs-queue.md) -covers retries, health and recovery. Docker, AWS, DigitalOcean and Kubernetes -remain supported alternatives. +| Target | Guide | +| --- | --- | +| VPS with Docker, Caddy HTTPS, worker and beat (recommended) | [DEPLOYMENT_VPS.md](docs/DEPLOYMENT_VPS.md) | +| Netlify frontend with a VPS backend | [DEPLOYMENT_SPLIT.md](docs/DEPLOYMENT_SPLIT.md) | +| Docker with managed PostgreSQL, Redis and storage | [DEPLOYMENT_DOCKER.md](docs/DEPLOYMENT_DOCKER.md) | +| Render, Supabase, Upstash, R2 and Cloudflare cron | [DEPLOYMENT_CLOUD.md](docs/DEPLOYMENT_CLOUD.md) ([Blueprint](render.yaml), [cron Worker](deploy/cloudflare-cron/README.md)) | +| AWS | [DEPLOYMENT_AWS.md](docs/DEPLOYMENT_AWS.md) | +| Kubernetes with Helm | [DEPLOYMENT_KUBERNETES.md](docs/DEPLOYMENT_KUBERNETES.md) ([chart](charts/spaceworks-workspace/README.md)) | +| DigitalOcean App Platform | [.do/app.yaml](.do/app.yaml) | +| Isolated staging | [DEPLOYMENT_STAGING.md](docs/DEPLOYMENT_STAGING.md) | + +Images and versions are explained in [CONTAINER_IMAGES.md](docs/CONTAINER_IMAGES.md); +shipping and running a release in [PRODUCTION_RELEASE.md](docs/PRODUCTION_RELEASE.md) +and [production-operations.md](docs/production-operations.md). -## Quick start (local) +## Secrets CLI -Use Node.js 22 and Docker. The development Compose file provides PostgreSQL 16, -persistent Redis 7, private Silo storage and Mailpit for captured local email. +The `sww` command line and Node SDK are published to GitHub Packages, which +requires authentication even for public packages. Use Node 20 or newer: ```bash -npm ci -cp .env.example .env -docker compose up -d --wait -npm run db:deploy -npm run storage:init -DEMO_PASSWORD='choose-12-or-more-characters' npm run db:seed:demo -PORT=3290 npm run dev:stack +npm login --scope=@spaceworks-labs --auth-type=legacy --registry=https://npm.pkg.github.com +npm install --global @spaceworks-labs/workspace-cli +sww login --host https://workspace.example.org +sww init --project PROJECT_ID --env dev +sww run --env dev -- npm run dev ``` -Set `AUTH_URL` and `NEXT_PUBLIC_BASE_URL` in your local configuration to -`http://localhost:3290`. Open that address and sign in as -`owner@tinkerspace.test` with your demo password. The seed creates a community -workspace and loads every module in `scripts/seed/`. The local supervisor starts -web, worker and beat together, stops siblings on failure and drains workers when -you stop it. Worker and beat health use separate loopback ports 3460 and 3461; -inspect email at `http://localhost:8025`. On PowerShell set `$env:PORT='3290'` -before `npm run dev:stack`. Local service checks refuse remote database, Redis, -storage and SMTP targets before local migrations run. See -[Local development](docs/DEVELOPMENT.md). +Enter a GitHub personal access token (classic) with `read:packages` only at the +password prompt. The [CLI guide](packages/cli/README.md) covers CI machine +identities, export, the SDK, keychain storage and secret scanning. ## Design system -Gilroy, flat cards, teal actions, a Citron sidebar and one bold accent moment. +The look comes from [Design-Kit](https://github.com/SpaceWorks-Labs/Design-Kit), +included as the shallow git submodule `design-kit/`. `npm run tokens:sync` +regenerates `app/styles/palette.css`, `app/styles/motion.css` and the token +fixture from it; the generated files are committed, so builds never need the +submodule. Type is Outfit for body and UI, Gilroy ExtraBold for display and one +Unbounded accent phrase. Light mode (Warm Cream) is the default; dark mode is solid black and one click away. | | Colour | Used for | | --- | --- | --- | @@ -352,39 +190,54 @@ Gilroy, flat cards, teal actions, a Citron sidebar and one bold accent moment. | | Warm Cream | Canvas and inverse labels | | | Maker Teal | Actions, links and focus | | | Workshop Orange | Accent fill with an ink label | -| | Citron | Sidebar and selection | -| | Sky Blue | Information | -| | Warm Yellow | Warnings | +| | Citron | Selection and highlights | + +Read [the design guide](docs/DESIGN.md). `npm run readme:art` regenerates the +banners (`docs/readme/banner*.svg` to 2x PNG) and swatches. -Read [the design guide](docs/DESIGN.md). Regenerate the banners and swatches with -`npm run readme:art`. Screenshots are captured by an operator with -`DEMO_PASSWORD=... node scripts/capture-readme-screens.mjs http://localhost:3290`. +## Architecture at a glance + +A Next.js 16 App Router application backed by PostgreSQL through Prisma. Pages +and Server Actions authenticate, then call business rules in `lib/`; every query +is scoped to a workspace and a role. Redis backs rate limits, realtime and the +BullMQ queue; a worker sends email and notifications and runs syncs, and beat +schedules recurring jobs. Files live in private S3-compatible storage (Silo). +The website can also render on Netlify through a private gateway. See +[ARCHITECTURE.md](docs/ARCHITECTURE.md). ## Documentation | Read this | When you want to | | --- | --- | -| [Documentation index](docs/README.md) | Find feature areas and engineering guides | -| [Architecture](docs/ARCHITECTURE.md) | Understand tenancy, services and background work | -| [Configuration](docs/CONFIGURATION.md) | Look up settings and secrets | -| [VPS deployment](docs/DEPLOYMENT_VPS.md) | Install, update, back up and recover | -| [Netlify + VPS](docs/DEPLOYMENT_SPLIT.md) | Split frontend rendering and backend services | -| [Container images](docs/CONTAINER_IMAGES.md) | Understand VERSION, tags and GitHub Packages | -| [Cloud deployment](docs/DEPLOYMENT_CLOUD.md) | Use managed services and free plans | -| [Release procedure](docs/PRODUCTION_RELEASE.md) and [operations](docs/production-operations.md) | Ship and run it | +| [Documentation index](docs/README.md) | Find area guides and engineering references | +| [Development](docs/DEVELOPMENT.md) and [Configuration](docs/CONFIGURATION.md) | Run it locally and look up settings | +| [MCP](docs/MCP.md) and [REST API](docs/API.md) | Connect AI clients and scripts | +| [Design](docs/DESIGN.md) | Follow the brand and UI rules | +| [Audit, November 2026](docs/AUDIT-2026-11.md) | See findings and open work | + +## Codebase size + +About 214,000 lines of hand-written source, tests, SQL and docs across about +2,600 tracked files. Run `npm run loc` for the current breakdown by language and +area; the [November 2026 audit](docs/AUDIT-2026-11.md#codebase-size) records the +numbers at that date. ## Contributing -Read [CONTRIBUTING.md](CONTRIBUTING.md), [AGENTS.md](AGENTS.md) and the area guide -before making a change. Features branch from `dev`; `main` is production. Include -validation and update the relevant docs with behavior changes. Keep tenant and -role checks on the server, and keep credentials out of issues and logs. +Read [CONTRIBUTING.md](CONTRIBUTING.md) and [AGENTS.md](AGENTS.md). Features +branch from `dev`; `main` is production. Keep every file at 300 lines or fewer, +tenant and role checks on the server, and credentials out of issues and logs. + +## Security -## Credits +There is no standalone policy file. Report vulnerabilities through GitHub's +private vulnerability reporting (Security, then Report a vulnerability), never +in a public issue; see [CONTRIBUTING.md](CONTRIBUTING.md#security-issues). +Operational hardening is covered in [production-operations.md](docs/production-operations.md). -Made by **Space Works**, a maker community that started inside TinkerSpace Kochi. -The Space Works brand, design and community guide the product. Thanks to the -maintainers of the open-source technologies it runs on. +## Licence -Licensed [AGPL-3.0-or-later](LICENSE). If you modify and host it, offer the matching -source to the people using your version. +Made by **Space Works**, a maker community that started inside TinkerSpace +Kochi. Licensed [AGPL-3.0-or-later](LICENSE): if you modify and host it, offer +the matching source to the people using your version. Third-party notices are in +[NOTICE](NOTICE). diff --git a/app/actions/myTasks.ts b/app/actions/myTasks.ts new file mode 100644 index 00000000..2c2aaf0a --- /dev/null +++ b/app/actions/myTasks.ts @@ -0,0 +1,14 @@ +"use server"; + +import { z } from "zod"; +import { getWorkspaceForAction } from "@/lib/permissions"; +import { parseMyTasksTab, type MyTaskItem } from "@/lib/tasks/myTasks"; +import { listMyTasks } from "@/lib/tasks/queries"; + +/** Loader for My Tasks tabs (switching tabs and realtime refetch). Reads only; mutations reuse app/actions/tasks.ts. */ +export async function loadMyTasksTabAction(slug: string, tab: string): Promise { + const parsed = z.string().min(1).max(64).safeParse(slug); + const ctx = parsed.success ? await getWorkspaceForAction(parsed.data, "GUEST") : null; + if (!ctx) return null; + return listMyTasks(ctx, new Date(), parseMyTasksTab(tab)); +} diff --git a/app/actions/taskAssign.ts b/app/actions/taskAssign.ts new file mode 100644 index 00000000..60fff973 --- /dev/null +++ b/app/actions/taskAssign.ts @@ -0,0 +1,40 @@ +"use server"; + +import { z } from "zod"; +import { isActionRateLimited } from "@/lib/actionRateLimit"; +import { actionError, NOT_ALLOWED, RATE_LIMITED, type ActionResult } from "@/lib/actionResult"; +import { getWorkspaceForAction } from "@/lib/permissions"; +import { assignTask, claimTask, unassignTask, unclaimTask } from "@/lib/tasks/service"; + +/** + * Assignment actions for the task panel, board cards and keyboard shortcut. + * Same pattern as app/actions/tasks.ts: resolve the workspace and membership + * server-side → rate limit → lib/tasks/service/assignments (permission is + * decided there, inside the transaction). Results carry the final assignee ids. + */ + +type Assigned = { assigneeIds: string[] }; + +async function mutate(slug: unknown, fn: (ctx: NonNullable>>) => Promise>): Promise> { + const parsed = z.string().min(1).max(64).safeParse(slug); + const ctx = parsed.success ? await getWorkspaceForAction(parsed.data, "GUEST") : null; + if (!ctx) return actionError(NOT_ALLOWED); + if (await isActionRateLimited("action", ctx.user.id)) return actionError(RATE_LIMITED); + return fn(ctx); +} + +export async function assignTaskAction(slug: string, input: unknown) { + return mutate(slug, (ctx) => assignTask(ctx, input)); +} + +export async function unassignTaskAction(slug: string, input: unknown) { + return mutate(slug, (ctx) => unassignTask(ctx, input)); +} + +export async function claimTaskAction(slug: string, input: unknown) { + return mutate(slug, (ctx) => claimTask(ctx, input)); +} + +export async function unclaimTaskAction(slug: string, input: unknown) { + return mutate(slug, (ctx) => unclaimTask(ctx, input)); +} diff --git a/app/actions/taskBulk.ts b/app/actions/taskBulk.ts new file mode 100644 index 00000000..8067d686 --- /dev/null +++ b/app/actions/taskBulk.ts @@ -0,0 +1,23 @@ +"use server"; + +import { z } from "zod"; +import { isActionRateLimited } from "@/lib/actionRateLimit"; +import { actionError, NOT_ALLOWED, RATE_LIMITED, type ActionResult } from "@/lib/actionResult"; +import { getWorkspaceForAction } from "@/lib/permissions"; +import { MAX_BULK, type BulkResult } from "@/lib/tasks/bulkSchemas"; +import { bulkUpdateTasks } from "@/lib/tasks/service"; + +/** + * Bulk edit from the list view. Same pattern as app/actions/tasks.ts, but the + * rate limit is weighted: a call over n tasks spends n units of the `bulk` + * bucket (one per task, clamped to 1..50) so 50 operations cannot slip past + * the per-action limit as a single request. + */ +export async function bulkUpdateTasksAction(slug: string, input: unknown): Promise> { + const parsed = z.string().min(1).max(64).safeParse(slug); + const ctx = parsed.success ? await getWorkspaceForAction(parsed.data, "GUEST") : null; + if (!ctx) return actionError(NOT_ALLOWED); + const count = Array.isArray((input as { taskIds?: unknown } | null)?.taskIds) ? (input as { taskIds: unknown[] }).taskIds.length : 1; + if (await isActionRateLimited("bulk", ctx.user.id, Math.min(Math.max(count, 1), MAX_BULK))) return actionError(RATE_LIMITED); + return bulkUpdateTasks(ctx, input); +} diff --git a/app/actions/taskTransfer.ts b/app/actions/taskTransfer.ts new file mode 100644 index 00000000..4bc156b2 --- /dev/null +++ b/app/actions/taskTransfer.ts @@ -0,0 +1,36 @@ +"use server"; + +import { z } from "zod"; +import { revalidatePath } from "@/lib/frontend/cache"; +import { isActionRateLimited } from "@/lib/actionRateLimit"; +import { actionError, NOT_ALLOWED, RATE_LIMITED, type ActionResult } from "@/lib/actionResult"; +import { getWorkspaceForAction } from "@/lib/permissions"; +import { listTransferTargets } from "@/lib/tasks/queries"; +import { previewTransfer, transferTask } from "@/lib/tasks/service"; +import type { TransferPreview } from "@/lib/tasks/service/transfer"; + +/** Moving a task to another project: picker data, confirmation preview, and the move itself. */ + +async function run(slug: unknown, fn: (ctx: NonNullable>>) => Promise>): Promise> { + const parsed = z.string().min(1).max(64).safeParse(slug); + const ctx = parsed.success ? await getWorkspaceForAction(parsed.data, "GUEST") : null; + if (!ctx) return actionError(NOT_ALLOWED); + if (await isActionRateLimited("action", ctx.user.id)) return actionError(RATE_LIMITED); + return fn(ctx); +} + +export async function listTransferTargetsAction(slug: string, excludeProjectId: string | null): Promise>> { + return run(slug, async (ctx) => ({ ok: true, data: await listTransferTargets(ctx, typeof excludeProjectId === "string" ? excludeProjectId : null) })); +} + +export async function previewTransferAction(slug: string, input: unknown): Promise> { + return run(slug, (ctx) => previewTransfer(ctx, input)); +} + +export async function transferTaskAction(slug: string, input: unknown) { + return run(slug, async (ctx) => { + const result = await transferTask(ctx, input); + if (result.ok) revalidatePath(`/w/${ctx.workspace.slug}/projects`, "layout"); + return result; + }); +} diff --git a/app/actions/taskTypes.ts b/app/actions/taskTypes.ts new file mode 100644 index 00000000..aa78dd05 --- /dev/null +++ b/app/actions/taskTypes.ts @@ -0,0 +1,40 @@ +"use server"; + +import { z } from "zod"; +import { isActionRateLimited } from "@/lib/actionRateLimit"; +import { actionError, NOT_ALLOWED, RATE_LIMITED, type ActionResult } from "@/lib/actionResult"; +import { getWorkspaceForAction } from "@/lib/permissions"; +import { createTaskType, deleteTaskType, listTaskTypes, reorderTaskTypes, setDefaultTaskType, updateTaskType } from "@/lib/tasks/service"; + +/** + * Per-project task types (project settings). Same pattern as app/actions/tasks.ts: + * workspace and membership from the slug server-side → rate limit → lib/tasks/service/types + * (manage rights, Zod, audit, realtime). + */ + +async function run(slug: unknown, fn: (ctx: NonNullable>>) => Promise>): Promise> { + const parsed = z.string().min(1).max(64).safeParse(slug); + const ctx = parsed.success ? await getWorkspaceForAction(parsed.data, "GUEST") : null; + if (!ctx) return actionError(NOT_ALLOWED); + if (await isActionRateLimited("action", ctx.user.id)) return actionError(RATE_LIMITED); + return fn(ctx); +} + +export async function listTaskTypesAction(slug: string, projectId: string) { + return run(slug, (ctx) => listTaskTypes(ctx, projectId)); +} +export async function createTaskTypeAction(slug: string, input: unknown) { + return run(slug, (ctx) => createTaskType(ctx, input)); +} +export async function updateTaskTypeAction(slug: string, input: unknown) { + return run(slug, (ctx) => updateTaskType(ctx, input)); +} +export async function setDefaultTaskTypeAction(slug: string, input: unknown) { + return run(slug, (ctx) => setDefaultTaskType(ctx, input)); +} +export async function reorderTaskTypesAction(slug: string, input: unknown) { + return run(slug, (ctx) => reorderTaskTypes(ctx, input)); +} +export async function deleteTaskTypeAction(slug: string, input: unknown) { + return run(slug, (ctx) => deleteTaskType(ctx, input)); +} diff --git a/app/api/v1/tasks/[ref]/archive/route.ts b/app/api/v1/tasks/[ref]/archive/route.ts new file mode 100644 index 00000000..ce4db96d --- /dev/null +++ b/app/api/v1/tasks/[ref]/archive/route.ts @@ -0,0 +1,9 @@ +import { writeEndpoint } from "@/lib/apiTokens/http"; + +export const dynamic = "force-dynamic"; + +/** POST /api/v1/tasks/{ref}/archive (write:tasks). Body: { archived?: boolean } (default true; false restores). */ +export async function POST(request: Request, ctx: RouteContext<"/api/v1/tasks/[ref]/archive">) { + const { ref } = await ctx.params; + return writeEndpoint(request, "sw_archive_task", { ref }, 200, { bodyOptional: true }); +} diff --git a/app/api/v1/tasks/[ref]/assignees/route.ts b/app/api/v1/tasks/[ref]/assignees/route.ts new file mode 100644 index 00000000..4285478c --- /dev/null +++ b/app/api/v1/tasks/[ref]/assignees/route.ts @@ -0,0 +1,9 @@ +import { writeEndpoint } from "@/lib/apiTokens/http"; + +export const dynamic = "force-dynamic"; + +/** POST /api/v1/tasks/{ref}/assignees (write:tasks). Body: { userIds, mode?: "add" | "remove" | "set" }. */ +export async function POST(request: Request, ctx: RouteContext<"/api/v1/tasks/[ref]/assignees">) { + const { ref } = await ctx.params; + return writeEndpoint(request, "sw_assign_task", { ref }); +} diff --git a/app/api/v1/tasks/[ref]/claim/route.ts b/app/api/v1/tasks/[ref]/claim/route.ts new file mode 100644 index 00000000..b97889ed --- /dev/null +++ b/app/api/v1/tasks/[ref]/claim/route.ts @@ -0,0 +1,15 @@ +import { writeEndpoint } from "@/lib/apiTokens/http"; + +export const dynamic = "force-dynamic"; + +/** POST /api/v1/tasks/{ref}/claim (write:tasks): assign the token's creator to the task. */ +export async function POST(request: Request, ctx: RouteContext<"/api/v1/tasks/[ref]/claim">) { + const { ref } = await ctx.params; + return writeEndpoint(request, "sw_claim_task", { ref, release: false }, 200, { bodyOptional: true }); +} + +/** DELETE /api/v1/tasks/{ref}/claim (write:tasks): take the token's creator off the task. */ +export async function DELETE(request: Request, ctx: RouteContext<"/api/v1/tasks/[ref]/claim">) { + const { ref } = await ctx.params; + return writeEndpoint(request, "sw_claim_task", { ref, release: true }, 200, { bodyOptional: true }); +} diff --git a/app/api/v1/tasks/[ref]/comments/route.ts b/app/api/v1/tasks/[ref]/comments/route.ts new file mode 100644 index 00000000..547bd123 --- /dev/null +++ b/app/api/v1/tasks/[ref]/comments/route.ts @@ -0,0 +1,9 @@ +import { writeEndpoint } from "@/lib/apiTokens/http"; + +export const dynamic = "force-dynamic"; + +/** POST /api/v1/tasks/{ref}/comments (write:tasks). Body: { body }. */ +export async function POST(request: Request, ctx: RouteContext<"/api/v1/tasks/[ref]/comments">) { + const { ref } = await ctx.params; + return writeEndpoint(request, "sw_add_comment", { ref }, 201); +} diff --git a/app/api/v1/tasks/[ref]/move/route.ts b/app/api/v1/tasks/[ref]/move/route.ts new file mode 100644 index 00000000..e3315a83 --- /dev/null +++ b/app/api/v1/tasks/[ref]/move/route.ts @@ -0,0 +1,9 @@ +import { writeEndpoint } from "@/lib/apiTokens/http"; + +export const dynamic = "force-dynamic"; + +/** POST /api/v1/tasks/{ref}/move (write:tasks). Body: { column? | status?, position?: "top" | "bottom" }. */ +export async function POST(request: Request, ctx: RouteContext<"/api/v1/tasks/[ref]/move">) { + const { ref } = await ctx.params; + return writeEndpoint(request, "sw_move_task", { ref }); +} diff --git a/app/api/v1/tasks/[ref]/transfer/route.ts b/app/api/v1/tasks/[ref]/transfer/route.ts new file mode 100644 index 00000000..f3c18b17 --- /dev/null +++ b/app/api/v1/tasks/[ref]/transfer/route.ts @@ -0,0 +1,9 @@ +import { writeEndpoint } from "@/lib/apiTokens/http"; + +export const dynamic = "force-dynamic"; + +/** POST /api/v1/tasks/{ref}/transfer (write:tasks). Body: { project } (target project key, required). Moves the task and its subtasks to that project. */ +export async function POST(request: Request, ctx: RouteContext<"/api/v1/tasks/[ref]/transfer">) { + const { ref } = await ctx.params; + return writeEndpoint(request, "sw_move_task", { ref }, 200, { requiredStrings: ["project"] }); +} diff --git a/app/globals.css b/app/globals.css index 1b3360ef..cabfdb30 100644 --- a/app/globals.css +++ b/app/globals.css @@ -1,4 +1,6 @@ @import "tailwindcss"; @import "./styles/tokens.css"; +@import "./styles/motion.css"; +@import "./styles/motion-utilities.css"; @import "./styles/global-theme.css"; @import "./styles/global-elements.css"; diff --git a/app/layout.tsx b/app/layout.tsx index 6017a9ec..2cecd13f 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -27,7 +27,8 @@ export default async function RootLayout({ children }: Readonly<{ children: Reac // Next.js attach it to every framework script. await connection(); const saved = (await cookies()).get(COLOR_MODE_COOKIE)?.value; - const initialColorMode = isColorMode(saved) ? saved : null; + // Light is the default; "system" (an explicit choice) follows the operating system. + const initialColorMode = isColorMode(saved) ? saved : saved === "system" ? null : "light"; return ( diff --git a/app/styles/global-elements.css b/app/styles/global-elements.css index 839a8e4d..af0491c1 100644 --- a/app/styles/global-elements.css +++ b/app/styles/global-elements.css @@ -44,9 +44,10 @@ -moz-osx-font-smoothing: grayscale; } - /* Gilroy 600 for headings (never 800), with the brand's tight tracking. */ + /* In-app headings are Outfit 600 (ui-brand-spec D.3); Gilroy ExtraBold 800 is + reserved for the display classes below. Tight tracking per the brand. */ h1, h2, h3, h4 { - font-family: var(--font-display); + font-family: var(--font-sans); font-weight: 600; letter-spacing: -0.01em; color: var(--yy-text); @@ -73,15 +74,15 @@ @layer components { /* Type scale (docs/DESIGN.md §2.6). Mobile sizes first, desktop from 640px. - Every heading is Gilroy 600; display sizes carry the brand's tighter tracking. */ - .text-display-xl { font-family: var(--font-display); font-weight: 600; font-size: 44px; line-height: 1.08; letter-spacing: -0.02em; } - .text-display-l { font-family: var(--font-display); font-weight: 600; font-size: 34px; line-height: 1.18; letter-spacing: -0.02em; } - .text-display-m { font-family: var(--font-display); font-weight: 600; font-size: 34px; line-height: 1.1765; letter-spacing: -0.015em; } - .text-h1 { font-family: var(--font-display); font-weight: 600; font-size: 26px; line-height: 1.22; letter-spacing: -0.01em; } - .text-h2 { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.4; letter-spacing: -0.005em; } - .text-h3 { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.4; letter-spacing: -0.005em; } - .text-h4 { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.4; letter-spacing: -0.005em; } - .text-stat { font-family: var(--font-display); font-weight: 600; font-size: 32px; line-height: 1.1875; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; } + Display sizes are Gilroy ExtraBold 800; headings, titles and stats are Outfit 600. */ + .text-display-xl { font-family: var(--font-display); font-weight: 800; font-size: 44px; line-height: 1.08; letter-spacing: -0.02em; } + .text-display-l { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1.18; letter-spacing: -0.02em; } + .text-display-m { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1.1765; letter-spacing: -0.015em; } + .text-h1 { font-family: var(--font-sans); font-weight: 600; font-size: 26px; line-height: 1.22; letter-spacing: -0.01em; } + .text-h2 { font-family: var(--font-sans); font-weight: 600; font-size: 20px; line-height: 1.4; letter-spacing: -0.005em; } + .text-h3 { font-family: var(--font-sans); font-weight: 600; font-size: 20px; line-height: 1.4; letter-spacing: -0.005em; } + .text-h4 { font-family: var(--font-sans); font-weight: 600; font-size: 20px; line-height: 1.4; letter-spacing: -0.005em; } + .text-stat { font-family: var(--font-sans); font-weight: 600; font-size: 32px; line-height: 1.1875; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; } /* Card and sub-section titles inside the app ("Invite someone", "New API client"). */ .text-title { font-family: var(--font-sans); font-weight: 600; font-size: 16px; line-height: 1.5; } .text-body-l { font-size: 16px; line-height: 1.5; } @@ -157,33 +158,20 @@ } .yy-success-in { - animation: yy-success-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both; -} - -@keyframes yy-fade-in { - from { opacity: 0; } - to { opacity: 1; } + animation: yy-success-in var(--sw-dur-slow) var(--sw-ease-enter) both; } -@keyframes yy-dialog-in { - /* Centring comes from the `translate` property (Tailwind v4), so the - animation only nudges with `transform`; mixing both used to double the - offset and make dialogs fly in from the top-left. */ - from { opacity: 0; transform: translateY(8px) scale(0.98); } - to { opacity: 1; transform: none; } -} - -@keyframes yy-toast-in { - from { opacity: 0; transform: translateY(8px); } - to { opacity: 1; transform: translateY(0); } -} +/* Legacy names kept as aliases of the token-driven keyframes in motion-utilities.css. */ +@keyframes yy-fade-in { from { opacity: 0; } } +@keyframes yy-dialog-in { from { opacity: 0; transform: scale(var(--sw-pop-scale)); } } +@keyframes yy-toast-in { from { opacity: 0; transform: translateY(var(--sw-enter-y)); } } /* Member-written rich text (sanitised HTML from docs and tasks). */ @layer components { .yy-prose { color: var(--yy-text-secondary); font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; } .yy-prose > * + * { margin-top: 0.85em; } - .yy-prose h2 { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.2; color: var(--yy-text); margin-top: 1.4em; } - .yy-prose h3 { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.25; color: var(--yy-text); margin-top: 1.2em; } + .yy-prose h2 { font-family: var(--font-sans); font-weight: 600; font-size: 24px; line-height: 1.2; color: var(--yy-text); margin-top: 1.4em; } + .yy-prose h3 { font-family: var(--font-sans); font-weight: 600; font-size: 20px; line-height: 1.25; color: var(--yy-text); margin-top: 1.2em; } .yy-prose strong { color: var(--yy-text); font-weight: 700; } .yy-prose a { color: var(--yy-accent-text); text-decoration: underline; text-underline-offset: 3px; } .yy-prose ul { list-style: disc; padding-left: 1.4em; } @@ -224,12 +212,12 @@ .yy-theme-fade *::before, .yy-theme-fade *::after { transition-property: background-color, border-color, color, fill, stroke, box-shadow !important; - transition-duration: 120ms !important; - transition-timing-function: cubic-bezier(0.45, 0, 0.2, 1) !important; + transition-duration: var(--sw-dur-fast) !important; + transition-timing-function: var(--sw-ease-standard) !important; } .yy-mode-icon { - transition: transform 200ms ease-out, opacity 120ms ease-out; + transition: transform var(--sw-dur-base) var(--sw-ease-enter), opacity var(--sw-dur-fast) var(--sw-ease-enter); } /* BrandLoader (components/brand/BrandLoader.tsx): the three dots hop one after diff --git a/app/styles/global-theme.css b/app/styles/global-theme.css index 373aaaba..0b2df0c5 100644 --- a/app/styles/global-theme.css +++ b/app/styles/global-theme.css @@ -11,36 +11,30 @@ } /* - * Space Works type: Gilroy 400–700 for everything, Unbounded 500 for one - * short accent phrase per public layout (`.font-accent`). Self-hosted from - * public/brand/fonts (licences in public/brand/fonts/LICENSES). + * Space Works type (Design-Kit, docs/ui-brand-spec.md D): Outfit 400-700 for + * body and UI, Gilroy ExtraBold 800 for display headings (Light 300 for light + * display text; the only free Gilroy weights), Unbounded 500-600 for one short + * accent phrase per public layout (`.font-accent`). Self-hosted from + * public/brand/fonts (synced by `npm run tokens:sync`, licences in LICENSES). */ @font-face { - font-family: "Gilroy"; - src: url("/brand/fonts/Gilroy-Regular.woff") format("woff"); - font-weight: 400; - font-style: normal; - font-display: swap; -} -@font-face { - font-family: "Gilroy"; - src: url("/brand/fonts/Gilroy-Medium.woff") format("woff"); - font-weight: 500; + font-family: "Outfit"; + src: url("/brand/fonts/Outfit-Variable.woff2") format("woff2"); + font-weight: 400 700; font-style: normal; font-display: swap; } @font-face { font-family: "Gilroy"; - src: url("/brand/fonts/Gilroy-SemiBold.woff") format("woff"); - font-weight: 600; + src: url("/brand/fonts/Gilroy-Light.woff2") format("woff2"); + font-weight: 300; font-style: normal; font-display: swap; } @font-face { font-family: "Gilroy"; - src: url("/brand/fonts/Gilroy-Bold.woff") format("woff"); - /* Bold also answers legacy 800/900 requests so nothing is synthesised. */ - font-weight: 700; + src: url("/brand/fonts/Gilroy-ExtraBold.woff2") format("woff2"); + font-weight: 800; font-style: normal; font-display: swap; } @@ -131,9 +125,9 @@ --color-accent-text: var(--yy-accent-text); --font-display: "Gilroy", ui-sans-serif, system-ui, sans-serif; - --font-sans: "Gilroy", ui-sans-serif, system-ui, sans-serif; - --font-accent: "Unbounded", "Gilroy", ui-sans-serif, sans-serif; - /* Compatibility alias; all text uses Gilroy, including code and secrets. */ + --font-sans: "Outfit", ui-sans-serif, system-ui, sans-serif; + --font-accent: "Unbounded", "Outfit", ui-sans-serif, sans-serif; + /* Compatibility alias; all text uses Outfit, including code and secrets. */ --font-mono: var(--font-sans); /* Controls 10px (`rounded-control`), cards and panels 16px (`rounded-xl`). */ @@ -154,5 +148,12 @@ --breakpoint-md: 960px; --breakpoint-lg: 1200px; - --ease-yy: cubic-bezier(0.2, 0.8, 0.2, 1); + /* Motion tokens come from Design-Kit (app/styles/motion.css). */ + --ease-yy: var(--sw-ease-standard); + --ease-standard: var(--sw-ease-standard); + --ease-enter: var(--sw-ease-enter); + --ease-exit: var(--sw-ease-exit); + --duration-fast: var(--sw-dur-fast); + --duration-base: var(--sw-dur-base); + --duration-slow: var(--sw-dur-slow); } diff --git a/app/styles/motion-utilities.css b/app/styles/motion-utilities.css new file mode 100644 index 00000000..55be44b4 --- /dev/null +++ b/app/styles/motion-utilities.css @@ -0,0 +1,73 @@ +/* Motion vocabulary (docs/DESIGN.md §2.10). Every duration, curve and distance + * comes from the Design-Kit tokens in motion.css, so reduced motion (zeroed + * tokens) and kiosk/TV screens (zeroed distances, fade only) need no extra rules. + * Entrances use fill-mode `backwards` so they never pin a transform afterwards + * (drag-and-drop writes its own). Exits use `forwards` so nothing flashes back. */ +:root { + --sw-stagger: 30ms; + --sw-shimmer-dur: 1400ms; +} +@media (prefers-reduced-motion: reduce) { + :root { --sw-stagger: 0ms; } +} +.sw-kiosk, .sw-tv { --sw-stagger: 0ms; } + +@keyframes sw-fade-in { from { opacity: 0; } } +@keyframes sw-fade-out { to { opacity: 0; } } +@keyframes sw-rise-in { from { opacity: 0; transform: translateY(var(--sw-enter-y)); } } +@keyframes sw-pop-in { from { opacity: 0; transform: translate(var(--sw-pop-x, 0px), var(--sw-pop-y, 0px)) scale(var(--sw-pop-scale)); } } +@keyframes sw-pop-out { to { opacity: 0; transform: translate(var(--sw-pop-x, 0px), var(--sw-pop-y, 0px)) scale(var(--sw-pop-scale)); } } +@keyframes sw-slide-in-right { from { opacity: 0; transform: translateX(var(--sw-slide-x)); } } +@keyframes sw-slide-out-right { to { opacity: 0; transform: translateX(var(--sw-slide-x)); } } +@keyframes sw-lift { from { transform: scale(1); box-shadow: none; } } +@keyframes sw-shimmer { to { background-position: -200% 0; } } +@keyframes sw-progress { from { transform: translateX(-100%); } to { transform: translateX(250%); } } + +/* Enter-only utilities. `--sw-i` (0-5) staggers siblings by --sw-stagger. */ +.sw-fade-in { animation: sw-fade-in var(--sw-dur-base) var(--sw-ease-enter) backwards; } +.sw-rise-in { + animation: sw-rise-in var(--sw-dur-slow) var(--sw-ease-enter) backwards; + animation-delay: calc(min(var(--sw-i, 0), 5) * var(--sw-stagger)); +} +.sw-pop-in { animation: sw-pop-in var(--sw-dur-base) var(--sw-ease-enter) backwards; } +/* Table rows have no index prop: stagger the first six by position. */ +.sw-row-in { animation: sw-rise-in var(--sw-dur-slow) var(--sw-ease-enter) backwards; } +.sw-row-in:nth-child(2) { animation-delay: calc(1 * var(--sw-stagger)); } +.sw-row-in:nth-child(3) { animation-delay: calc(2 * var(--sw-stagger)); } +.sw-row-in:nth-child(4) { animation-delay: calc(3 * var(--sw-stagger)); } +.sw-row-in:nth-child(5) { animation-delay: calc(4 * var(--sw-stagger)); } +.sw-row-in:nth-child(n + 6) { animation-delay: calc(5 * var(--sw-stagger)); } +.sw-lift { animation: sw-lift var(--sw-dur-fast) var(--sw-ease-enter) backwards; } + +/* Radix overlays: data-state drives enter and exit (Presence waits for the exit). */ +.sw-overlay[data-state="open"] { animation: sw-fade-in var(--sw-dur-base) var(--sw-ease-enter) backwards; } +.sw-overlay[data-state="closed"] { animation: sw-fade-out var(--sw-dur-fast) var(--sw-ease-exit) forwards; } +.sw-dialog[data-state="open"] { animation: sw-pop-in var(--sw-dur-base) var(--sw-ease-enter) backwards; } +.sw-dialog[data-state="closed"] { animation: sw-pop-out var(--sw-dur-fast) var(--sw-ease-exit) forwards; } +.sw-drawer[data-state="open"] { animation: sw-slide-in-right var(--sw-dur-slow) var(--sw-ease-enter) backwards; } +.sw-drawer[data-state="closed"] { animation: sw-slide-out-right var(--sw-dur-base) var(--sw-ease-exit) forwards; } + +/* Menus, popovers, tooltips and selects pop from the side that faces their trigger. */ +.sw-pop { transform-origin: var(--radix-popper-transform-origin); } +.sw-pop[data-side="top"] { --sw-pop-y: var(--sw-pop-offset); } +.sw-pop[data-side="bottom"] { --sw-pop-y: calc(var(--sw-pop-offset) * -1); } +.sw-pop[data-side="left"] { --sw-pop-x: var(--sw-pop-offset); } +.sw-pop[data-side="right"] { --sw-pop-x: calc(var(--sw-pop-offset) * -1); } +.sw-pop[data-state="open"], .sw-pop[data-state="delayed-open"], .sw-pop[data-state="instant-open"] { animation: sw-pop-in var(--sw-dur-base) var(--sw-ease-enter) backwards; } +.sw-pop[data-state="closed"] { animation: sw-pop-out var(--sw-dur-fast) var(--sw-ease-exit) forwards; } + +/* Toast: rises in, fades out when dismissed (ToastProvider sets data-state). */ +.sw-toast[data-state="open"] { animation: sw-rise-in var(--sw-dur-base) var(--sw-ease-enter) backwards; } +.sw-toast[data-state="closed"] { animation: sw-fade-out var(--sw-dur-fast) var(--sw-ease-exit) forwards; } + +/* Loading indicators are the only looping motion; reduced motion shows them still. */ +.sw-skeleton { + background: linear-gradient(90deg, var(--yy-bg-muted) 0%, var(--yy-bg-emphasis) 50%, var(--yy-bg-muted) 100%); + background-size: 200% 100%; + animation: sw-shimmer var(--sw-shimmer-dur) linear infinite; +} +.sw-progress-bar { animation: sw-progress var(--sw-shimmer-dur) var(--sw-ease-standard) infinite; } +@media (prefers-reduced-motion: reduce) { + .sw-skeleton { animation: none; background: var(--yy-bg-muted); } + .sw-progress-bar { animation: none; transform: none; } +} diff --git a/app/styles/motion.css b/app/styles/motion.css new file mode 100644 index 00000000..e0d86d6a --- /dev/null +++ b/app/styles/motion.css @@ -0,0 +1,21 @@ +/* Space Works Design-Kit 0.12.0 motion tokens (design-kit/tokens/tokens.json), + * generated by scripts/sync-design-tokens.mjs. Do not edit by hand. + * Durations: fast = press/hover/exit, base = overlays and indicators, slow = route settle. + * Curves: standard = most movement, enter = arrivals, exit = departures. + * Distances are tokens so kiosk and TV screens zero them and keep only the fade. */ +:root { + --sw-dur-fast: 120ms; + --sw-dur-base: 180ms; + --sw-dur-slow: 240ms; + --sw-ease-standard: cubic-bezier(0.2, 0, 0, 1); + --sw-ease-enter: cubic-bezier(0.16, 1, 0.3, 1); + --sw-ease-exit: cubic-bezier(0.4, 0, 1, 1); + --sw-enter-y: 8px; + --sw-pop-scale: 0.98; + --sw-pop-offset: 4px; + --sw-slide-x: 100%; +} +.sw-kiosk, .sw-tv { --sw-enter-y: 0px; --sw-pop-scale: 1; --sw-pop-offset: 0px; --sw-slide-x: 0%; } +@media (prefers-reduced-motion: reduce) { + :root { --sw-dur-fast: 0ms; --sw-dur-base: 0ms; --sw-dur-slow: 0ms; --sw-enter-y: 0px; --sw-pop-scale: 1; --sw-pop-offset: 0px; --sw-slide-x: 0%; } +} diff --git a/app/styles/palette.css b/app/styles/palette.css index 6f10f2fd..cfcc0846 100644 --- a/app/styles/palette.css +++ b/app/styles/palette.css @@ -1,4 +1,5 @@ -/* Space Works Design tokens/tokens.css, refreshed 21 Oct 2026. +/* Space Works Design-Kit 0.12.0 (design-kit/tokens/tokens.json), generated by + * scripts/sync-design-tokens.mjs. Do not edit by hand: run `npm run tokens:sync`. * Canonical sRGB triplets; sw- prefix avoids Tailwind utility-name collisions. * The pinned source values are in tests/fixtures/design-tokens.json. */ :root { @@ -55,122 +56,125 @@ --sw-color-sidebar: 223 255 143; --sw-color-sidebar-hover: 242 255 210; --sw-color-sidebar-active: 0 110 99; + --sw-color-scrim: 20 44 42; --sw-shadow-color: 20 44 42; } :root[data-color-mode="dark"], .yy-dark-band { - --sw-color-bg: 20 44 42; - --sw-color-surface: 25 57 53; - --sw-color-panel: 31 67 63; - --sw-color-hover: 37 77 72; - --sw-color-line: 77 109 103; - --sw-color-outline: 147 161 152; + --sw-color-bg: 0 0 0; + --sw-color-surface: 11 11 11; + --sw-color-panel: 20 20 20; + --sw-color-hover: 28 28 28; + --sw-color-line: 44 44 44; + --sw-color-outline: 120 120 120; --sw-color-ink: 255 244 232; - --sw-color-muted: 199 196 186; + --sw-color-muted: 172 172 172; --sw-color-focus: 223 255 143; --sw-color-accent: 0 110 99; --sw-color-accent-hover: 2 103 93; --sw-color-accent-active: 4 97 88; --sw-color-on-accent: 255 244 232; - --sw-color-accent-soft: 26 74 69; - --sw-color-accent-ink: 171 200 188; + --sw-color-accent-soft: 18 29 28; + --sw-color-accent-ink: 128 177 166; --sw-color-brand: 0 110 99; --sw-color-brand-hover: 2 103 93; --sw-color-brand-active: 4 97 88; --sw-color-on-brand: 255 244 232; - --sw-color-brand-soft: 26 74 69; - --sw-color-brand-ink: 171 200 188; - --sw-color-brand-boundary: 171 200 188; + --sw-color-brand-soft: 18 29 28; + --sw-color-brand-ink: 128 177 166; + --sw-color-brand-boundary: 128 177 166; --sw-color-emphasis: 255 116 71; --sw-color-emphasis-hover: 255 129 87; --sw-color-emphasis-active: 255 142 103; --sw-color-on-emphasis: 20 44 42; - --sw-color-emphasis-soft: 47 70 64; + --sw-color-emphasis-soft: 34 26 23; --sw-color-success: 223 255 143; --sw-color-success-hover: 203 234 133; --sw-color-success-active: 182 213 123; --sw-color-on-success: 20 44 42; - --sw-color-success-soft: 44 80 69; - --sw-color-success-ink: 223 255 143; + --sw-color-success-soft: 32 34 27; + --sw-color-success-ink: 233 252 170; --sw-color-warn: 255 212 71; --sw-color-warn-hover: 232 195 68; --sw-color-warn-active: 208 178 65; --sw-color-on-warn: 20 44 42; - --sw-color-warn-soft: 47 77 64; - --sw-color-warn-ink: 255 212 71; + --sw-color-warn-soft: 34 32 23; + --sw-color-warn-ink: 255 222 119; --sw-color-info: 181 205 255; --sw-color-info-hover: 165 189 234; --sw-color-info-active: 149 173 212; --sw-color-on-info: 20 44 42; - --sw-color-info-soft: 42 77 76; - --sw-color-info-ink: 181 205 255; + --sw-color-info-soft: 30 31 34; + --sw-color-info-ink: 203 217 248; --sw-color-danger: 252 165 165; --sw-color-danger-hover: 253 185 182; --sw-color-danger-active: 253 201 195; --sw-color-on-danger: 20 44 42; --sw-color-danger-line: 124 98 97; - --sw-color-sidebar: 17 53 50; - --sw-color-sidebar-hover: 37 77 72; + --sw-color-sidebar: 11 11 11; + --sw-color-sidebar-hover: 28 28 28; --sw-color-sidebar-active: 0 110 99; - --sw-shadow-color: 20 44 42; + --sw-color-scrim: 0 0 0; + --sw-shadow-color: 0 0 0; } @media (prefers-color-scheme: dark) { :root:not([data-color-mode]) { - --sw-color-bg: 20 44 42; - --sw-color-surface: 25 57 53; - --sw-color-panel: 31 67 63; - --sw-color-hover: 37 77 72; - --sw-color-line: 77 109 103; - --sw-color-outline: 147 161 152; + --sw-color-bg: 0 0 0; + --sw-color-surface: 11 11 11; + --sw-color-panel: 20 20 20; + --sw-color-hover: 28 28 28; + --sw-color-line: 44 44 44; + --sw-color-outline: 120 120 120; --sw-color-ink: 255 244 232; - --sw-color-muted: 199 196 186; + --sw-color-muted: 172 172 172; --sw-color-focus: 223 255 143; --sw-color-accent: 0 110 99; --sw-color-accent-hover: 2 103 93; --sw-color-accent-active: 4 97 88; --sw-color-on-accent: 255 244 232; - --sw-color-accent-soft: 26 74 69; - --sw-color-accent-ink: 171 200 188; + --sw-color-accent-soft: 18 29 28; + --sw-color-accent-ink: 128 177 166; --sw-color-brand: 0 110 99; --sw-color-brand-hover: 2 103 93; --sw-color-brand-active: 4 97 88; --sw-color-on-brand: 255 244 232; - --sw-color-brand-soft: 26 74 69; - --sw-color-brand-ink: 171 200 188; - --sw-color-brand-boundary: 171 200 188; + --sw-color-brand-soft: 18 29 28; + --sw-color-brand-ink: 128 177 166; + --sw-color-brand-boundary: 128 177 166; --sw-color-emphasis: 255 116 71; --sw-color-emphasis-hover: 255 129 87; --sw-color-emphasis-active: 255 142 103; --sw-color-on-emphasis: 20 44 42; - --sw-color-emphasis-soft: 47 70 64; + --sw-color-emphasis-soft: 34 26 23; --sw-color-success: 223 255 143; --sw-color-success-hover: 203 234 133; --sw-color-success-active: 182 213 123; --sw-color-on-success: 20 44 42; - --sw-color-success-soft: 44 80 69; - --sw-color-success-ink: 223 255 143; + --sw-color-success-soft: 32 34 27; + --sw-color-success-ink: 233 252 170; --sw-color-warn: 255 212 71; --sw-color-warn-hover: 232 195 68; --sw-color-warn-active: 208 178 65; --sw-color-on-warn: 20 44 42; - --sw-color-warn-soft: 47 77 64; - --sw-color-warn-ink: 255 212 71; + --sw-color-warn-soft: 34 32 23; + --sw-color-warn-ink: 255 222 119; --sw-color-info: 181 205 255; --sw-color-info-hover: 165 189 234; --sw-color-info-active: 149 173 212; --sw-color-on-info: 20 44 42; - --sw-color-info-soft: 42 77 76; - --sw-color-info-ink: 181 205 255; + --sw-color-info-soft: 30 31 34; + --sw-color-info-ink: 203 217 248; --sw-color-danger: 252 165 165; --sw-color-danger-hover: 253 185 182; --sw-color-danger-active: 253 201 195; --sw-color-on-danger: 20 44 42; --sw-color-danger-line: 124 98 97; - --sw-color-sidebar: 17 53 50; - --sw-color-sidebar-hover: 37 77 72; + --sw-color-sidebar: 11 11 11; + --sw-color-sidebar-hover: 28 28 28; --sw-color-sidebar-active: 0 110 99; - --sw-shadow-color: 20 44 42; + --sw-color-scrim: 0 0 0; + --sw-shadow-color: 0 0 0; } } diff --git a/app/styles/tokens.css b/app/styles/tokens.css index a88005da..da06fb82 100644 --- a/app/styles/tokens.css +++ b/app/styles/tokens.css @@ -5,7 +5,7 @@ * shadow, and motion value used by components comes from here; components * never hard-code hex values. * - * Source of truth: SpaceWorks-Labs/SpaceWorks-Design (`tokens/tokens.css`, + * Source of truth: SpaceWorks-Labs/Design-Kit, the `design-kit/` submodule (`tokens/tokens.json`, * `docs/ui-brand-spec.md`). The `--yy-` prefix matches Space Works Events so * utilities stay interchangeable between the two apps; the values are Space Works. * Every text/background pair below reaches WCAG AA (4.5:1); disabled text is @@ -106,7 +106,7 @@ --yy-shadow-float: 0 2px 6px rgb(var(--sw-shadow-color) / 0.06), 0 12px 32px rgb(var(--sw-shadow-color) / 0.1); --yy-shadow-segment: 0 0 0 1px var(--yy-border-strong); - --yy-overlay: rgb(var(--sw-shadow-color) / 0.48); + --yy-overlay: rgb(var(--sw-color-scrim) / 0.48); /* Focus ring colour */ --yy-focus: rgb(var(--sw-color-focus)); diff --git a/app/w/[workspaceSlug]/analytics/loading.tsx b/app/w/[workspaceSlug]/analytics/loading.tsx index c4d3a9e8..e3b9aa8e 100644 --- a/app/w/[workspaceSlug]/analytics/loading.tsx +++ b/app/w/[workspaceSlug]/analytics/loading.tsx @@ -1,4 +1,5 @@ -import { BrandPageLoader } from "@/components/brand/BrandLoader"; +import { CardsSkeleton } from "@/components/ui/skeletons"; + export default function Loading() { - return ; + return ; } diff --git a/app/w/[workspaceSlug]/calendar/loading.tsx b/app/w/[workspaceSlug]/calendar/loading.tsx index ffb2cdfc..3af7ffec 100644 --- a/app/w/[workspaceSlug]/calendar/loading.tsx +++ b/app/w/[workspaceSlug]/calendar/loading.tsx @@ -1,5 +1,5 @@ -import { BrandPageLoader } from "@/components/brand/BrandLoader"; +import { PageSkeleton } from "@/components/ui/skeletons"; export default function Loading() { - return ; + return ; } diff --git a/app/w/[workspaceSlug]/chat/[channelSlug]/loading.tsx b/app/w/[workspaceSlug]/chat/[channelSlug]/loading.tsx new file mode 100644 index 00000000..e925ccf5 --- /dev/null +++ b/app/w/[workspaceSlug]/chat/[channelSlug]/loading.tsx @@ -0,0 +1,5 @@ +import { ChatSkeleton } from "@/components/ui/skeletons"; + +export default function Loading() { + return ; +} diff --git a/app/w/[workspaceSlug]/docs/[docId]/loading.tsx b/app/w/[workspaceSlug]/docs/[docId]/loading.tsx new file mode 100644 index 00000000..08b71b9d --- /dev/null +++ b/app/w/[workspaceSlug]/docs/[docId]/loading.tsx @@ -0,0 +1,5 @@ +import { DetailSkeleton } from "@/components/ui/skeletons"; + +export default function Loading() { + return ; +} diff --git a/app/w/[workspaceSlug]/docs/loading.tsx b/app/w/[workspaceSlug]/docs/loading.tsx new file mode 100644 index 00000000..85cfca94 --- /dev/null +++ b/app/w/[workspaceSlug]/docs/loading.tsx @@ -0,0 +1,5 @@ +import { ListSkeleton } from "@/components/ui/skeletons"; + +export default function Loading() { + return ; +} diff --git a/app/w/[workspaceSlug]/files/loading.tsx b/app/w/[workspaceSlug]/files/loading.tsx new file mode 100644 index 00000000..b31e40c0 --- /dev/null +++ b/app/w/[workspaceSlug]/files/loading.tsx @@ -0,0 +1,5 @@ +import { ListSkeleton } from "@/components/ui/skeletons"; + +export default function Loading() { + return ; +} diff --git a/app/w/[workspaceSlug]/finance/loading.tsx b/app/w/[workspaceSlug]/finance/loading.tsx index b0169567..ef40dbc2 100644 --- a/app/w/[workspaceSlug]/finance/loading.tsx +++ b/app/w/[workspaceSlug]/finance/loading.tsx @@ -1,5 +1,5 @@ -import { BrandPageLoader } from "@/components/brand/BrandLoader"; +import { CardsSkeleton } from "@/components/ui/skeletons"; export default function Loading() { - return ; + return ; } diff --git a/app/w/[workspaceSlug]/loading.tsx b/app/w/[workspaceSlug]/loading.tsx index 455c6079..54054bb6 100644 --- a/app/w/[workspaceSlug]/loading.tsx +++ b/app/w/[workspaceSlug]/loading.tsx @@ -1,5 +1,5 @@ -import { BrandPageLoader } from "@/components/brand/BrandLoader"; +import { PageSkeleton } from "@/components/ui/skeletons"; export default function Loading() { - return ; + return ; } diff --git a/app/w/[workspaceSlug]/members/loading.tsx b/app/w/[workspaceSlug]/members/loading.tsx index ed8583d0..2c1bb43b 100644 --- a/app/w/[workspaceSlug]/members/loading.tsx +++ b/app/w/[workspaceSlug]/members/loading.tsx @@ -1,5 +1,5 @@ -import { BrandPageLoader } from "@/components/brand/BrandLoader"; +import { CardsSkeleton } from "@/components/ui/skeletons"; export default function Loading() { - return ; + return ; } diff --git a/app/w/[workspaceSlug]/my-tasks/loading.tsx b/app/w/[workspaceSlug]/my-tasks/loading.tsx new file mode 100644 index 00000000..acf2c3f1 --- /dev/null +++ b/app/w/[workspaceSlug]/my-tasks/loading.tsx @@ -0,0 +1,5 @@ +import { ListSkeleton } from "@/components/ui/skeletons"; + +export default function Loading() { + return ; +} diff --git a/app/w/[workspaceSlug]/my-tasks/page.tsx b/app/w/[workspaceSlug]/my-tasks/page.tsx index 749e1634..b77defd2 100644 --- a/app/w/[workspaceSlug]/my-tasks/page.tsx +++ b/app/w/[workspaceSlug]/my-tasks/page.tsx @@ -1,18 +1,32 @@ import { MyTasks } from "@/components/tasks/MyTasks"; import { PageHeader } from "@/components/ui/display"; import { requireWorkspace } from "@/lib/permissions"; -import { listMyTasks, workspaceLabels } from "@/lib/tasks/queries"; +import { parseMyTasksTab } from "@/lib/tasks/myTasks"; +import { directReportIds, listMyTasks, listQuickAddProjects, workspaceLabels } from "@/lib/tasks/queries"; export const metadata = { title: "My tasks" }; -export default async function MyTasksPage({ params }: PageProps<"/w/[workspaceSlug]/my-tasks">) { +export default async function MyTasksPage({ params, searchParams }: PageProps<"/w/[workspaceSlug]/my-tasks">) { const { workspaceSlug } = await params; const context = await requireWorkspace(workspaceSlug, "MEMBER"); - const [tasks, labels] = await Promise.all([listMyTasks(context), workspaceLabels(context.workspace.id)]); + const [reports, projects, labels] = await Promise.all([directReportIds(context), listQuickAddProjects(context), workspaceLabels(context.workspace.id)]); + const requested = parseMyTasksTab((await searchParams).tab); + const tab = requested === "team" && reports.length === 0 ? "assigned" : requested; + const tasks = await listMyTasks(context, new Date(), tab); return (
- - + + 0} + projects={projects} + labels={labels} + timeZone={context.workspace.timezone} + projectsHref={`/w/${context.workspace.slug}/projects`} + />
); } diff --git a/app/w/[workspaceSlug]/notifications/loading.tsx b/app/w/[workspaceSlug]/notifications/loading.tsx index 3303cefe..417bd7c7 100644 --- a/app/w/[workspaceSlug]/notifications/loading.tsx +++ b/app/w/[workspaceSlug]/notifications/loading.tsx @@ -1,5 +1,5 @@ -import { BrandPageLoader } from "@/components/brand/BrandLoader"; +import { ListSkeleton } from "@/components/ui/skeletons"; export default function Loading() { - return ; + return ; } diff --git a/app/w/[workspaceSlug]/projects/[key]/(project)/loading.tsx b/app/w/[workspaceSlug]/projects/[key]/(project)/loading.tsx new file mode 100644 index 00000000..8f5e1696 --- /dev/null +++ b/app/w/[workspaceSlug]/projects/[key]/(project)/loading.tsx @@ -0,0 +1,5 @@ +import { BoardSkeleton } from "@/components/ui/skeletons"; + +export default function Loading() { + return ; +} diff --git a/app/w/[workspaceSlug]/projects/[key]/(project)/settings/page.tsx b/app/w/[workspaceSlug]/projects/[key]/(project)/settings/page.tsx index 39f58364..2eaa74b8 100644 --- a/app/w/[workspaceSlug]/projects/[key]/(project)/settings/page.tsx +++ b/app/w/[workspaceSlug]/projects/[key]/(project)/settings/page.tsx @@ -1,18 +1,29 @@ import { notFound } from "next/navigation"; +import { TaskTypesSettings } from "@/components/projects/TaskTypesSettings"; import { ProjectSettingsForm } from "@/components/projects/ProjectSettingsForm"; import { requireWorkspace } from "@/lib/permissions"; import { listVisibleTeams } from "@/lib/projects/queries"; import { assignableMembers } from "@/lib/tasks/access"; import { findProjectByKey, permissionsFor, projectSummary } from "@/lib/tasks/queries"; +import { listTaskTypes } from "@/lib/tasks/service"; export const metadata = { title: "Project settings" }; -/** Project details and archive: admins and the project owner only (others get 404). */ +/** Project details, task types and archive: admins and the project owner only (others get 404). */ export default async function ProjectSettingsPage({ params }: PageProps<"/w/[workspaceSlug]/projects/[key]/settings">) { const { workspaceSlug, key } = await params; const context = await requireWorkspace(workspaceSlug, "MEMBER"); const project = await findProjectByKey(context, key); if (!project || !permissionsFor(context, project).canManage) notFound(); - const [summary, members, teams] = await Promise.all([projectSummary(project), assignableMembers(context.workspace.id, null), listVisibleTeams(context)]); - return ; + const [summary, members, teams, types] = await Promise.all([projectSummary(project), assignableMembers(context.workspace.id, null), listVisibleTeams(context), listTaskTypes(context, project.id)]); + return ( + } + /> + ); } diff --git a/app/w/[workspaceSlug]/projects/[key]/[number]/loading.tsx b/app/w/[workspaceSlug]/projects/[key]/[number]/loading.tsx new file mode 100644 index 00000000..eadd9916 --- /dev/null +++ b/app/w/[workspaceSlug]/projects/[key]/[number]/loading.tsx @@ -0,0 +1,5 @@ +import { DetailSkeleton } from "@/components/ui/skeletons"; + +export default function Loading() { + return ; +} diff --git a/app/w/[workspaceSlug]/projects/[key]/[number]/page.tsx b/app/w/[workspaceSlug]/projects/[key]/[number]/page.tsx index 797c17c8..ca1a99d8 100644 --- a/app/w/[workspaceSlug]/projects/[key]/[number]/page.tsx +++ b/app/w/[workspaceSlug]/projects/[key]/[number]/page.tsx @@ -2,6 +2,7 @@ import type { Metadata } from "next"; import { notFound, redirect } from "next/navigation"; import { TaskDetail } from "@/components/tasks/TaskDetail"; import { requireWorkspace } from "@/lib/permissions"; +import { canonicalTaskRedirect } from "@/lib/tasks/links"; import { getTaskDetail } from "@/lib/tasks/queries"; function parseNumber(value: string) { @@ -18,8 +19,8 @@ export async function generateMetadata({ params }: PageProps<"/w/[workspaceSlug] /** * Full task page. Task numbers are unique per workspace, so a link with an - * old project key (the key was changed, or the task moved) redirects to the - * current one. + * old project key (the key was changed, or the task moved to another project) + * redirects to the current one. */ export default async function TaskPage({ params }: PageProps<"/w/[workspaceSlug]/projects/[key]/[number]">) { const { workspaceSlug, key, number } = await params; @@ -27,6 +28,7 @@ export default async function TaskPage({ params }: PageProps<"/w/[workspaceSlug] const parsed = parseNumber(number); const task = parsed ? await getTaskDetail(context, parsed) : null; if (!task) notFound(); - if (task.project?.key !== key) redirect(task.url); + const canonical = canonicalTaskRedirect(context.workspace.slug, key, { number: task.number, projectKey: task.project?.key ?? null }); + if (canonical) redirect(canonical); return ; } diff --git a/app/w/[workspaceSlug]/projects/[key]/tasks/[number]/loading.tsx b/app/w/[workspaceSlug]/projects/[key]/tasks/[number]/loading.tsx new file mode 100644 index 00000000..eadd9916 --- /dev/null +++ b/app/w/[workspaceSlug]/projects/[key]/tasks/[number]/loading.tsx @@ -0,0 +1,5 @@ +import { DetailSkeleton } from "@/components/ui/skeletons"; + +export default function Loading() { + return ; +} diff --git a/app/w/[workspaceSlug]/projects/loading.tsx b/app/w/[workspaceSlug]/projects/loading.tsx index 24e49c1f..a9b1d83e 100644 --- a/app/w/[workspaceSlug]/projects/loading.tsx +++ b/app/w/[workspaceSlug]/projects/loading.tsx @@ -1,5 +1,5 @@ -import { BrandPageLoader } from "@/components/brand/BrandLoader"; +import { CardsSkeleton } from "@/components/ui/skeletons"; export default function Loading() { - return ; + return ; } diff --git a/app/w/[workspaceSlug]/search/loading.tsx b/app/w/[workspaceSlug]/search/loading.tsx index 3303cefe..f262b769 100644 --- a/app/w/[workspaceSlug]/search/loading.tsx +++ b/app/w/[workspaceSlug]/search/loading.tsx @@ -1,5 +1,5 @@ -import { BrandPageLoader } from "@/components/brand/BrandLoader"; +import { ListSkeleton } from "@/components/ui/skeletons"; export default function Loading() { - return ; + return ; } diff --git a/app/w/[workspaceSlug]/settings/loading.tsx b/app/w/[workspaceSlug]/settings/loading.tsx new file mode 100644 index 00000000..fecb12e3 --- /dev/null +++ b/app/w/[workspaceSlug]/settings/loading.tsx @@ -0,0 +1,5 @@ +import { PageSkeleton } from "@/components/ui/skeletons"; + +export default function Loading() { + return ; +} diff --git a/app/w/[workspaceSlug]/t/[ref]/page.tsx b/app/w/[workspaceSlug]/t/[ref]/page.tsx index febf2503..654aa141 100644 --- a/app/w/[workspaceSlug]/t/[ref]/page.tsx +++ b/app/w/[workspaceSlug]/t/[ref]/page.tsx @@ -9,7 +9,7 @@ async function load(workspaceSlug: string, ref: string) { const context = await requireWorkspace(workspaceSlug, "GUEST"); const reference = parseTaskReference(decodeURIComponent(ref)); const task = reference ? await getTaskDetail(context, reference.number) : null; - if (!task || (reference?.key && task.project?.key !== reference.key)) return { context, task: null }; + // Numbers are unique per workspace: an old key (the task moved projects) still resolves. return { context, task }; } diff --git a/charts/spaceworks-workspace/README.md b/charts/spaceworks-workspace/README.md index a5b72d15..7cd75a23 100644 --- a/charts/spaceworks-workspace/README.md +++ b/charts/spaceworks-workspace/README.md @@ -1,5 +1,7 @@ # Space Works Workspace Helm chart +Helm chart for running Space Works Workspace on Kubernetes. Part of [Space Works Workspace](../../README.md); see also the [documentation index](../../docs/README.md). + Runs the application on Kubernetes: a Deployment (non-root, read-only root filesystem), a Service, an optional Ingress, a pre-install/pre-upgrade migration Job, worker and beat Deployments, a PodDisruptionBudget and an optional HPA. diff --git a/components/brand/SpaceWorksLogo.tsx b/components/brand/SpaceWorksLogo.tsx index 0495dc19..bc094110 100644 --- a/components/brand/SpaceWorksLogo.tsx +++ b/components/brand/SpaceWorksLogo.tsx @@ -88,7 +88,7 @@ export function SpaceWorksLogo({ variant = "lockup-horizontal", tone = "full", a /** * The product lockup for headers: the horizontal Space Works lockup, a thin - * rule, and "Workspace" in Gilroy 600. The rule and label sit a clear space + * rule, and "Workspace" in Outfit 600. The rule and label sit a clear space * (¼ of the lockup height) away from the artwork. */ export function SpaceWorksWorkspaceLogo({ height = 48, label = "Space Works Workspace", className }: { height?: number; label?: string | null; className?: string }) { diff --git a/components/chrome/AppShell.tsx b/components/chrome/AppShell.tsx index d60e0497..fd7e7a5a 100644 --- a/components/chrome/AppShell.tsx +++ b/components/chrome/AppShell.tsx @@ -1,11 +1,11 @@ "use client"; -import { useEffect, useRef, useState, type ReactNode } from "react"; +import { Suspense, useEffect, useRef, useState, type ReactNode } from "react"; import Link from "next/link"; import { usePathname, useRouter } from "next/navigation"; import { signOut } from "next-auth/react"; import * as DialogPrimitive from "@radix-ui/react-dialog"; -import { ChevronsUpDown, LogOut, Moon, Sun } from "lucide-react"; +import { ChevronsUpDown, Inbox, LogOut, Moon, Sun } from "lucide-react"; import { cn } from "@/lib/cn"; import type { ShellData } from "@/lib/appShell"; import { activeNavKey } from "@/lib/nav"; @@ -15,29 +15,10 @@ import { useAppColorMode } from "@/components/providers"; import { useRealtime } from "@/components/realtime/useRealtime"; import { Avatar } from "@/components/ui/display"; import { IconButton } from "@/components/ui/button"; +import { RouteProgress } from "@/components/chrome/RouteProgress"; +import { NavLink, SidebarNav } from "@/components/chrome/SidebarNav"; import { Menu, MenuContent, MenuItem, MenuLabel, MenuSeparator, MenuTrigger } from "@/components/ui/menu"; -function NavLink({ href, active, children, onNavigate }: { href: string; active: boolean; children: string; onNavigate?: () => void }) { - const link = useRef(null); - useEffect(() => { - if (active) link.current?.scrollIntoView({ block: "nearest", inline: "nearest" }); - }, [active]); - return ( - - {children} - - ); -} - function WorkspaceSwitcher({ data, onNavigate }: { data: ShellData; onNavigate?: () => void }) { return ( @@ -120,7 +101,7 @@ function NotificationsLink({ data, onNavigate }: { data: ShellData; onNavigate?: aria-label={label} className="relative inline-flex size-11 shrink-0 items-center justify-center rounded-md text-ink transition-colors hover:bg-sidebar-hover" > - Inbox + {count > 0 ? ( {count > 99 ? "99+" : count} @@ -137,7 +118,10 @@ function SidebarContents({ data, onNavigate, headerAction }: { data: ShellData;
- + + + Workspace +
@@ -145,16 +129,7 @@ function SidebarContents({ data, onNavigate, headerAction }: { data: ShellData; {headerAction ?? }