10000 Move settings to modals & better modal handling by adamshiervani · Pull Request #194 · jetkvm/kvm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Move settings to modals & better modal handling #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Feb 27, 2025

Conversation

adamshiervani
Copy link
Contributor
@adamshiervani adamshiervani commented Feb 26, 2025

As the setting sidebar is becoming unusable, we will need to move it to a modal. If we do that, we need a proper way to do modals. Route-based modals moves a lot of the state management to the URL and allows us to use react-router framework properly with e.g. error handling.

In this PR, I didn't change the underlying state management of each modal, but simply moved them into a route retaining all the state management it had before, except the logic for whether is supposed to be shown or not - that's offloaded to the URL now.

  • Removed sidebar-based settings view
  • Added dedicated routes for settings, including general, security, and update sections
  • Simplified modal and sidebar interactions
  • Improved animation and transition handling using motion library
  • Removed deprecated components and simplified route structure

@adamshiervani adamshiervani marked this pull request as draft February 26, 2025 00:08
@adamshiervani
Copy link
Contributor Author

All is finished, but I'll remove from draft mode once #185 is merged, and I've rebased on top of it

This commit introduces a comprehensive refactoring of the UI routing and state management:
- Removed sidebar-based settings view
- Replaced global modal state with URL-based routing
- Added dedicated routes for settings, including general, security, and update sections
- Simplified modal and sidebar interactions
- Improved animation and transition handling using motion library
- Removed deprecated components and simplified route structure
@adamshiervani adamshiervani changed the title refactor(modals): Move modals to URLs Move settings to modals & better modal handling Feb 27, 2025
This commit introduces several improvements to the USB configuration workflow:
- Refactored USB configuration dialog component
- Simplified USB config state management
- Moved USB configuration to hardware settings route
- Updated JSON-RPC type definitions
- Cleaned up unused imports and components
- Improved error handling and notifications
…ion hook

This commit introduces a new custom navigation hook `useDeviceUiNavigation` to replace direct usage of `useNavigate` across multiple components:
- Removed direct `useNavigate` imports in various components
- Added `navigateTo` method from new navigation hook
- Updated navigation calls in ActionBar, MountPopover, UpdateInProgressStatusCard, and other routes
- Simplified navigation logic and prepared for potential future navigation enhancements
- Removed console logs and unnecessary comments
Clean up unnecessary import of `useNavigate` from react-router-dom in device settings route
@adamshiervani adamshiervani marked this pull request as ready for review February 27, 2025 11:38
This commit introduces several changes to the device access and security settings:
- Renamed "Security" section to "Access" in settings navigation
- Moved local authentication routes from security to access
- Removed deprecated security settings route
- Added new route for device access settings with cloud and local authentication management
- Updated cloud URL and adoption logic to be part of the access settings
- Simplified routing and component structure for better user experience
…ettingsSectionHeader components

This commit introduces two new header components for settings pages:
- Created SettingsPageHeader for main page headers
- Created SettingsSectionHeader for subsection headers
- Replaced all existing SectionHeader imports with new components
- Updated styling and type definitions to support more flexible header rendering
Move dev channel update option from general settings to advanced settings
- Introduced new state and handler for dev channel toggle
- Removed dev channel option from general settings route
- Added dev channel toggle in advanced settings with error handling
@adamshiervani adamshiervani merged commit 4052b3d into dev Feb 27, 2025
1 check passed
@adamshiervani adamshiervani deleted the refactor/modal-routes branch February 27, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0