Skip to content
Back to skills

Ui Design Best Practices

ASecurity

Design and verify modern, accessible Onto2AI Modeller interfaces. Use for workbench layout, themes, GoJS diagrams, zoom stability, source/target tab behavior, URI display, model configuration, and LLM errors.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 6, 2026
designjavascriptgojavareactnodeapifrontend

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 6, 2026

npx -y skills add lanliwz/neo4j-onto2ai-toolset --skill ui-design-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ui Design Best Practices?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ui Design Best Practices
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lanliwz-ui-design-best-practices/badge)](https://www.skillsdirectory.com/skills/lanliwz-ui-design-best-practices)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ui-design-best-practices
description: Design and verify modern, accessible Onto2AI Modeller interfaces. Use for workbench layout, themes, GoJS diagrams, zoom stability, source/target tab behavior, URI display, model configuration, and LLM errors.
---
# UI Design Best Practices

Use these instructions when designing or modifying the Modeller UI, especially when implementing themes, complex visualizations, or interactive components.

## Product Surface
Onto2AI Modeller is a workbench for adapting source ontologies into target ontologies and application code models. The UI should prioritize inspection, selection, refinement, and validation over dashboard-style summaries.

Use the current visible names consistently:
- `Source Ontology`
- `Target Ontology`
- `Semantic Interaction`
- `Native Query`
- `Ontology View`

For Source Ontology, keep UML Diagram and Pydantic Models disabled. Source Ontology should stay focused on Ontology View, source search, concept preview, and extraction seeds.

## Modern Theming (CSS)
Always implement a dual-theme system (Dark/Light) using CSS variables.
- **Root Variables**: Define default dark theme variables in `:root`.
- **Light Mode Overrides**: Define light theme overrides in `:root.light-mode`.
- **Transitions**: Apply smooth transitions to interactive elements:
  ```css
  * { transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease; }
  ```

## GoJS Theme Synchronization
When working with GoJS diagrams, synchronize the visual state with the application theme.
- **Model State**: Store the theme state in the diagram's `modelData`:
  ```javascript
  myDiagram.model.modelData.isLight = document.documentElement.classList.contains('light-mode');
  ```
- **Theme-Aware Bindings**: Use `.ofModel()` bindings to react to theme changes:
  ```javascript
  new go.Binding("fill", "isLight", (light) => light ? "#ffffff" : "#1a1a2e").ofModel()
  ```
- **State Preservation (CRITICAL)**: When replacing the diagram model (e.g., loading new data), ALWAYS re-set the `isLight` property from the current DOM state to prevent visual desync.
- **Zoom Behavior (CRITICAL)**: Preserve readable font sizes and line widths during zoom. Scale node geometry and positions without letting text strokes become too small or too large.
- **Viewport Stability (CRITICAL)**: Zoom in/out should keep the diagram centered on the user's visual focus. Avoid model replacement, layout re-run, or viewport reset during zoom interactions.

## Contrast & Accessibility
Ensure all text and diagram elements provide sufficient contrast in both themes.
- **Attributes & Datatypes**: Use theme-aware colors for text.
  - *Light Mode*: Dark green (`#065f46`) for attribute names, slate (`#475569`) for types.
  - *Dark Mode*: Bright green (`#34d399`) for attribute names, light slate (`#94a3b8`) for types.
- **Relationship Labels**: For labels over lines (like "extends"), use a theme-aware background shape to ensure text remains readable regardless of the line color.
  - *Light Mode Background*: `rgba(255, 255, 255, 0.9)`
  - *Dark Mode Background*: `rgba(15, 15, 26, 0.9)`

## UI Layout & Transitions
- **Workbench Density**: Favor navigator-style layouts with left catalog/search, center ontology view/detail, and right inspector/properties when the workflow involves browsing concepts.
- **Glassmorphism**: Use semi-transparent backgrounds sparingly. Do not let decorative style reduce legibility or density.
- **Animations**: Use micro-animations for hover states and transitions between views, but avoid motion that makes diagrams jump.
- **Responsive Panels**: Extend the existing CSS layout and full-screen design-window controls. Add a splitter dependency only when resizable dragging is explicitly required and the dependency is intentionally wired into `index.html` and `app.js`.
- **URI Display**: Treat URIs as unique identifiers. Display them as selectable text, not links, unless a surface is explicitly intended for web navigation.
- **Configuration**: LLM model lists and defaults should be populated from `onto2ai_modeller/config.yaml`, not hard-coded in frontend code.
- **LLM Errors**: When chat fails, show provider, model, status/category, and a practical next action. Quota and missing-key failures should not look like generic chat failures.

## Implementation Workflow
1.  Define/Update CSS variables in `styles.css`.
2.  Implement theme toggle logic in `app.js`.
3.  Update GoJS templates in `graph.js` with theme bindings.
4.  Keep API response handling in sync with `onto2ai_modeller/api/schemas.py`.
5.  Verify contrast, tab state, zoom stability, and text overlap in both modes using a browser check when UI behavior changes.

Files in this skill

  • SKILL.md4.6 KB
  • agents/openai.yaml229 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.