-
Notifications
You must be signed in to change notification settings - Fork 0
Feature RuleZ UI Tasks
Rick Hightower edited this page Jan 28, 2026
·
1 revision
Feature ID: rulez-ui Status: M1 Complete, M2-M8 Pending Total Estimated Days: 9.5 (Phase 1 MVP) PR: #72 (merged to develop) Last Updated: 2026-01-25
- Create
rulez_uidirectory at project root - Initialize Bun project:
bun init - Add Tauri 2.0:
bunx create-tauri-app - Configure TypeScript with strict mode
- Set up Tailwind CSS 4
- Configure Biome for linting/formatting
- Create basic directory structure
- Create
src/lib/tauri.tswithisTauri()detection - Implement web fallback pattern for all Tauri commands
- Add mock data module for browser testing
- Verify HMR works in both modes
- Create
.github/workflows/rulez-ui.yml - Configure Bun installation
- Add lint, typecheck, test stages
- Configure Tauri build for release artifacts
- Install
@monaco-editor/react - Create
YamlEditor.tsxcomponent - Configure YAML language mode
- Add syntax highlighting
- Implement line numbers
- Implement Cmd/Ctrl+S save shortcut
- Add undo/redo support
- Enable code folding
- Configure editor options (font, theme)
- Create
EditorToolbar.tsx - Add Save button
- Add Format button
- Add Undo/Redo buttons
- Show file modified indicator
- Create
public/schema/hooks-schema.json - Define version, settings, rules structure
- Add matchers and actions definitions
- Include all CCH field types
- Add descriptions for autocomplete
- Install
monaco-yaml - Configure schema validation
- Map schema to hooks.yaml files
- Enable inline error markers (red squiggles)
- Configure JSON Schema autocomplete
- Add custom completion providers if needed
- Test completion for all rule fields
- Verify nested structure completion
- Create
ValidationPanel.tsx - Display errors with line numbers
- Display warnings
- Implement click-to-jump-to-line
- Show error count in status bar
- Create
src-tauri/src/commands/config.rs - Implement
list_config_filescommand - Implement
read_configcommand - Implement
write_configcommand - Register commands in Tauri app
- Create
src/stores/configStore.tswith Zustand - Implement
loadConfigaction - Implement
saveConfigaction - Track file modified state
- Handle multiple open files
- Create
FileSidebar.tsx - Display global config path
- Display project config path
- Show file exists/not exists indicator
- Handle file selection
- Create
FileTabBar.tsxandFileTab.tsx - Support multiple open tabs
- Show modified indicator
- Implement tab close with save prompt
- Create
RuleTreeView.tsx - Parse YAML to tree structure
- Display settings section
- Display rules section
- Add collapsible sections
- Show rule name prominently
- Display tools list
- Show action type badge (Block/Inject/Run)
- Add enabled/disabled toggle
- Click rule to jump to editor line
- Sync tree selection with cursor position
- Highlight currently selected rule
- Create
src-tauri/src/commands/debug.rs - Execute
cch debugwith parameters - Parse JSON output
- Return structured result
- Handle errors gracefully
- Create
EventForm.tsx - Add event type dropdown (all 7 types)
- Add tool name input with suggestions
- Add command input
- Add path input (optional)
- Create
ResultView.tsx - Display outcome (Allow/Block/Inject)
- Display reason if blocked
- Show execution time
- Create
EvaluationTrace.tsx - List all rules evaluated
- Show match status per rule
- Display evaluation time per rule
- Show match details (pattern, input)
- Create
DebugSimulator.tsxcontainer - Wire up Tauri command invocation
- Implement web fallback with mock data
- Add loading state
- Create
src/stores/uiStore.ts - Detect system preference on load
- Implement manual toggle
- Persist preference to localStorage
- Create
ThemeToggle.tsx - Add sun/moon icons
- Wire up to uiStore
- Create
src/styles/monaco-theme.ts - Define light theme
- Define dark theme
- Switch theme with app theme
- Configure CSS variables for colors
- Implement dark mode classes
- Test all components in both themes
- Install Playwright:
bun add -d @playwright/test - Create
playwright.config.ts - Configure web server for testing
- Add test fixtures
- Test editor loads with content
- Test validation error display
- Test autocomplete functionality
- Test save keyboard shortcut
- Test event form inputs
- Test simulation execution
- Test result display
- Test evaluation trace
- Test file sidebar display
- Test tab management
- Test save confirmation
- Add Playwright to CI workflow
- Configure test artifacts
- Generate test reports
- Code complete and compiles
- Unit tests written (if applicable)
- Component renders correctly
- Works in both Tauri and web mode
- Linting passes (
bun run lint) - Type checking passes (
bun run typecheck) - Reviewed in PR
cd rulez_ui
bun install # Install dependencies
bun run dev # Start dev server (browser)
bun run dev:tauri # Start dev server (Tauri desktop)
bun run lint # Run Biome linter
bun run typecheck # Run TypeScript check
bun run test # Run Bun unit tests
bun run test:e2e # Run Playwright E2E tests
bun run build:tauri # Build desktop app- CCH binary must be in PATH for debug simulator
- Schema must match CCH's actual configuration format
- File paths must work cross-platform (Windows backslash handling)