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>
- Emphasize stat values and keep labels on one line
- Rework the recent events feed into a two-line layout with human-readable type labels and narrative highlighting
- Resolve parents via subAssignments instead of inferred member overlap
- Drop cyclic or dangling subassignment edges
- Render members only at their deepest unit; widen unit boxes and pluralize member counts
- Add Account entry to the sidebar and user menu
- Hide Intelligence and Infrastructure sections unless the user is qualified
- Make the sidebar content area scrollable
- Support showing the callsign in the user menu via preferences
- Add hasIntelligenceQualification access helper
- Redirect non-qualified users away from /intelligence
- Hide mission and campaign widgets on the dashboard for non-qualified users
- Guard hasLogisticsQualification against a null user
- Add /notifications inbox with mark-read and mark-all-read actions
- Respect mutedAll/mutedTypes preferences when creating notifications
- Add View all link and Discord request label to the notifications bell
- Add trusted role and isTrusted access helper
- Add notification muting and display preferences to the user schema
- Auto-create a profile and personal bank account when a user signs up
- Add idempotent backfillProfiles seed script for existing members
Tarkov-style flea market where users list locker items at a fixed price
and buyers pay through the banking system; items transfer directly
into the buyer's locker.
- market-listings + market-negotiations collections and the market page
with search/rarity filters and a Countdown timer on each card
- service lib (buyListing with partial-quantity + negotiated-price
support, clean-stock rule, creditLockerQuantity, auto pricing)
- negotiation flow: make/accept/reject/counter/withdraw, strictly-
increasing buyer offers, NPC vendor auto-resolution
- NPC vendors: game-npcs attribution, patience meter, dialogue, chat
bubbles, historical threads dialog
- 30d user / 7d auto listing durations, market-tick bin for expiry +
vendor restock, SSE notify on tick
- market event types + game-npcs/market target collections in the
event log; sidebar Market entry under Logistics
- partial-quantity purchases (buyListing/buyMarketListing/makeMarketOffer)
with full int test coverage (25 tests)
Developer-gated collection for NPC characters, including the vendor
fields (enabled, priceModifier, sells[]) used by the marketplace to
attribute auto-generated listings to background merchants.
- user-notifications collection (per-user inbox, owner-scoped read)
- notifyUser() fire-and-forget helper + notification label mapping
- NotificationsBell in the site header with 30s polling, unread badge,
mark-read on click, and "Mark all read"
- markNotificationsRead / markAllNotificationsRead server actions
Regenerate payload-types.ts and payload-generated-schema.ts to cover
the forthcoming user-notifications, game-npcs, and market collections
(including the quantity column on market-negotiations).
- Revert onPointerDown back to onClick for item selection
- Add error state to display server action failures to user
- Add pending state to disable buttons during submission
- Update onPick to return ActionResult for error handling
- Change onClick to onPointerDown with preventDefault on item buttons
- Also update Cancel and Clear Slot buttons for consistency
- Fixes item selection not working inside the dialog
- Change onClick to onPointerDown with preventDefault
- Prevents Tooltip from intercepting the click event
- Slot picker dialog now opens reliably when clicking hotspots
- Add arrowClassName prop to TooltipContent component
- Pass bg-popover fill-popover to wardrobe tooltip arrow
- Arrow now matches the dark tooltip body instead of being white
- Change tooltip background from bg-foreground to bg-popover (dark)
- Increase text size from text-xs to text-sm
- Add border border-border for subtle definition
- Use font-semibold for slot name label
- Wrap each wardrobe slot button with shadcn Tooltip component
- Show slot name and current item name on hover
- Use smooth fade-in/zoom-in animation from shadcn tooltip
- Position tooltip to the right of each hotspot with 8px offset
- Add attachItemFromGrid server action for drag-drop attachment
- Add attach drop detection in LockerGrid handleDragEnd
- Add attach drop styling with amber highlight on weapon footprint
- Add isAttachDrop prop to GridCell for attach-specific feedback
- Add dragError state with 5s auto-clear for attach failures
- Reuse setItemAttachment/removeItemAttachment semantics
- Handle slot replacement with no-room fallback for old attachments
- Add EquipmentEditorDialog for per-category attachments, skins, and custom names
- Add Wardrobe component with soldier image and clickable equipment slots
- Add WardrobePanel with loadout selector and current equipment display
- Add WardrobeSlotPicker dialog for equipping items from locker
- Add equip/unequip loadout functionality with equipped badge
- Add equipment schema to LockerStorages (attachments, skin, customName)
- Add wardrobe slot layout with hotspot positions for each equipment type
- Add locker:item-attach, locker:item-detach, locker:item-skin event types
- Update LoadoutCard to show equipped status and equipment list
- Update LoadoutsPanel to pass ownedItems for equipment display
- Add Intelligence section with Campaigns, Missions, and Factions links
- Add Roster link to main navigation
- Update Logistics section with Resources and Vehicles links
- Update XPDisplay prop from xp to xpLevel for level resolution
- Remove commented-out navigation items
- Add commandAssignments and intelAssignments to GameRules global
- Implement role-based read access for missions (developer, admin, command, intel)
- Add visibility levels: unit, leadership, intel, private
- Restrict draft missions to authors, zeus, command, and intel
- Change faction field from text to relationship in missions
- Make missionFile optional in game setup
- Add RibbonDesigner admin component for visual ribbon design
- Add MedalDesigner admin component for visual medal design
- Add ribbonDesign and medalDesign JSON fields to Awards collection
- Conditionally show design fields based on award type
- Add profile page at /profile/[username] showing user service record
- Update NavUser dropdown to link to Service Record instead of Upgrade to Pro
- Remove unused Billing menu item from user dropdown
- Add resources list page with resource cards and detail pages
- Add vehicles list page with vehicle cards, filters, and detail pages
- Add ResourceCard, VehicleCard, and VehicleFilters components
- Widen structure detail page max-width from 4xl to 7xl
- Add campaigns list page with campaign cards
- Add missions list page with filtering and mission cards
- Add factions list page with faction cards
- Add mission detail components: briefing, comms, factions, logistics, objectives, roles
- Add MissionFilters for status and type filtering
- Redesign homepage as authenticated operations dashboard
- Add ProfileSummary, MissionBriefing, RecentEvents, QuickStats components
- Add UpcomingMissions and ActiveCampaigns sidebar widgets
- Redirect /dashboard to / (homepage is now the dashboard)
- Show welcome screen with login link for unauthenticated users
- Add resolveLevel utility to compute level name, progress, and XP thresholds
- Add seedExperience script for populating experience levels
- Update XPDisplay to show level name, progress bar, and percentage to next level
- Update layout to fetch experience levels and pass resolved XP data to sidebar
- NodeShell component wraps all nodes with handle rendering + px-8 content padding
- Handles positioned at node edges with labels outside (no overlap with content)
- Labels: 9px mono font, full opacity, color-matched to socket type
- Removed old TypedHandle + NodeHandles (replaced by NodeShell internals)
- All 18 node components updated to use NodeShell
- Format node dynamically generates handles from template {0}, {1}, etc.
- TypedHandle now shows tiny 8px labels next to handles (color-matched)
- Labels positioned outside the handle, no overlap with node content
- Format node dynamically generates input handles from template {0}, {1}, etc.
- NodeHandles accepts dynamicInputs/dynamicOutputs overrides
- isValidConnection treats dynamic handles (arg-*, option-*) as any-type
- New node types:
- Wait: delays execution for N ticks, supports optional input
- Number: stores a numeric value
- String: stores a string value
- Random: generates random numbers in range [min, max]
- Boolean: stores true/false flag
- Date: stores a date value
- Color-coded nodes matching React Flow palette:
- Wait: yellow
- Number: purple
- String: teal
- Random: pink
- Boolean: emerald
- Date: cyan
- NodeEditDialog now handles all new types with appropriate fields
- Toolbar updated with color-matched buttons
- Browser button elements have default background/border
- Span with onClick provides the same functionality with no defaults
- Maintains keyboard focus states and accessibility
- NarrativeEvents collection redesigned with flowData JSON (React Flow format)
- Custom admin field component: NarrativeFlowEditor with @xyflow/react
- Three node types: NarrativeBeat (blue), Choice (amber), Outcome (emerald)
- NodeEditDialog with type-specific forms replacing prompt() editing
- Right-click context menu (Delete node/edge with Radix primitives)
- Dynamic handles on Choice nodes (one per option)
- Dark-themed canvas with MiniMap, Controls, and animated edges
- All changes sync bidirectionally with Payload form state
- AGENTS.md updated with architecture docs
- Client-side EventLedger component that queries game-event-logs REST API
for a given structureId and renders a scrollable feed
- Actor name prefix with 'You' substitution for the current user, messages
lowercased to fit sentence syntax
- Multi-select dropdown filter (shadcn DropdownMenuCheckboxItem) for event
types with PascalCase formatting
- Narrative/GM events (system: false) styled with amber accent + book icon
- Smart refresh: smooth re-fetch without clearing existing entries, 30s
polling interval, and instant refreshKey trigger from parent actions
- New game-event-logs collection with timestamp, type, message, actor,
structure, targetCollection/targetId, and data (JSON) fields
- EventTypes constants registry for modular event category management
- emitGameEvent() utility for emitting events from server actions and hooks
- Register collection in Payload config
- Document event log system architecture in AGENTS.md
Server action: remove 'other.id === entryId' exclusion from the
split overlap scan so the source item's own footprint is treated
as occupied, forcing the split to find a different position.
UI: disable the split button via findEmptySpot check when no room
exists for the split stack, preventing a failed action.
- Move storage overview from /logistics/storage to /logistics root
- Rename page heading and sidebar label from Storage to Structures
- Update back link on structure detail page
- Remove old /logistics/storage route
- addResource, removeResource, placeResourceOnGrid, removeGridItem
now require admin or developer role (game master operations)
- transferResource, moveGridItem, mergeGridStacks, rotateGridItem,
splitGridStack, autoArrangeGrid require user, admin, or developer
(logistics operations that don't change total inventory)
- Guests are excluded from all mutating operations
ManageStorageDialog now calls router.refresh() after deposit,
withdraw, and transfer so the grid view reflects changes.
Await fetchData() before refreshing.
Resource labels now use pluralize() for correct unit display
(e.g. "1 liter" vs "3 liters").
Replace flat ResourceList with StructureStorageView (grid/list
toggle for structures with dimensions, flat list fallback for
non-grid structures). Apply pluralize to upkeep labels.
addResource now auto-places deposited resources onto the structure
grid (first-fit scan, fills existing stacks first, falls back to
flat-list behavior for non-grid structures).
New server actions:
- placeResourceOnGrid — explicit placement at x,y,rotated
- moveGridItem — move item to new position with optional rotation
- mergeGridStacks — merge two stacks of the same resource
- rotateGridItem — toggle rotation in-place
- removeGridItem — delete a grid entry
- splitGridStack — split a stack into two at an empty spot
- autoArrangeGrid — re-pack all items into grid
- GridItem type and GridDimensions helper type
- getItemFootprint: effective size accounting for rotation
- getOccupiedCells: list of "x,y" cell keys
- isValidPlacement: overlap and bounds checking
- findEmptySpot: first-fit scan for available placement
- autoArrangeItems: pack items into grid
- getGridOccupancy: used/total cell counts
- Withdraw/Transfer tabs: max = currently stored amount of selected resource
- Deposit tab: max = remaining capacity divided by resource massPerUnit
- Amount auto-clamps when resource selection changes
- Show 'Max: X' hint below each amount input
- Replace static descriptions in admin fields with dynamic `TickDurationDescription` components.
- Add minimum and maximum constraints to duration fields in various schemas.
- Update `TickDurationDescription` to use `useField` hook for better form integration.
- Added Google Fonts import for `Geist` and `Geist Mono` to `styles.css`.
- Aligned, cleaned styling variables and properties consistently.
- Updated `seedUsers.ts` to include a developer role.
- Introduced `bun.lock` file for dependency management.