Cursor rule
.cursor/rules/ui-ux-patterns.mdcUI/UX patterns and window management guide
Cursor rules
Quality
62/100
Scores the file, not the repository.Length
921 words
46 headings · 12 code blocksRepository
103
— · pushed 17 days agoLast changed
3 days ago
First indexed 3 days ago.1234567# UI/UX Patterns and Window Management Guide89## Window Architecture1011### Window Types12UGTLive uses several specialized windows, each with specific responsibilities:13141. **Main Window** ([src/MainWindow.xaml](mdc:src/MainWindow.xaml))15 - Central control panel16 - Start/Stop translation17 - Access to all other windows18 - System tray integration19202. **Monitor Window** ([src/MonitorWindow.xaml](mdc:src/MonitorWindow.xaml))21 - Live preview of capture area22 - Visual OCR feedback23 - Resizable and movable24253. **ChatBox Window** ([src/ChatBoxWindow.xaml](mdc:src/ChatBoxWindow.xaml))26 - Translation display overlay27 - Always-on-top option28 - Customizable appearance29304. **Settings Window** ([src/SettingsWindow.xaml](mdc:src/SettingsWindow.xaml))31 - Tabbed interface for all settings32 - API key management33 - Service configuration34 - OCR and translation settings35365. **Log Window** ([src/LogWindow.xaml](mdc:src/LogWindow.xaml))37 - Application log viewer38 - Real-time log updates39 - Filtering and search4041## Keyboard Shortcuts ([src/HotkeyManager.cs](mdc:src/HotkeyManager.cs))4243### Global Shortcuts44All shortcuts are managed through HotkeyManager and configurable via hotkeys.txt:4546| Action | Default | Event |47|--------|---------|-------|48| Start/Stop OCR | Shift+S | `StartStopRequested` |49| Show/Hide Monitor | Shift+M | `MonitorToggleRequested` |50| Show/Hide ChatBox | Shift+C | `ChatBoxToggleRequested` |51| Show/Hide Settings | Shift+P | `SettingsToggleRequested` |52| Show/Hide Log | Shift+L | `LogToggleRequested` |53| Show/Hide Main Window | Shift+H | `MainWindowVisibilityToggleRequested` |54| Clear Overlays | Shift+X | `ClearOverlaysRequested` |55| Passthrough Toggle | Shift+T | `PassthroughToggleRequested` |56| Overlay Mode Toggle | Shift+O | `OverlayModeToggleRequested` |57| Listen Toggle | Shift+A | `ListenToggleRequested` |58| View in Browser | Shift+B | `ViewInBrowserRequested` |59| Play All Audio | Shift+W | `PlayAllAudioRequested` |6061### Implementation Pattern62```csharp63// Register hotkey events64HotkeyManager.Instance.StartStopRequested += OnStartStopRequested;65HotkeyManager.Instance.MonitorToggleRequested += OnMonitorToggleRequested;6667// Hotkeys are loaded from hotkeys.txt and can be customized68```6970### Hotkey Configuration71Hotkeys are stored in `hotkeys.txt` with format:72```73action=key1+key2+key374```7576## UI Design Patterns7778### Window Lifecycle791. **Creation**: Windows created once at startup802. **Visibility**: Show/Hide instead of Create/Destroy813. **State Persistence**: Position and size saved via ConfigManager824. **Cleanup**: Proper disposal on application exit8384### Common Window Properties85```xml86<!-- Standard window attributes -->87WindowStyle="None"88AllowsTransparency="True"89ResizeMode="CanResize"90Topmost="{Binding IsAlwaysOnTop}"91```9293### Styling Conventions9495#### Colors and Themes96- Dark theme by default97- Configurable accent colors98- Semi-transparent backgrounds99- High contrast text100101#### Standard Controls102```xml103<!-- Button Style -->104<Button Style="{StaticResource ModernButton}"105 Background="#FF2D2D30"106 Foreground="White"107 BorderThickness="0"/>108109<!-- TextBox Style -->110<TextBox Style="{StaticResource ModernTextBox}"111 Background="#FF3F3F46"112 Foreground="White"113 BorderBrush="#FF007ACC"/>114```115116## ChatBox Customization117118### Appearance Settings ([src/ChatBoxOptionsWindow.xaml](mdc:src/ChatBoxOptionsWindow.xaml))119- Background color picker120- Text color picker121- Transparency slider (0-100%)122- Font family and size123- Border options124125### Layout Options126- Auto-size to content127- Maximum width/height128- Text alignment129- Padding configuration130131## Settings Organization132133### Tab Structure in Settings Window1341. **General**: Basic app settings, hotkeys1352. **OCR**: OCR service selection and config1363. **Translation**: Service selection and API keys1374. **ChatBox**: Display preferences1385. **Audio**: TTS settings and voice selection1396. **Advanced**: Debug and experimental features140141### Settings Pattern142```csharp143// Property in ConfigManager144public string GetSetting() => GetValue(SETTING_KEY, defaultValue);145public void SetSetting(string value)146{147 SetValue(SETTING_KEY, value);148 SaveConfig();149}150151// UI Binding in XAML152<TextBox Text="{Binding SettingName, Mode=TwoWay}"/>153```154155## Mouse Interaction ([src/MouseManager.cs](mdc:src/MouseManager.cs))156157### Region Selection158- Click and drag to select area159- Visual feedback during selection160- Escape key to cancel161- Double-click to confirm162163### Window Dragging164- Custom title bar implementation165- Drag from any empty area166- Snap to screen edges167168## Notification Patterns169170### Status Messages171- Displayed in main window status bar172- Auto-fade after 3 seconds173- Color-coded by type (info, warning, error)174175### Error Handling UI176```csharp177// Show error via ErrorPopupManager178ErrorPopupManager.ShowError("Error Title", "Error message");179180// Or show in UI181Application.Current.Dispatcher.Invoke(() =>182{183 StatusText.Text = $"Error: {message}";184 StatusText.Foreground = Brushes.Red;185});186```187188## Accessibility Considerations189190### Keyboard Navigation191- Tab order properly set192- All functions keyboard accessible193- Tooltips for all controls194- Keyboard shortcuts documented195196### Visual Accessibility197- High contrast mode support198- Configurable font sizes199- Color customization200- Clear visual feedback201202## Performance UI Guidelines203204### Responsive Design205- Async operations for long tasks206- Progress indicators207- Non-blocking UI updates208- Smooth animations209210### Update Patterns211```csharp212// UI updates from background thread213Application.Current.Dispatcher.Invoke(() =>214{215 // Update UI elements216}, DispatcherPriority.Background);217```218219## Window State Management220221### Saving Window State222```csharp223// On window closing224ConfigManager.Instance.SetWindowPosition(225 windowName, this.Left, this.Top,226 this.Width, this.Height);227228// On window loading229var pos = ConfigManager.Instance.GetWindowPosition(windowName);230if (pos != null)231{232 this.Left = pos.X;233 this.Top = pos.Y;234 this.Width = pos.Width;235 this.Height = pos.Height;236}237```238239### Multi-Monitor Support240- Remember which monitor241- Handle monitor disconnection242- Validate window positions243- Prevent off-screen windows244245## Custom Controls246247### Draggable Thumb Control248Used for resizing regions and windows:249```xml250<Thumb DragDelta="Thumb_DragDelta"251 Width="10" Height="10"252 Cursor="SizeNWSE"/>253```254255### Color Picker Integration256- Uses standard WPF color dialog257- Preview of selected color258- Saves recent colors259- Hex value display260261## Animation Guidelines262263### Fade Animations264```xml265<Storyboard x:Key="FadeIn">266 <DoubleAnimation267 Storyboard.TargetProperty="Opacity"268 From="0" To="1" Duration="0:0:0.3"/>269</Storyboard>270```271272### Smooth Transitions273- 300ms standard duration274- Ease-in-out timing function275- Avoid jarring movements276- Respect reduced motion preference277278## Service Management UI279280### Service Installation Dialog281- Shows available Python OCR services282- Installation progress283- Error handling and diagnostics284285### Service Diagnostics286- Health check status287- Port availability288- Service logs289- Test image processing290291## Dialog Patterns292293### Modal Dialogs294```csharp295var dialog = new SettingsWindow();296dialog.Owner = this;297dialog.ShowDialog(); // Blocks until closed298```299300### Confirmation Dialogs301```csharp302var result = MessageBox.Show(303 "Are you sure you want to delete this?",304 "Confirm",305 MessageBoxButton.YesNo,306 MessageBoxImage.Question);307308if (result == MessageBoxResult.Yes)309{310 // Perform action311}312```313
Also in SethRobinson/UGTLive
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| SethRobinson/UGTLive.cursor/rules/architecture-patterns.mdc · 103 | Cursor rules | buildtestlint-formatstyle+6 | 77/100 | 3 days ago | |
| SethRobinson/UGTLive.cursor/rules/async-threading-patterns.mdc · 103 | Cursor rules | styleuido-not | 65/100 | 3 days ago | |
| SethRobinson/UGTLive.cursor/rules/code-style-conventions.mdc · 103 | Cursor rules | stylearchtypesdocs | 62/100 | 3 days ago | |
| SethRobinson/UGTLive.cursor/rules/configuration-management.mdc · 103 | Cursor rules | archsecuritydatabaseapi+1 | 65/100 | 3 days ago | |
| SethRobinson/UGTLive.cursor/rules/debugging-testing.mdc · 103 | Cursor rules | buildteststylearch+3 | 69/100 | 3 days ago | |
| SethRobinson/UGTLive.cursor/rules/locale-invariant-formatting.mdc · 103 | Cursor rules | lint-formatuido-not | 61/100 | 3 days ago | |
| SethRobinson/UGTLive.cursor/rules/service-integration-patterns.mdc · 103 | Cursor rules | buildteststylearch | 69/100 | 3 days ago | |
| SethRobinson/UGTLive.cursor/rules/translation-workflow.mdc · 103 | Cursor rules | testlint-formatarchapi+3 | 66/100 | 3 days ago | |
| SethRobinson/UGTLive.cursor/rules/ugtlive-project-guide.mdc · 103 | Cursor rules | stylearchuideployment+1 | 69/100 | 3 days ago | |
| SethRobinson/UGTLive.cursor/rules/versioning-workflow.mdc · 103 | Cursor rules | stylegitdeploymentagent-behaviour+1 | 62/100 | 3 days ago | |
| SethRobinson/UGTLive.cursor/rules/wpf-ui-patterns.mdc · 103 | Cursor rules | setuplint-formatstylearch+1 | 66/100 | 3 days ago | |
| SethRobinson/UGTLiveAGENTS.md · 103 | AGENTS.md | testgitsecurityperformance+1 | 74/100 | 3 days ago |
Diff against .cursor/rules/architecture-patterns.mdc Diff against .cursor/rules/async-threading-patterns.mdc Diff against .cursor/rules/code-style-conventions.mdc Diff against .cursor/rules/configuration-management.mdc Diff against .cursor/rules/debugging-testing.mdc Diff against .cursor/rules/locale-invariant-formatting.mdc Diff against .cursor/rules/service-integration-patterns.mdc Diff against .cursor/rules/translation-workflow.mdc Diff against .cursor/rules/ugtlive-project-guide.mdc Diff against .cursor/rules/versioning-workflow.mdc Diff against .cursor/rules/wpf-ui-patterns.mdc Diff against AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| ThanhTrunggDEV/DontBeLazy.cursor/rules/rust-testing.mdc · 6 | Cursor rules | teststyletesting-strategy | 90/100 | 3 days ago | |
| ThanhTrunggDEV/DontBeLazy.cursor/rules/dart-testing.mdc · 6 | Cursor rules | teststyletypestesting-strategy | 85/100 | 3 days ago | |
| ThanhTrunggDEV/DontBeLazy.cursor/rules/dart-coding-style.mdc · 6 | Cursor rules | lint-formatstyletypesdo-not | 84/100 | 3 days ago | |
| ThanhTrunggDEV/DontBeLazy.cursor/rules/rust-security.mdc · 6 | Cursor rules | stylesecuritydatabasedo-not | 80/100 | 3 days ago | |
| imazen/imageflow.cursor/rules/ci.mdc · 4.4k | Cursor rules | setupbuildtestarch+3 | 79/100 | 3 days ago | |
| ThanhTrunggDEV/DontBeLazy.cursor/rules/dart-hooks.mdc · 6 | Cursor rules | lint-formatarchtesting-strategygit+1 | 78/100 | 3 days ago | |
| ThanhTrunggDEV/DontBeLazy.cursor/rules/rust-coding-style.mdc · 6 | Cursor rules | lint-formatstyle | 78/100 | 3 days ago | |
| SethRobinson/UGTLive.cursor/rules/architecture-patterns.mdc · 103 | Cursor rules | buildtestlint-formatstyle+6 | 77/100 | 3 days ago |
