-
Notifications
You must be signed in to change notification settings - Fork 15
fix issue of crash when host navigate back #100
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a crash when navigating back by updating the child control reordering logic in StackContentView.
- Replaces unconditional remove/add with a move-to-end operation when the control already exists.
- Preserves original addition behavior for new controls.
Comments suppressed due to low confidence (2)
src/AvaloniaInside.Shell/StackContentView.cs:62
- Calling
ContainsthenIndexOfcauses two scans of the collection; consider usingIndexOfonce (and checking for >= 0) to detect existence and get the index in a single pass.
if (Children.Contains(control))
src/AvaloniaInside.Shell/StackContentView.cs:65
- Add unit tests for the branches where the control already exists as the last element (to verify
Moveis skipped) and where the control is new (to verify it's added correctly).
if (currentIndex != Children.Count - 1)
OmidID
added a commit
that referenced
this pull request
Sep 3, 2025
* Update dependency Projektanker.Icons.Avalonia.FontAwesome to 8.4.0 (#86) Co-authored-by: Renovate Bot <bot@renovateapp.com> * Update dependency Projektanker.Icons.Avalonia to 8.4.0 (#85) Co-authored-by: Renovate Bot <bot@renovateapp.com> * Update dependency Projektanker.Icons.Avalonia to v9 (#95) Co-authored-by: Renovate Bot <bot@renovateapp.com> * Update dependency Projektanker.Icons.Avalonia.FontAwesome to v9 (#96) Co-authored-by: Renovate Bot <bot@renovateapp.com> * fix issue of crash when host navigate back (#100) * #98 fix issue of crash when host navigate back * Update src/AvaloniaInside.Shell/StackContentView.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dependency ReactiveUI to 20.3.1 (#99) Co-authored-by: Renovate Bot <bot@renovateapp.com> * Update avalonia monorepo to 11.3.1 (#101) * Update avalonia monorepo to 11.3.1 * Update src/Directory.Packages.props Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/Directory.Packages.props Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dependency Xamarin.AndroidX.Core.SplashScreen to 1.0.1.16 (#102) Co-authored-by: Renovate Bot <bot@renovateapp.com> * Update avalonia monorepo to 11.3.2 (#103) Co-authored-by: Renovate Bot <bot@renovateapp.com> * Update dependency ReactiveUI to 20.4.1 (#104) Co-authored-by: Renovate Bot <bot@renovateapp.com> * Synchronize window title with navigation bar header (#105) * Initial plan * Implement window title synchronization with navigation bar header Co-authored-by: OmidID <956077+OmidID@users.noreply.github.com> * Clean up implementation and restore original target frameworks Co-authored-by: OmidID <956077+OmidID@users.noreply.github.com> * Implement OnNavigate event and revert primary constructor changes Co-authored-by: OmidID <956077+OmidID@users.noreply.github.com> * Restore original target frameworks Co-authored-by: OmidID <956077+OmidID@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: OmidID <956077+OmidID@users.noreply.github.com> * Update avalonia monorepo to 11.3.4 (#108) Co-authored-by: Renovate Bot <bot@renovateapp.com> * Update dependency Xamarin.AndroidX.Core.SplashScreen to 1.0.1.17 (#109) Co-authored-by: Renovate Bot <bot@renovateapp.com> * Update dependency ReactiveUI to v21 (#110) Co-authored-by: Renovate Bot <bot@renovateapp.com> * Update avalonia monorepo to 11.3.5 (#111) Co-authored-by: Renovate Bot <bot@renovateapp.com> * Release version 1.3.2.2 - Update package version in csproj and README (#112) * Initial plan * Update version to 1.3.2.2 in csproj and README Co-authored-by: OmidID <956077+OmidID@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: OmidID <956077+OmidID@users.noreply.github.com> --------- Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: OmidID <956077+OmidID@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.