Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
943aa43
feat: Add auto-dismiss functionality to failure dialogs with configur…
skanda890 Dec 4, 2025
a1efd11
Add FeedbackService for collecting system info and logs
skanda890 Dec 4, 2025
db9761f
Add GitHub integration and feedback UI components
skanda890 Dec 4, 2025
6976cc6
Add FeedbackDialog XAML and code-behind
skanda890 Dec 4, 2025
62fd011
Add documentation and implementation guide for feedback feature
skanda890 Dec 4, 2025
1cacdf9
Update src/UniGetUI.Tests/OperationFailedDialogTests.cs
skanda890 Dec 4, 2025
18a7180
Update src/UniGetUI.Tests/OperationFailedDialogTests.cs
skanda890 Dec 4, 2025
d48cac8
Update src/UniGetUI/Pages/DialogPages/OperationFailedDialog.xaml.cs
skanda890 Dec 4, 2025
6f88f53
Update src/UniGetUI/Pages/DialogPages/OperationFailedDialog.xaml.cs
skanda890 Dec 4, 2025
ffceeca
Update src/UniGetUI/Pages/DialogPages/OperationFailedDialog.xaml.cs
skanda890 Dec 4, 2025
fcac6b2
Update src/UniGetUI/Pages/Dialogs/FeedbackDialog.xaml.cs
skanda890 Dec 4, 2025
7124b57
Update src/UniGetUI/Services/FeedbackService.cs
skanda890 Dec 4, 2025
5775d31
Update src/UniGetUI/Services/FeedbackService.cs
skanda890 Dec 4, 2025
ebd31a4
Update src/UniGetUI/Services/FeedbackService.cs
skanda890 Dec 4, 2025
6b41582
Update src/UniGetUI/Services/FeedbackService.cs
skanda890 Dec 4, 2025
aedeb8f
Update src/UniGetUI/Services/GitHubIssueHelper.cs
skanda890 Dec 4, 2025
e09f8c7
Update src/UniGetUI/Pages/Dialogs/FeedbackDialog.xaml
skanda890 Dec 4, 2025
0b4c402
Fix: Resolve bug risks and code quality issues
skanda890 Dec 4, 2025
f6be516
Fix: Update documentation to fix markdown linting issues
skanda890 Dec 4, 2025
05fb964
Add comprehensive unit tests for feedback system
skanda890 Dec 4, 2025
9c135c5
Update documentation with test coverage information
skanda890 Dec 4, 2025
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
133 changes: 133 additions & 0 deletions CHANGELOG_AUTO_DISMISS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Changelog - Auto-Dismiss Feature

## [Unreleased]

### Added
- **Auto-dismiss functionality for failure dialogs** (#2097)
- Configurable timeout (3-60 seconds, default 10)
- Visual countdown display with InfoBar
- Pause on hover for user convenience
- "Keep Open" button to cancel auto-dismiss
- Settings integration for global enable/disable
- Timeout configuration slider in settings
- Comprehensive unit test coverage
- Full documentation

### Changed
- `OperationFailedDialog`: Added auto-dismiss timer logic
- `OperationFailedDialog.xaml`: Added InfoBar for countdown display and hover detection
- XAML CloseButton now directly calls `CloseDialog` method

### Refactored
- **Simplified state management**: Removed boolean flags in favor of timer-based state
- Removed `_autoDismissCancelled` flag (use `timer == null` instead)
- Removed `_isHovered` flag (use `timer.Stop()`/`Start()` instead)
- Removed `IsAutoDismissEnabled()` method (merged into `GetAutoDismissTimeout()`)
- Removed `CloseButton_Click()` indirection
- **Cleaner configuration**: Single method returns `int?` for timeout or `null` if disabled
- **Reduced branching**: Timer tick handler no longer checks flags
- **Better null-safety**: Nullable timer with safe navigation operators

### Technical Details
- **Dependencies**: `Microsoft.UI.Dispatching.DispatcherTimer`
- **Settings keys**:
- `AutoDismissFailureDialogs` (bool, default: true)
- `AutoDismissFailureDialogsTimeout` (int, default: 10)
- **Timer implementation**:
- 1-second tick interval
- Nullable type allows representing cancelled state
- Stop/Start used for pause/resume instead of flag checks
- **Timeout validation**: `Math.Clamp(timeout, 3, 60)`

### Testing
- Added `OperationFailedDialogTests.cs` with 8 unit tests
- All tests passing
- Test categories: AutoDismiss, State
- Manual testing completed for:
- Auto-dismiss functionality
- Hover pause behavior
- "Keep Open" button
- Settings persistence
- Timeout configuration

### Documentation
- Created `AUTO_DISMISS_FEATURE.md` with:
- Feature overview
- User interface description
- Technical implementation details (including simplification patterns)
- Testing procedures
- Code quality principles applied
- Localization strings
- Future enhancement ideas

## Implementation Notes

### Design Decisions

1. **Default enabled**: Feature is on by default as it solves a real UX pain point
2. **10-second default**: Provides enough time to read error without being intrusive
3. **3-60 second range**: Balance between usability and practicality
4. **Pause on hover**: Prevents accidental dismissal while reading
5. **Per-dialog cancellation**: "Keep Open" applies only to current dialog
6. **Timer-based state**: Simpler than boolean flags, fewer edge cases

### Code Quality Improvements

**Before refactoring:**
- 2 state flags (`_autoDismissCancelled`, `_isHovered`)
- 2 configuration methods (`IsAutoDismissEnabled()`, `GetAutoDismissTimeout()`)
- Branching in tick handler to check flags
- Indirection method for close button

**After refactoring:**
- 0 state flags (timer represents state)
- 1 configuration method (returns `int?`)
- No branching in tick handler
- Direct method binding in XAML

**Result:**
- ~30% less code in auto-dismiss logic
- Easier to understand and maintain
- Same functionality, simpler implementation
- Better follows SOLID principles

### Backward Compatibility
- No breaking changes
- Existing dialog behavior preserved when feature is disabled
- Settings use sensible defaults if not configured

### Performance Impact
- Minimal: Single timer per dialog
- Timer stops immediately on close/cancel
- No continuous polling or resource leaks
- Nullable timer has negligible memory overhead

## Complexity Metrics

### Lines of Code (Auto-Dismiss Logic Only)
- Core implementation: ~80 lines
- Unit tests: ~150 lines
- Documentation: ~400 lines

### Cyclomatic Complexity
- `GetAutoDismissTimeout()`: 2 (simple)
- `AutoDismissTimer_Tick()`: 2 (simple)
- Overall method complexity: Low

### Maintainability Index
- High: Clear state model, minimal branching
- Well-documented: Inline comments explain design decisions
- Testable: 8 unit tests cover key scenarios

## Related Issues

- Closes #2097: "[ENHANCEMENT] After a time duration let the update fail screen disappear"
- Discussed alternative: "Close All Failures" button (could be future enhancement)

## Migration Notes

For users upgrading:
- Auto-dismiss is **enabled by default**
- To disable: Settings β†’ General β†’ Interface β†’ Toggle off "Auto-dismiss failure dialogs"
- Default timeout is 10 seconds
- Settings can be adjusted per preference
Loading
Loading