Refactors grantAward to accept an array of recipientUserIds, adds
duplicate-award and eligibility checks per recipient, and returns a
per-recipient result summary. GrantAwardDialog gains a third step
showing grant results when some recipients fail. RecipientPicker is
rewritten to support multi-select with chip-based selected state and
a maxSelections cap.
Add transfer workflow components and utilities:
1. Transfer types and core functions (src/lib/transfers/index.ts):
- Type-safe transfer request and decision creation
- Appeal, cancel, and resolve core functions
- Server action conventions with error handling
2. Transfer UI components (src/components/frontend/transfers/):
- TransferActionDialog.tsx: Handle approval/rejection appeals
- TransferApprovalCard.tsx: Display approval decisions
- TransferNoteDialog.tsx: Add notes for transfers/appeals
- TransferRequestCard.tsx: Show transfer request details
- TransferResolutionCard.tsx: Display superuser resolutions
- TransfersView.tsx: Main transfers list page
- transferTypes.ts: Shared TypeScript types
3. Notification types (src/lib/transfers/notificationTypes.ts):
- Define notification type constants for transfer events
- Include TRANSFER_NOTIFICATION_TYPES for bridge filtering
4. Integration tests (tests/int/):
- transfer-requests.int.spec.ts: Test bot request polling
- transfer-bot-delivery.int.spec.ts: Test Discord notification delivery
These components and utilities complete the transfer workflow
implementation including approvals, appeals, and delivery.
Add AssignmentCard component integration showing user's assignments with transfer button.
Add RequestTransferDialog integration for requesting transfers.
Display current assignments as badges with leader indication.
Include proper loading states and error handling.
Update Payload configuration:
- Import AssignmentTransfers collection in src/payload.config.ts
Update notification system:
- src/lib/notifications/index.ts: Add transfer notification types
- Update notification helper to support new notification types
Update migrations index:
- src/migrations/index.ts: Register new assignment transfer migrations
These changes integrate the AssignmentTransfers collection into the
existing Payload configuration and notification infrastructure.
Add React components for assignment transfer user interface:
1. AssignmentCard.tsx: Display user's current assignment with transfer button.
Shows assignment details, current status, and allows initiating transfer requests.
2. RequestTransferDialog.tsx: Modal dialog for creating transfer requests.
- Selects target assignment from assignment list
- Optionally notes required for transfer
- Submits request to AssignmentTransfers collection
- Emits AssignmentTransferRequest event
3. Transfers page (src/app/(frontend)/transfers/): Transfer request list view.
- Requests card showing pending requests with requestor, target, current
- Approval cards for assignment leaders
- Appeal cards for rejected requests
- Completed/Cancelled status display
All components use shadcn/ui primitives, proper loading states, error handling,
and provide accessible keyboard navigation.
Add Discord bot services for assignment transfer interactions:
1. transferInteractions.ts: Handle button interactions for transfer requests,
approvals, rejections, appeals, completions, and cancellations.
2. transferRequests.ts: Poll for pending assignment transfers and trigger
notification delivery to Discord when status changes to pending/approved/rejected.
3. transferDelivery.ts: Deliver transfer notifications to users via DMs with
embeds showing status, details, and actions (approve/reject/appeal).
4. transferMessaging.ts: Provide Discord embed building for transfer messages
with status badges and action buttons.
5. Update bot index.ts: Add transfer button interaction handler with customId prefix "ptf-xfer:"
6. Update notificationBridge.ts: Exclude transfer notification types from general
notification polling to avoid duplication (Phase 2 feature).
Integration: Services are started via src/bot/services/index.ts and run alongside
existing mission and notification services.
Add event logging constants for assignment transfer events:
- AssignmentTransferRequest: Request initiated by user
- AssignmentTransferApprove: Leader approved transfer
- AssignmentTransferReject: Leader rejected transfer with reason
- AssignmentTransferAppeal: User appealed a rejection
- AssignmentTransferResolve: Final resolution by superuser
- AssignmentTransferComplete: Transfer completed successfully
- AssignmentTransferCancel: Transfer cancelled
Add assignment-transfers to GameEventLogs TARGET_COLLECTIONS
Add emitGameEvent support for all transfer event types in src/utils/event-log/emit.ts
This provides audit trail and notification support for the transfer workflow.
Add new AssignmentTransfers collection with fields for managing assignment transfer requests:
- requestor, requestedAssignment, currentAssignment (relationships to users/assignments)
- status (pending/approved/rejected/appealed/escalated/completed/cancelled)
- rejectionReason, appealReason (for rejections and appeals)
- transferAt, approvedAt, appealedAt, completedAt (audit timestamps)
- transferLead (relationship to users, current and requested assignment leaders)
- requestMessage, appealMessage (optional context messages)
Add database migrations:
- 20260831_180233_assignment_transfers: Create the main collection table
- 20260901_014006_add_assignment_transfer_event_target: Add assignment-transfers to GameEventLogs target collections
The collection enables the assignment transfer workflow where users can request transfers,
leaders can approve/reject with reasons, and users can appeal rejections.
Add a Profiles afterChange hook that diffs progression.awards against previousDoc (row id, falling back to award+date composite key) and sends an award:granted notification including the grant reason and issuer. Register award:granted as a muteable notification type.
- importArmaLibrary: upsert Arma export catalog into assets/vehicles via
Payload, materialize .paa thumbnails (convertPaaToPng) and link uploads,
resolve Fuel resource for vehicle fuel defaults
- extractArmaIcons: ref-driven PBO .paa extraction into a --paa-root tree
shaped like inventory icon ref paths
- package.json: add import:arma script
When the structure type has an image, render it as a full-bleed
cover behind the page header with vertical and horizontal gradient
overlays; text shifts to white for contrast. Headers without an
image keep the previous plain layout.
Add src/tools/cli with a CliFlow helper (boxed headers, labeled log
lines) and a reset-password command stub wired to the prompt package.
Runnable via 'bun run u:reset-password'; interactive flow to follow.
Add gap-1.5 to the roster tab triggers so icons and labels are not
glued together, and let the org chart tab scroll horizontally instead
of overflowing the page.
requireArmaServer (src/lib/arma-bridge/server.ts) wraps the shared
bridge auth + game-servers lookup that every v1 route repeated;
asJson (json.ts) narrows untrusted request values to what Payload's
json field validation accepts (strings normalize to the fallback
instead of failing the write). All four v1 routes now use both.
Also document the ARMA_BRIDGE_API_KEY env var missed when the bridge
routes landed.
Add the mission-tick Payload bin (external cron): sweeps missions
whose status is Scheduled/Active and whose scheduled calendar day
(classification.startDateTime, server-local) has fully passed and
sets them to Completed, emitting a mission:auto-complete event per
mission. Draft and terminal statuses are never touched; idempotent.
Notifies clients via the game-tick SSE path.
Logic lives in src/lib/intelligence/missionLifecycle.ts with an
integration test in tests/int/mission-lifecycle.int.spec.ts.
Cloning a mission whose array rows still carry the source doc's row
ids trips a unique-constraint violation in the drizzle adapter,
surfacing as 'ValidationError: The following field is invalid: id'.
Walk the collection's field schema (groups, tabs, rows, nested
arrays) and strip row ids before create — schema-driven so Lexical
richText blobs are cloned verbatim.
Also adopt the bin file logger and the standard fatal-error exit
path.
Add createBinLogger (src/scripts/lib/binFileLogger.ts): every log call
is appended synchronously to logs/<bin-key>/<YYYY-MM-DD>.log (UTC) in
addition to the console logger — sync writes because bin scripts
process.exit() immediately. Bin bodies are wrapped in try/catch so a
fatal error is logged to file and exits code 1. Override the directory
with BIN_LOG_DIR. logs/ is gitignored.
game-tick, market-tick, and processShipmentTick adopt the logger;
generate-mission follows with its clone fix; mission-tick lands with
its feature. Document BIN_LOG_DIR in .env.example and the logging in
AGENTS.md / README.
Mission objectives gain a redacted checkbox. Redacted objectives are
shown block-redacted to players; mission managers, authors, and Zeus
see the real text (via tooltip) and can toggle the flag from the
mission detail page. Toggles emit mission:objective-redacted-toggle
events. Also registers the mission:auto-complete event type used by
the upcoming mission-tick bin.
With the MCP plugin enabled, payload.auth() can return a
payload-mcp-api-keys doc instead of a User. Add an isPayloadUser
type guard and use it in every server action, page, and route that
treats the auth result as a real user, so API-key sessions can no
longer pass user auth checks. hasRoles now explicitly requires a
users-collection doc.
Register mcpPlugin on the Payload config. Auth now also accepts
payload-mcp-api-keys, so the generated types carry the new
collection and the user union widens accordingly. Follow-up commits
guard user auth paths against these API-key sessions.
Also apply incidental prettier formatting to generatePlainText().
Move Banking and Market out of Logistics into a commerce group beside Personal, and add a quick XP mini-mode toggle synced to the saved display preference via the layout-provided preferences prop.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add the mini XP display switch to PreferencesForm, wire it through the account page, and cover it in the integration test.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add the xpDisplayMini checkbox to user display preferences, regenerate types, and accept it in updatePreferences.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Thread the Payload request through createAccount/ensurePersonalAccount and the Users beforeChange hook writes so nested creates share the parent transaction instead of failing FK checks on a fresh connection.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add key-and-server-id authenticated endpoints for server heartbeat, event ingestion, and command pull/ack.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add GameServers, ArmaSyncEvents and ArmaCommands collections plus registration in payload config and regenerated types.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add domain-specific AGENTS.md files for collections, components, lib,
utils, and bot. Add login-return-url case study documenting the
return-URL flow design decisions and debugging lessons learned.
Replace legacy role-name checks in isStaff with hasPermission(discord:staff).
Auto-assign the 'user' role document on signup. Import hasPermission in
announce command for future permission gating.
Add LoginLink client component that captures current path via usePathname()
and passes it as returnTo query param. Update login page to read and
sanitize returnTo (open-redirect guard: must start with /, reject //).
Update LoginForm to redirect to returnTo after successful login. Wire
LandingPage CTA through LoginLink. Add returnTo redirect for already-
authed users hitting /login. Add return-URL to flappy page redirect.
Remove trailing blank line from (frontend) layout.
Replace hasRoles calls with hasPermission in all server actions and page
components. Update qualification checks (logistics, intelligence) to use
permission-based checks instead of role name matching. Update staff lookup
in tickets/staff.ts to query roles collection. Use enlistmentDate field
on profile page instead of createdAt.
Replace legacy isDeveloper/isAdmin/hasRoles checks with
hasPermission/requirePermission across all collections. Add roleDocs
relationship to Users, enlistmentDate to Profiles, and field-level
intel_excerpt permission gate on Profiles. Auto-generated payload-types
updated to reflect the new Roles collection and roleDocs field.
Introduce a dynamic RBAC system with a new 'roles' collection that grants
granular permissions. Add hasPermission/requirePermission/loadUserPermissions
utilities and a central permissions registry. Register the Roles collection in
payload.config and add roleDocs relationship to Users.
- Fetch current user's leadOrActual preference in roster page via payload.auth()
- Add RosterDisplayContext to avoid prop drilling through org chart components
- MemberCard shows 'Lead' or 'Actual' based on user preference
- Add preference radio buttons to PreferencesForm under Display section
- Update updatePreferences server action to save leadOrActual
- Add TODO for restyling radio buttons later
Move old migrations (20260109 through 20260817) to _archived/ and add a
single consolidated migration (20260818_024510). Update the migrations
index to reference only the new migration.
Wire CommandPalette/Provider into the frontend layout and add Cmd+K
hint in the SiteHeader. Register context-aware commands for banking,
helpdesk, mission RSVP, locker, shipments, and market pages.
Also removes the locker search's duplicate Cmd+K listener (now handled
globally), renames its button to 'Search Locker', and cleans up a
flappy page parenthetical.
- Add showCloseButton prop to DialogContent for modal workflows
- Add line variant to TabsList via class-variance-authority
- Add arrowClassName prop to TooltipContent for arrow styling
- Add optional title prop to CommandDialog for accessibility
- Add Unsloth OpenAI-compatible provider with @ai-sdk/openai
- Rewrite AI generation handlers with Vercel AI SDK streaming
- Add plainTextToLexicalJson helper for richText field generation
- Configure HeadingFeature and PayloadAiPluginLexicalEditorFeature
- Stub @payloadcms/richtext-lexical server entry in client bundle
- Extract meta constants for site title and description
- Add UNSLOTH_API_KEY to .env.development
The shadcn component update pulled sidebar.tsx using Tailwind v3-style
bare-bracket custom property syntax (w-[--sidebar-width]). Under Tailwind
v4 this compiles to invalid CSS (width: --sidebar-width) which the browser
ignores, so width fell back to auto and the fixed sidebar blew out to its
content's intrinsic width (the 1372px logo header ~ half the page). The
empty spacer div was equally broken, reserving zero space and leaving the
inset m-2 margin as a stray left gap.
Three fixes:
- sidebar.tsx: wrap all 7 bare-bracket custom properties in var() so they
compile to width: var(--sidebar-width) / var(--sidebar-width-icon) /
max-width: var(--skeleton-width). The calc(var(...)) rules were already
valid; only the bare forms were broken.
- layout.tsx: replace the raw <main className="min-h-full bg-background
w-full"> with <SidebarInset>. AppSidebar uses variant="inset", whose
peer styling (md:peer-data-[variant=inset]:m-2 / :rounded-xl / :shadow)
only applies to a SidebarInset sibling, so the inset gap/rounding/shadow
were silently dropped.
- SiteHeader.tsx: replace the raw <div> + border-gray-800 + p-4 with the
standard shadcn <header className="flex h-16 shrink-0 items-center gap-2
border-b px-4"> using semantic border-b, plus -ml-1 on SidebarTrigger
and an ml-auto wrapper for NotificationsBell (which takes no className).
Verified via the running dev server: SSR HTML carries
data-variant="inset", a single <main> with the peer-data-[variant=inset]
classes, <header ... border-b>, and zero border-gray-800 occurrences.
tsc --noEmit clean for the changed files.
Import the migrations array from src/migrations/index.ts and pass it as prodMigrations to the postgres adapter. Per @payloadcms/db-postgres connect.js, when NODE_ENV=production the adapter now auto-runs payload migrate against this array on every boot, so pending migrations apply on deploy without a manual docker exec step. Idempotent on next prod boot since payload_migrations already tracks batches 1-2. DEPLOYMENT.md §7's manual 'docker exec ... payload/bin.js migrate' still works as a fallback via filesystem discovery.
Migration 7 originally bundled tickets DDL with pending schema drift, which made it fail against prod (no tickets objects existed there). Split into a stripped migration 7 (no tickets statements) and a new tickets-only migration 8 that creates enum_tickets_* types, ALTER TYPE ADD VALUE for 'tickets' + 'ticket:*' muted-type values, tickets and tickets_activity tables, and the payload_locked_documents_rels.tickets_id column + FK + index. Migration 8's .json snapshot is the new forward baseline for migrate:create (verified via zero-diff probe). Applied to prod: m1-7 baselined as batch 1, m8 applied as batch 2.
Coolify strips .git from the build context, so git CLI calls in
generate:version-info fail during Docker builds. The script now
resolves metadata in priority order: GIT_* env overrides, then
SOURCE_COMMIT (Coolify's injected build arg, shortened to 7 chars),
then git CLI fallback for local builds. Dockerfile passes the ARGs
through as ENV before the build; DEPLOYMENT.md documents the required
'Include Source Commit in Build' setting.
The generated migration added grid_x/grid_y as numeric NOT NULL without a
default, which fails on prod where game_structures_stored_resources already
has rows ('column contains null values'). Add the columns with DEFAULT 0 to
backfill existing rows, then drop the default to match the target schema.
Use the shadcn Alert component for the file-sharing hint instead of a bare Message element.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add migration 20260816_213455 covering the Tickets collection plus all schema drift accumulated since 20260109 (banking, market, game vehicles/NPCs, attendance, enum extensions).
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add the Helpdesk nav item with LifeBuoy icon under the core nav group.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add the helpdesk list page and ticket detail page routes.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add createTicket, replyToTicket, updateTicketStatus, and assignTicket server actions with notification and event-log emission.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add the helpdesk Tickets collection with status/priority/category enums, reporter/assignee relationships, activity timeline, and closedAt lifecycle. Register in payload.config and refresh generated types.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Register a beforeNav component linking the Payload admin panel back to the public frontend.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add a scope field to BotCommand so /signup, /link and /ping register globally (available in DMs — guild-scoped commands never appear there) while /announce stays guild-only. Migrate ephemeral replies to MessageFlags and make the /signup welcome message resilient to blocked DMs.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>