Skip to content

Commit c9eea45

Browse files
committed
docs: read me about how to update things
1 parent 7c6327e commit c9eea45

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,32 @@ Stories are managed via git subtrees. Because subtree remotes are not tracked by
8585

8686
---
8787

88+
## Developer Guide: How to Update Things
89+
90+
If you are modifying or expanding the functionality of Fezcodex, follow these specific architectural patterns:
91+
92+
### 1. Adding or Updating Commands
93+
Commands are used in the **Commands Page** and the **Command Palette**. To update them, you must touch three places:
94+
- **`src/data/commands.js`**: Update the UI data (title, description, icon color) for the `/commands` page.
95+
- **`src/hooks/useCommandRegistry.js`**: Implement the actual logic/handler for what the command does.
96+
- **`src/hooks/useSearchableData.js`**: Update the `customCommands` list so the Command Palette (`Ctrl + K`) can "find" the command.
97+
98+
### 2. Updating Search Data
99+
The site-wide search (Command Palette and Search bar) is powered by a unified registry:
100+
- **Automatic:** Blog posts, Projects, and Logs are automatically indexed from their respective `.json` and `.piml` files in the `public/` directory.
101+
- **Manual:** Static pages and custom commands must be manually added to the `staticRoutes` or `customCommands` lists in `src/hooks/useSearchableData.js`.
102+
103+
### 3. Modifying Visual Themes (Brutalist vs. Luxe)
104+
Every core component should be **Theme-Aware**:
105+
- **Switcher Components:** Components like `CommandPalette.jsx`, `SidePanel.jsx`, and `GenericModal.jsx` act as controllers. They detect `fezcodexTheme` and render either a `BrutalistX` or `LuxeX` variant.
106+
- **Universal Styles:** Prefer the `variant="brutalist"` or `variant="paper"` props for shared components like `CustomDropdown` to maintain consistency.
107+
108+
### 4. Global State & Persistence
109+
- Use `VisualSettingsContext.jsx` for any UI state that needs to survive a page refresh (Invert mode, Theme selection, etc.).
110+
- Use `usePersistentState` hook to automatically sync your context variables with `localStorage`.
111+
112+
---
113+
88114
## Github Pages Configuration
89115

90116
1. Deploy from a branch.

0 commit comments

Comments
 (0)