1
0
Fork 0
Commit graph

263 commits

Author SHA1 Message Date
06fb1ede75 feat: new blueprint node types for data flow and logic
New node types:
- GameData: reads runtime state (structure health, deliveries, resources, etc.)
- Flag: read/write persistent flags by name
- Compare: A [op] B → boolean (>, <, ==, !=, >=, <=)
- Math: A [op] B → number (+, -, *, /)
- Format: template string with {0}, {1} placeholders → string
- Logic: A [op] B → boolean (AND, OR, XOR)
- NOT: boolean → inverted boolean
- Branch: flow in + boolean condition → true/false flow out
- Sequence: flow in → 3 flow outs (executes in order)

Toolbar updated with categorized buttons (Story, Data, Logic).
MiniMap color-coded for all 18 node types.
NodeEditDialog handles all new types with operator/field selectors.
2026-07-28 18:16:20 -04:00
9a7462e5f7 feat: typed socket foundation for LiteGraph-style blueprint editor
Phase 1 — Typed Socket Foundation:
- SocketType enum: flow, number, string, boolean, any
- Socket definitions for all 9 existing node types (inputs + outputs)
- TypedHandle component: color-coded circles (flow=white square, number=purple, string=teal, boolean=green, any=indigo)
- NodeHandles helper: auto-renders handles from socket config with proportional spacing
- isValidConnection: rejects type mismatches, any-type sockets accept all connections
- All existing nodes refactored to use NodeHandles instead of manual Handle components
2026-07-28 18:11:52 -04:00
cfba38ca24 refactor: switch all node types to left/right handles for L-to-R layout
- Updated handle positions:
  - Target: Position.Left (incoming edges from left)
  - Source: Position.Right (outgoing edges to right)
- Updated MiniMap nodeColor to color-code all 9 node types
- Maintains consistency across narrative, primitive, and control nodes
2026-07-28 17:49:48 -04:00
4a573f7cfc feat: add Wait and primitive node types to NarrativeFlowEditor
- 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
2026-07-28 17:44:46 -04:00
9651ad83ae fix: use span for close button to ensure true transparency
- Browser button elements have default background/border
- Span with onClick provides the same functionality with no defaults
- Maintains keyboard focus states and accessibility
2026-07-28 17:33:20 -04:00
fbaad2e4bb fix: close button is now transparent with solid X icon
- No padding, no border, no background on button
- X icon itself has text-zinc-500 color
- Only hover background tint on the button
2026-07-28 17:30:40 -04:00
8ddca4d647 refactor: simplify close button to transparent X icon only 2026-07-28 17:29:38 -04:00
56980eebd3 fix: add dark mode utility classes to NodeEditDialog inputs and buttons
- Add dark:bg-zinc-800 dark:border-zinc-700 dark:text-zinc-100 to all Inputs/Textareas
- Add dark:bg-blue-600 dark:hover:bg-blue-700 dark:text-white to Save button
- Add dark:border-zinc-700 dark:text-zinc-300 to Cancel, Add buttons
- Add dark:bg-red-900/60 dark:hover:bg-red-800/80 to destructive icon buttons
- Ensures dialog renders correctly inside Payload admin portal context
2026-07-28 17:23:10 -04:00
fe863845bb refactor: use shadcn components in NodeEditDialog, add Textarea component
- Replace raw <textarea> with shadcn Textarea component
- Replace raw <button> with shadcn Button (variant='destructive' + icon)
- Remove custom className overrides fighting admin dark theme
- Add shadcn preference rule to AGENTS.md
2026-07-28 16:28:14 -04:00
103340271b feat: narrative events flowchart editor with React Flow
- 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
2026-07-28 16:26:57 -04:00
6efb1e1d65 chore: remove unused LogisticsEvents collection
- Dead collection — never registered in payload.config.ts
- Superseded by the new GameEventLogs event log system
2026-07-28 16:11:48 -04:00
9fd4b22d90 docs: comprehensively document event log system in AGENTS.md
- Update schema to reflect system field, targetCollection select options,
  and access controls (read/create for all, update for admins/devs,
  delete for devs only)
- Document narrative event creation workflow for GM/admin use
- Document EventLedger UI behavior: refreshKey prop, 30s polling, actor
  prefix with 'You' substitution, multi-select type filter, narrative
  styling, flicker-free re-fetch
- Add step-by-step guide for adding event logging to new actions
- Document non-structure events limitation and future pattern
2026-07-28 16:09:48 -04:00
dfbe0cb6c5 feat: add EventLedger UI component with live updates and filtering
- 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
2026-07-28 16:08:13 -04:00
5679020b42 feat: wire storage actions and collection hooks to emit game events
- Emit events from all storage/grid server actions: addResource,
  removeResource, transferResource, placeResourceOnGrid, moveGridItem,
  mergeGridStacks, rotateGridItem, removeGridItem, splitGridStack,
  retrieveFromVoid, and autoArrangeGrid
- Add afterChange hook on GameStructures to capture admin-panel edits
- Emit structure:resize event from Structures beforeChange hook on grid
  dimension changes
2026-07-28 16:08:08 -04:00
59769076ff feat: add GameEventLogs collection and event emission infrastructure
- 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
2026-07-28 16:08:04 -04:00
d88fe04b56 fix(grid): prevent split collision by including source in overlap check
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.
2026-07-28 14:51:56 -04:00
256e5bd68a fix: use arbitrary box-shadow for hover inset effect 2026-07-28 14:47:47 -04:00
f1871ec889 feat(ui): add hover scale and shadow to structure cards 2026-07-28 14:37:24 -04:00
a456c8a246 refactor(nav): replace Storage page with Structures list at /logistics
- 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
2026-07-28 14:23:04 -04:00
5d146f22bf fix(security): restrict deposit/withdraw to admin/dev, allow transfer/reorganize for users
- 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
2026-07-28 14:17:52 -04:00
01ac20f44f fix(ui): add router.refresh after storage mutations, pluralize labels
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").
2026-07-28 14:03:43 -04:00
a4844efe22 feat(grid): integrate grid view into structure detail page
Replace flat ResourceList with StructureStorageView (grid/list
toggle for structures with dimensions, flat list fallback for
non-grid structures). Apply pluralize to upkeep labels.
2026-07-28 14:03:39 -04:00
9175b103c2 feat(grid): add drag-and-drop grid UI components
GridCell — droppable cell with hover/valid/invalid state
GridItem — draggable item with grip icon, visual feedback
GridToolbar — view toggle, auto-arrange, selected-item actions
InventoryGrid — DndContext wiring, R-key rotation, ResizeObserver
  cell sizing, drag overlay
StructureStorageView — client wrapper with grid/list mode toggle,
  action handlers, resource-to-GridItem mapping
2026-07-28 14:03:34 -04:00
d2222e8701 feat(grid): add grid-aware server actions
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
2026-07-28 14:03:00 -04:00
7bcbd534e4 feat(grid): add grid utility functions
- 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
2026-07-28 14:02:52 -04:00
d0262baab8 feat(deps): add @dnd-kit/core and @dnd-kit/utilities
Required for drag-and-drop grid item movement in the storage
inventory view.
2026-07-28 14:02:46 -04:00
5982abfb05 feat(ui): add pluralize utility function
Handles irregular plurals, measurement units that stay singular,
and standard English pluralization rules.
2026-07-28 14:02:41 -04:00
159755af8d feat(collections): add grid fields to game-structures and resources schemas
GameStructures:
- Add gridX, gridY, rotated fields to storedResources rows
- Remove beforeValidate hook that merged duplicate resources
- Add read access (was missing)
- Add min: 1 constraint on amount

Resources:
- Add gridWidth, gridHeight, stackable, maxStackSize, rotatable fields
- Add read access (was missing)
- Wrap game-rules afterRead hook in try/catch to handle missing global
2026-07-28 14:02:35 -04:00
275cb49a92 fix: remove console.log from layout causing repeated page requests 2026-07-27 19:42:59 -04:00
866a470750 feat: cap Amount input max to stored amount and remaining capacity
- 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
2026-07-27 19:34:47 -04:00
b719f25ff2 feat: use resource unitOfMeasure instead of hardcoded kg, add capacity preview to manage dialog
- Replace hardcoded 'kg' labels with resource.unitOfMeasure in ResourceList
- Rename 'Max Mass' to 'Max Capacity' on structure detail page
- Add dynamic capacity preview bar to ManageStorageDialog deposit/withdraw/transfer tabs
- Add baseline capacity display above tabs in manage dialog
- Clean up unused imports across storage components
2026-07-27 19:27:53 -04:00
12d276d44d feat: implement storage system with capacity tracking and resource management
- Rebuild /logistics/storage overview with capacity bars, filters, and structure cards
- Add /logistics/structures/[id] detail page with resource list, storage rules, upkeep
- Add server actions for deposit, withdraw, and transfer of resources
- Add ManageStorageDialog with deposit/withdraw/transfer tabs
- Add capacity bar component with color-coded utilization
- Add StorageGrid, StructureCard, StorageFilters, ResourceList, StorageRules components
- Add logistics utility functions for mass calculations
- Install shadcn dialog, select, tabs, label components
2026-07-27 19:19:48 -04:00
0280d564f9 feat: add faction ownership to game-structures and relax factions read access
- Allow authenticated users to read factions (was developer-only)
- Add optional faction relationship field to game-structures
- Regenerate payload-types.ts
2026-07-27 19:19:41 -04:00
1eddf741ff feat: add AGENTS.md with technical documentation and configure email sending via Nodemailer 2026-07-27 17:48:43 -04:00
ff1f44832e feat: add approval status field to multiple collections with filtering for developer roles 2026-01-09 02:23:04 -05:00
1d55b50c86 chore: update to 0.1.6 2026-01-09 01:56:32 -05:00
ade5616c68 feat: add migration for experience table and update payload_locked_documents_rels 2026-01-09 01:55:56 -05:00
9cc08c386a chore: update to 0.1.5 2026-01-09 01:52:04 -05:00
2eb38c7a82 feat: enhance form descriptions with dynamic tick calculations and validations
- 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.
2026-01-09 01:50:55 -05:00
2f00722f30 chore: clean up unused imports in AppSidebar 2026-01-09 01:26:58 -05:00
d04630ca65 feat: add XP display component and experience collection, integrate user XP in layout 2026-01-09 01:26:40 -05:00
773f6a29c1 chore: update to 0.1.4 2025-12-23 01:03:14 -05:00
9426f12574 feat: add resources to technology schema, improve version display, and introduce migration for resource costs on technologies 2025-12-23 01:01:30 -05:00
d3fbb48422 chore: update to v0.1.3 2025-12-22 16:44:52 -05:00
f5d0ea98eb chore: rename patch script to deploy in package.json 2025-12-22 16:42:06 -05:00
c6fecb54f2 feat: add LAST_UPDATED environment variable, update VersionOverlay to display last updated timestamp, and introduce patch script 2025-12-22 16:41:29 -05:00
0bf874a991 feat: update to v0.1.2 2025-12-22 16:20:20 -05:00
bc4a11120f chore: move deploy script from version to postversion lifecycle 2025-12-22 16:08:34 -05:00
2727580c24 feat: display app version using environment variable and add VersionOverlay component, add migration for new database tables 2025-12-22 16:07:48 -05:00
fc9cbf9bf1 feat: update to v0.1.1 2025-12-22 12:41:12 -05:00