Initial commit: Clean DSS implementation
Migrated from design-system-swarm with fresh git history.
Old project history preserved in /home/overbits/apps/design-system-swarm
Core components:
- MCP Server (Python FastAPI with mcp 1.23.1)
- Claude Plugin (agents, commands, skills, strategies, hooks, core)
- DSS Backend (dss-mvp1 - token translation, Figma sync)
- Admin UI (Node.js/React)
- Server (Node.js/Express)
- Storybook integration (dss-mvp1/.storybook)
Self-contained configuration:
- All paths relative or use DSS_BASE_PATH=/home/overbits/dss
- PYTHONPATH configured for dss-mvp1 and dss-claude-plugin
- .env file with all configuration
- Claude plugin uses ${CLAUDE_PLUGIN_ROOT} for portability
Migration completed: $(date)
🤖 Clean migration with full functionality preserved
This commit is contained in:
74
admin-ui/js/core/project-selector.js
Normal file
74
admin-ui/js/core/project-selector.js
Normal file
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* admin-ui/js/core/project-selector.js
|
||||
* Manages project selection in the header
|
||||
*/
|
||||
|
||||
class ProjectSelector {
|
||||
constructor(containerElement) {
|
||||
if (!containerElement) return;
|
||||
this.container = containerElement;
|
||||
this.init();
|
||||
}
|
||||
|
||||
init() {
|
||||
this.projects = this.getProjects();
|
||||
this.selectedProject = this.getSelectedProject();
|
||||
this.render();
|
||||
this.bindEvents();
|
||||
}
|
||||
|
||||
getProjects() {
|
||||
// Sample projects - in production these would come from an API
|
||||
return [
|
||||
{ id: 'dss', name: 'Design System Swarm', icon: '🎨' },
|
||||
{ id: 'component-library', name: 'Component Library', icon: '📦' },
|
||||
{ id: 'tokens-manager', name: 'Tokens Manager', icon: '🎯' },
|
||||
{ id: 'figma-sync', name: 'Figma Sync', icon: '🔄' }
|
||||
];
|
||||
}
|
||||
|
||||
getSelectedProject() {
|
||||
const stored = localStorage.getItem('dss_selected_project');
|
||||
return stored || this.projects[0].id;
|
||||
}
|
||||
|
||||
setSelectedProject(projectId) {
|
||||
this.selectedProject = projectId;
|
||||
localStorage.setItem('dss_selected_project', projectId);
|
||||
|
||||
// Dispatch custom event
|
||||
window.dispatchEvent(new CustomEvent('project-changed', {
|
||||
detail: { projectId }
|
||||
}));
|
||||
}
|
||||
|
||||
render() {
|
||||
const selectedProject = this.projects.find(p => p.id === this.selectedProject);
|
||||
|
||||
this.container.innerHTML = `
|
||||
<div class="project-selector">
|
||||
<label for="project-select" class="project-selector__label">Project:</label>
|
||||
<select id="project-select" class="project-selector__select" aria-label="Select project">
|
||||
${this.projects.map(project => `
|
||||
<option value="${project.id}" ${project.id === this.selectedProject ? 'selected' : ''}>
|
||||
${project.icon} ${project.name}
|
||||
</option>
|
||||
`).join('')}
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
bindEvents() {
|
||||
const select = this.container.querySelector('#project-select');
|
||||
if (select) {
|
||||
select.addEventListener('change', (event) => {
|
||||
this.setSelectedProject(event.target.value);
|
||||
this.render();
|
||||
this.bindEvents();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectSelector;
|
||||
Reference in New Issue
Block a user