Skip to content

Commit 0f001e3

Browse files
feat(ui): modernize editor UI with shadcn-style design system
Major UI overhaul implementing shadcn-inspired design with glassmorphic elements in dark mode and clean monochromatic styling in light mode. ## New UI Package (com.jasonxudeveloper.jengine.ui) ### Components - **Button**: JButton, JToggleButton, JButtonGroup with 5 variants - **Form**: JFormField, JTextField, JDropdown, JToggle, JObjectField - **Layout**: JCard, JSection, JStack, JRow for composition - **Feedback**: JStatusBar, JLogView, JProgressBar - **Navigation**: JBreadcrumb with clean hierarchical display ### Theme System - Design tokens (Tokens.cs) with dark/light theme support - Glassmorphic palette for dark mode (translucent layers, vibrant accents) - shadcn-style monochromatic palette for light mode (black/white/grey only) - 8px spacing grid, typography scale, border radius system - Smooth transitions (150-300ms) ### Enhanced Editor UIs - BootstrapEditorUI: Redesigned Bootstrap inspector with modern components - PanelUI: Redesigned Panel window with enhanced scene management ## Core Package Improvements ### Code Deduplication - **EditorUtils.cs**: Extracted 6 shared helper methods from BootstrapEditor and BootstrapEditorUI (GetAvailableAsmdefFiles, GetAvailableHotScenes, GetAvailableHotClasses, GetAvailableHotMethods, GetAvailableDynamicSecretKeys, GetAvailableAOTDataFiles) - **BuildHelper.cs**: New shared build execution logic with UI callbacks, eliminating ~200 lines of duplication between Panel.cs and PanelUI.cs ### Bug Fixes - Panel.cs: Added null checks in LogMessage to prevent crashes when using enhanced PanelUI - PanelUI: Creates its own BuildManager with proper log routing to JLogView ## Design Decisions ### Light Theme Philosophy - Monochromatic black/white/grey only (no colors except semantic highlights) - Buttons use grey shades (Primary: gray-700, Secondary: gray-300) - Clean, minimal aesthetic inspired by shadcn/ui ### Dark Theme Philosophy - Glassmorphic translucent layers (40-80% opacity) - Vibrant cyan accents (#06B6D4) with subtle glow effects - 5-level glass system (Base → Subtle → Surface → Elevated → Overlay) ### Component Patterns - Fluent API for chaining (.WithText().FullWidth()) - Consistent spacing and sizing across all components - Theme-aware colors (automatically adapt to Unity editor theme) - Proper keyboard navigation with visible focus states Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
1 parent 6a8f15b commit 0f001e3

78 files changed

Lines changed: 6802 additions & 211 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
// BuildHelper.cs
2+
//
3+
// Author:
4+
// JasonXuDeveloper <jason@xgamedev.net>
5+
//
6+
// Copyright (c) 2025 JEngine
7+
//
8+
// Permission is hereby granted, free of charge, to any person obtaining a copy
9+
// of this software and associated documentation files (the "Software"), to deal
10+
// in the Software without restriction, including without limitation the rights
11+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
// copies of the Software, and to permit persons to whom the Software is
13+
// furnished to do so, subject to the following conditions:
14+
//
15+
// The above copyright notice and this permission notice shall be included in
16+
// all copies or substantial portions of the Software.
17+
//
18+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
// THE SOFTWARE.
25+
26+
using System;
27+
using JEngine.Core.Editor.CustomEditor;
28+
using UnityEditor;
29+
30+
namespace JEngine.Core.Editor
31+
{
32+
/// <summary>
33+
/// Helper class for build operations with UI update callbacks.
34+
/// </summary>
35+
public static class BuildHelper
36+
{
37+
/// <summary>
38+
/// Callbacks for build UI updates.
39+
/// </summary>
40+
public class BuildCallbacks
41+
{
42+
/// <summary>
43+
/// Called to enable/disable build buttons.
44+
/// </summary>
45+
public Action<bool> SetButtonsEnabled { get; set; }
46+
47+
/// <summary>
48+
/// Called to clear the log view.
49+
/// </summary>
50+
public Action ClearLog { get; set; }
51+
52+
/// <summary>
53+
/// Called to update status text.
54+
/// </summary>
55+
public Action<string> UpdateStatus { get; set; }
56+
57+
/// <summary>
58+
/// Called when build completes successfully.
59+
/// </summary>
60+
public Action OnSuccess { get; set; }
61+
62+
/// <summary>
63+
/// Called when build fails.
64+
/// </summary>
65+
public Action OnError { get; set; }
66+
}
67+
68+
/// <summary>
69+
/// Executes BuildAll with standard UI callbacks.
70+
/// </summary>
71+
public static void ExecuteBuildAll(BuildManager buildManager, BuildCallbacks callbacks)
72+
{
73+
if (buildManager.IsBuilding) return;
74+
75+
callbacks.SetButtonsEnabled?.Invoke(false);
76+
callbacks.ClearLog?.Invoke();
77+
78+
buildManager.StartBuildAll(
79+
onComplete: () =>
80+
{
81+
callbacks.SetButtonsEnabled?.Invoke(true);
82+
callbacks.UpdateStatus?.Invoke("Build completed");
83+
callbacks.OnSuccess?.Invoke();
84+
EditorUtility.DisplayDialog("Build Successful", "Build completed successfully!", "OK");
85+
},
86+
onError: e =>
87+
{
88+
callbacks.SetButtonsEnabled?.Invoke(true);
89+
callbacks.UpdateStatus?.Invoke("Build failed");
90+
callbacks.OnError?.Invoke();
91+
EditorUtility.DisplayDialog("Build Failed", $"Build failed with error:\n{e.Message}", "OK");
92+
}
93+
);
94+
}
95+
96+
/// <summary>
97+
/// Executes BuildCodeOnly with standard UI callbacks.
98+
/// </summary>
99+
public static void ExecuteBuildCodeOnly(BuildManager buildManager, BuildCallbacks callbacks)
100+
{
101+
if (buildManager.IsBuilding) return;
102+
103+
callbacks.SetButtonsEnabled?.Invoke(false);
104+
callbacks.ClearLog?.Invoke();
105+
106+
buildManager.StartBuildCodeOnly(
107+
onComplete: () =>
108+
{
109+
callbacks.SetButtonsEnabled?.Invoke(true);
110+
callbacks.UpdateStatus?.Invoke("Code build completed");
111+
callbacks.OnSuccess?.Invoke();
112+
EditorUtility.DisplayDialog("Code Build Successful", "Code build completed successfully!", "OK");
113+
},
114+
onError: e =>
115+
{
116+
callbacks.SetButtonsEnabled?.Invoke(true);
117+
callbacks.UpdateStatus?.Invoke("Code build failed");
118+
callbacks.OnError?.Invoke();
119+
EditorUtility.DisplayDialog("Code Build Failed", $"Code build failed with error:\n{e.Message}", "OK");
120+
}
121+
);
122+
}
123+
124+
/// <summary>
125+
/// Executes BuildAssetsOnly with standard UI callbacks.
126+
/// </summary>
127+
public static void ExecuteBuildAssetsOnly(BuildManager buildManager, BuildCallbacks callbacks)
128+
{
129+
if (buildManager.IsBuilding) return;
130+
131+
callbacks.SetButtonsEnabled?.Invoke(false);
132+
callbacks.ClearLog?.Invoke();
133+
134+
buildManager.StartBuildAssetsOnly(
135+
onComplete: () =>
136+
{
137+
callbacks.SetButtonsEnabled?.Invoke(true);
138+
callbacks.UpdateStatus?.Invoke("Assets build completed");
139+
callbacks.OnSuccess?.Invoke();
140+
EditorUtility.DisplayDialog("Assets Build Successful", "Assets build completed successfully!", "OK");
141+
},
142+
onError: e =>
143+
{
144+
callbacks.SetButtonsEnabled?.Invoke(true);
145+
callbacks.UpdateStatus?.Invoke("Assets build failed");
146+
callbacks.OnError?.Invoke();
147+
EditorUtility.DisplayDialog("Assets Build Failed", $"Assets build failed with error:\n{e.Message}", "OK");
148+
}
149+
);
150+
}
151+
}
152+
}

UnityProject/Packages/com.jasonxudeveloper.jengine.core/Editor/BuildHelper.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)