Skip to content

[Spec 0060] Dashboard modularization#112

Merged
waleedkadous merged 3 commits intomainfrom
builder/0060-dashboard-modularization
Dec 16, 2025
Merged

[Spec 0060] Dashboard modularization#112
waleedkadous merged 3 commits intomainfrom
builder/0060-dashboard-modularization

Conversation

@waleedkadous
Copy link
Contributor

Summary

  • Modularized monolithic 4700-line dashboard-split.html into clean, maintainable structure
  • 9 CSS files (variables, layout, tabs, statusbar, dialogs, activity, projects, files, utilities)
  • 8 JS files (state, utils, tabs, dialogs, projects, files, activity, main)
  • Hot reloading support for improved developer experience

Changes

  • Added /dashboard/css/* and /dashboard/js/* server routes with path traversal protection
  • Added /api/hot-reload endpoint for development hot reloading
  • CSS: Instant reload via stylesheet link replacement
  • JS: State preservation via sessionStorage, page reload with automatic state restoration
  • Updated clipboard tests for modular structure

Test plan

  • TypeScript compiles without errors
  • Clipboard tests pass (7/7)
  • Manual testing: Start dashboard, verify all features work
  • Manual testing: Modify CSS file, verify instant reload
  • Manual testing: Modify JS file, verify reload with state preservation

Files

  • 20 files changed (+4837 lines)
  • New: packages/codev/templates/dashboard/ directory structure
  • Modified: dashboard-server.ts (routes, hot-reload)
  • Modified: clipboard.test.ts (updated for modular structure)

- Extract CSS into 9 files: variables, layout, tabs, statusbar, dialogs, activity, projects, files, utilities
- Extract JS into 8 files: state, utils, tabs, dialogs, projects, files, activity, main
- Create modular index.html with proper dependency ordering
- Add server routes for /dashboard/css/* and /dashboard/js/*
- Add /api/hot-reload endpoint for development hot reloading
- Add client-side hot reload: CSS instant reload, JS with state preservation
- Update clipboard tests for modular structure
@waleedkadous
Copy link
Contributor Author

Architect Integration Review (3-Way)

Gemini: APPROVE | Codex: COMMENT | Claude: REQUEST_CHANGES

Critical Issue

Hot reload polling is always active - The client polls /api/hot-reload every 2s even in production. This wastes resources.

Fix required: Gate hot reload behind a query param or environment check:

// Only enable hot reload in development
const isDev = window.location.search.includes('dev=1') || window.location.hostname === 'localhost';
if (isDev) {
  setupHotReload();
}

Minor Issues (can defer)

  1. Plan deviation: Implemented polling instead of SSE. Polling is simpler and works fine - just update plan to match.

  2. File size guidelines: Some files exceed limits (files.css: 530, projects.css: 501). Acceptable if keeping related code together.

  3. Consolidated structure: 8 JS files instead of planned 14. This is actually cleaner - update plan to reflect.

Manual Testing

Please check off the manual testing items in the PR description before merge.


🏗️ Architect integration review

Hot reload polling now only activates when:
- Hostname is localhost or 127.0.0.1
- Or query param ?dev=1 is present

This prevents unnecessary polling in production environments.
@waleedkadous waleedkadous merged commit cae126d into main Dec 16, 2025
0 of 2 checks passed
@waleedkadous waleedkadous deleted the builder/0060-dashboard-modularization branch January 8, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant