Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Unity framework for runtime hot updates. Unity 2022.3+, C#.

### JEngine.UI (com.jasonxudeveloper.jengine.ui)
- **MessageBox**: Async modal dialogs with UniTask (runtime)
- **Editor Components**: JButton, JTextField, JStack, JCard, etc. (editor)
- **Editor Components**: JButton, JTextField, JStack, JCard, JTabView, etc. (editor)
- **Design Tokens**: Theme-aware colors, spacing, typography

## Key Patterns
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jengine",
"description": "AI guide for game development with JEngine Unity hot-update framework",
"version": "1.0.6",
"version": "1.1.0",
"author": {
"name": "JasonXuDeveloper"
},
Expand Down
41 changes: 34 additions & 7 deletions .claude-plugin/skills/editor-ui/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: editor-ui
description: JEngine Editor UI component library with theming. Triggers on: custom inspector, editor window, Unity editor UI, UIElements, VisualElement, JButton, JStack, JCard, JTextField, JDropdown, design tokens, dark theme, light theme, editor styling, themed button, form layout, progress bar, status bar, toggle button, button group
description: JEngine Editor UI component library with theming. Triggers on: custom inspector, editor window, Unity editor UI, UIElements, VisualElement, JButton, JStack, JCard, JTextField, JDropdown, JTabView, tab view, tabbed container, design tokens, dark theme, light theme, editor styling, themed button, form layout, progress bar, status bar, toggle button, button group
---

# JEngine Editor UI Components
Expand Down Expand Up @@ -241,6 +241,28 @@ bc.SetPath("New", "Path");
bc.Clear();
```

### JTabView - Tabbed Container
```csharp
// Basic tab view
var tabs = new JTabView()
.AddTab("General", generalContent)
.AddTab("Advanced", advancedContent)
.AddTab("Debug", debugContent);

// Responsive: max 3 tabs per row before wrapping
var responsiveTabs = new JTabView(maxTabsPerRow: 3)
.AddTab("Tab 1", content1)
.AddTab("Tab 2", content2);

// Programmatic selection (zero-based index: 0=General, 1=Advanced, 2=Debug)
tabs.SelectTab(2); // Select "Debug" tab

// Read state
int selected = tabs.SelectedIndex; // -1 if no tabs
int count = tabs.TabCount;
int maxPerRow = tabs.MaxTabsPerRow;
```

## Design Tokens

The `Tokens` class provides named constants that adapt to Unity's dark/light theme.
Expand Down Expand Up @@ -365,7 +387,7 @@ enum AlignItems { Start, Center, End, Stretch }

## Game Development Examples

### Settings Panel
### Settings Panel (with Tabs)
```csharp
public class GameSettingsWindow : EditorWindow
{
Expand All @@ -384,8 +406,8 @@ public class GameSettingsWindow : EditorWindow
root.style.paddingBottom = Tokens.Spacing.Lg;
root.style.paddingLeft = Tokens.Spacing.Lg;

// Graphics Section
var graphics = new JSection("Graphics")
// Graphics tab content
var graphics = new JStack(GapSize.MD)
.Add(
new JFormField("VSync", _vsyncToggle = new JToggle(true)),
new JFormField("Target FPS", _fpsDropdown = new JDropdown<int>(
Expand All @@ -394,17 +416,22 @@ public class GameSettingsWindow : EditorWindow
formatSelectedValue: static fps => fps == -1 ? "Unlimited" : $"{fps} FPS",
formatListItem: static fps => fps == -1 ? "Unlimited" : $"{fps} FPS")));

// Audio Section
var audio = new JSection("Audio")
// Audio tab content
var audio = new JStack(GapSize.MD)
.Add(new JFormField("Master Volume", _volumeSlider = new JProgressBar(0.8f)
.WithHeight(20)));

// Tabbed settings
var tabs = new JTabView()
.AddTab("Graphics", graphics)
.AddTab("Audio", audio);

// Actions
var actions = new JButtonGroup(
new JButton("Apply", ApplySettings, ButtonVariant.Primary),
new JButton("Reset", ResetSettings, ButtonVariant.Secondary));

root.Add(graphics, audio, actions);
root.Add(tabs, actions);
rootVisualElement.Add(root);
}
}
Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,4 @@ Document all public APIs with XML comments.
- [ ] Thread-safe where needed
- [ ] Proper resource cleanup
- [ ] Unit tests added for non-core package changes
- [ ] Plugin skill docs updated for new/changed JEngine.Util or JEngine.UI APIs (see `.claude/rules/plugin-maintenance.md`)