This document establishes the mandatory UI/UX design specifications, architectural constraints, localization rules, OCR verification pipeline, and open-source marketing standards for all plugins developed within the UniversalDeviceToolkit-Plugins repository.
Our goal is to elevate plugin development from fragmented, ad-hoc scripts into a premium, state-of-the-art ecosystem that seamlessly matches the visual excellence and rock-solid stability of the host Universal Device Toolkit application.
An analysis of legacy plugins—specifically the Network Acceleration (NetworkAccelerationControl.xaml) plugin—reveals critical UI/UX flaws that must be strictly eradicated across all plugins:
- Monolithic Clutter & Lack of Information Hierarchy (单页无脑堆砌与层级混乱):
- The Flaw:
NetworkAccelerationControl.xamlspans over 600 lines, dumping hero status banners, mode selection cards, live telemetry metrics, quick optimization plans, and behavior toggles vertically into a single scrollingStackPanel. Users are greeted by a wall of text and boxes without visual breathing room or clear operational focus. - The Fix: Modular Tabs & Visual Cards. Separate operational monitoring (Dashboard/Status) from configuration rules (Settings/Advanced) using WPF UI
TabControlor clean navigation pivots.
- The Flaw:
- Rigid Layouts, Hardcoded Margins & Broken Scaling (死板布局与自适应失效):
- The Flaw: Using rigid fixed widths (
Width="40"), hardcoded pixel padding/margins (Margin="0,0,18,4"), and inflexible stack panels. When window sizes change or users run on high-DPI 4K displays with 150%+ scaling, elements clip, text truncates, and alignment breaks awkwardly. - The Fix: Responsive Grid & Star Sizing. Use adaptive WPF layout containers (
GridwithWidth="*",UniformGrid,WrapPanelwith dynamicMinWidth) and strictly bind to global design system spacing tokens.
- The Flaw: Using rigid fixed widths (
- Poor Telemetry Presentation (监控数据展示粗糙):
- The Flaw: Live network speeds (Download/Upload Mbps, peak traffic, adapter status) are rendered as plain, uninspired text lines inside nested stack panels, making vital real-time data hard to read at a glance.
- The Fix: Prominent Metric Cards & Visual Sparklines. Present real-time telemetry inside dedicated visual cards featuring large, bold typography for numerical values, muted secondary typography for units/labels, and smooth status badges.
- Absence of Interactive Polish & Micro-Animations (缺乏交互反馈与微动画):
- The Flaw: Clicking "Run Quick Optimization" or switching network profiles abruptly swaps text strings or blocks UI rendering without visual progress feedback.
- The Fix: Dynamic State Transitions. Incorporate smooth progress rings during network stack resets, subtle hover glow effects on selectable mode cards, and clean toast notifications upon action completion.
flowchart TD
subgraph UI_Architecture [Plugin UI Architecture Standards]
CardLayout[1. Modular Card Design:<br>CornerRadius=8/10, Subtle Border] --> ThemeBinding[2. 100% Theme Token Binding:<br>No Hardcoded Hex Colors]
ThemeBinding --> Responsive[3. Adaptive Layouts:<br>Grid Star-Sizing & WrapPanel]
Responsive --> Typography[4. Clear Visual Hierarchy:<br>Large Bold Metrics vs Muted Labels]
Typography --> StateFeedback[5. Dynamic State Feedback:<br>Progress Rings & Toasts]
end
- Adhere strictly to Host Design System Tokens: Never hardcode colors (like
#FFFFFFor#333333) or rigid brushes in plugin XAML. Always bind dynamically to host WPF UI resources:- Backgrounds:
{DynamicResource ControlFillColorDefaultBrush},{DynamicResource ControlFillColorSecondaryBrush} - Borders:
{DynamicResource ControlStrokeColorDefaultBrush} - Text:
{DynamicResource TextFillColorPrimaryBrush},{DynamicResource TextFillColorSecondaryBrush} - Accents:
{DynamicResource SystemAccentColorPrimaryBrush}
- Backgrounds:
- Standardize Card Geometry: All feature containers and settings blocks must use rounded
Bordercards withCornerRadius="8"or"10",BorderThickness="1", and standard padding (16px, 14px). - Limit Vertical Scroll Length: If a plugin control exceeds 2 screens of vertical height, you MUST split the interface into logical sub-views or tabs (e.g.,
Overview,Optimization Rules,Settings). - Empty & Loading States: When telemetry is initializing or no active network adapter is found, display a beautifully designed empty/loading state card with a helpful description and retry button—never leave blank spaces or ugly
nulllabels!
Just like the main application, all plugin codebase contributions must strictly follow our core stability constraints:
- Never use
.ConfigureAwait(false)in Plugin UI/ViewModel Code: Stripping the synchronization context in plugin controls guaranteesInvalidOperationExceptioncrashes when background downloaders or telemetry timers fire. - Defensive Dispatcher Marshaling: When background services (such as
NetworkAccelerationRuntimeor WMI network adapter monitoring) trigger events (StateChanged,TrafficUpdated), always marshal UI repaints viaDispatcher.CheckAccess()andDispatcher.InvokeAsync(). - Safe Process Execution & Teardown: Network optimization plugins frequently invoke system utilities (
netsh,ipconfig, Winsock resets, DNS flushes). All external process calls must use asynchronous wrappers with cancellation tokens and clean exit-code verification.
- No Per-Poll Disk Logging: Network telemetry loops running every 1–3 seconds must never emit trace logs or serialize JSON data on every tick.
- Resource Cleanup on Unload: When a plugin tab is closed or unloaded (
UserControl_Unloaded), explicitly stop background monitoring timers and unsubscribe from static event handlers to prevent memory leaks.
Plugins must support international users and participate in our Automated OCR & Pure Text LLM Translation Verification Pipeline:
- All user-facing text in plugin XAML and C# (including button labels, tooltips, status messages, and error hints) must be extracted into the plugin's local
Resources/Resource.resxfile. - Use numbered placeholders (
{0},{1}) withstring.Format(CultureInfo.CurrentCulture, ...)instead of string concatenation.
When a plugin is built and validated, our automated UI test driver (FlaUI + PluginWorkbench) launches the plugin across priority locales (zh-Hans, zh-Hant, de, es, ja, fr, ru).
flowchart LR
Workbench[PluginWorkbench Host] -->|Set Locale & Open Plugin| Screenshot[Capture PNG Bitmap]
Workbench -->|Dump Control Tree| UIATree[UIAutomation Control Rects]
Screenshot -->|WinRT OCR Engine| OCRBox[OCR Words + Bounding Boxes X,Y,W,H]
OCRBox & UIATree -->|JSON Payload| TextLLM[Pure Text LLM Verification Engine]
TextLLM -->|Check: Truncation / Overflow / Mojibake / Untranslated| AutoFix[Auto-Remediate .resx & XAML]
The Pure Text LLM Verification Engine evaluates the mapped OCR coordinate data against UIAutomation bounding boxes using 5 strict rules:
- Untranslated Detection: Flagging English fallback text appearing in non-English locales.
- Mojibake & Encoding: Flagging corrupted UTF-8/UTF-16 characters or replacement boxes (
□). - Broken Placeholders: Flagging unreplaced format tags (
{0},{1}) or raw data bindings. - Layout Truncation & Box Overflow: Comparing OCR text bounding widths against UI container widths. If OCR text ends in ellipses (
...) orwidth >= control_bounds.width * 0.98, the system automatically flags and modifies the XAML layout (enablingTextWrapping="Wrap",TextTrimming="CharacterEllipsis", or changing fixed widths to dynamicMinWidth). - Technical Domain Semantics: Verifying accurate hardware and network terminology (e.g., translating "Winsock Reset", "DNS Flush", "TCP/IP Stack", "MUX Switch" accurately without literal machine-translation errors).
When promoting individual plugins or releasing updates to the official plugin store (store-entry.json), all contributors and AI agents must follow ethical marketing guidelines:
- Global Developer & Gaming Communities: GitHub Releases/Discussions, Reddit (
r/LenovoLegion,r/GamingLaptops,r/windows), Discord tech channels. - Chinese Geek & Tech Communities (国内核心极客社区): 吾爱破解 (52Poje)、V2EX、Chiphell (CHH)、B站科技区开源推荐、知乎硬件调优专栏、百度贴吧(拯救者吧、显卡吧、极客吧)、小红书电脑实用工具分享。
- The Hook / Pain Point: Why use this plugin? (e.g., "Windows default DNS caching and bloated third-party game boosters consume 200MB+ RAM and run background tracking service. Our Network Acceleration plugin provides pure, 1-click system-level network stack optimization directly inside your toolkit.")
- Truthful & Evidence-Based (严守事实,绝不虚假夸大):
- Never make baseless claims like "Lowers your gaming ping by 100ms" or "Guarantees zero packet loss".
- Use technical, accurate descriptions: "Optimizes Windows TCP/IP stack parameters, flushes DNS cache, and resets Winsock catalog to eliminate local socket bottlenecks without running background VPN or proxy daemons."
- Security & Transparency: Emphasize that all plugin code is 100% open-source, auditable on GitHub, contains zero telemetry, zero adware, and executes standard Windows network administrative commands cleanly.
Before submitting a pull request or promoting an official plugin release:
- UI Polish: Does the XAML use modular cards (
CornerRadius="8"), responsive sizing (Width="*",MinWidth), and host theme brushes without hardcoded hex colors? - Thread Safety: Have all
.ConfigureAwait(false)calls been removed from UI/ViewModel paths, and are background UI updates marshaled viaDispatcher.InvokeAsync()? - Localization: Are all user-facing strings extracted to
Resource.resxwithout string concatenation? - OCR Verification: Has the plugin been tested in
PluginWorkbenchunder non-English locales to ensure zero text clipping or layout overflow? - Marketing Copy: Does the store description and release notes adhere to truthful, evidence-based copywriting without exaggerated claims?