Skip to content

Port asset filters and view options to xplat-editor from Wpf#3090

Open
xianbaum wants to merge 3 commits intostride3d:xplat-editorfrom
xianbaum:feature/port-asset-filters
Open

Port asset filters and view options to xplat-editor from Wpf#3090
xianbaum wants to merge 3 commits intostride3d:xplat-editorfrom
xianbaum:feature/port-asset-filters

Conversation

@xianbaum
Copy link
Copy Markdown

@xianbaum xianbaum commented Mar 13, 2026

PR Details

Ports the existing Wpf asset filters and view options. Most of the code is identical to the existing Wpf implementation, but some code was changed or refactored due to Avalonia's differences or new language features.

The following view options were not implemented as the required underlying asset explorer is not functionally complete, but will need to be implemented when the asset explorer is ported over.

  • "Assets and folders in selected folder". Asset list currently only shows assets, not folders regardless of the option selected.
  • View as tiles. Can't be implemented until tile view is implemented
  • Zoom in, zoom out. Same reason as above.
  • Asset tags seem unimplemented, so tag filters are implemented, but untested as well.

I have not added any unit tests yet, but I can do it if requested. Also, happy to implement any feedback.

image

Related Issue

#2746

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

@xianbaum
Copy link
Copy Markdown
Author

@dotnet-policy-service agree

@VaclavElias VaclavElias requested a review from Kryptos-FR March 13, 2026 16:34
@xianbaum
Copy link
Copy Markdown
Author

xianbaum commented Mar 13, 2026

I just realized there were some files I meant to remove that re-appeared after I tried squashing commits. Fixing now. Fixed!

@xianbaum xianbaum force-pushed the feature/port-asset-filters branch from 2446c09 to 18c9adc Compare March 13, 2026 19:06
@xianbaum xianbaum force-pushed the feature/port-asset-filters branch from 18c9adc to 6e1900b Compare March 13, 2026 19:35
@Kryptos-FR Kryptos-FR linked an issue Mar 22, 2026 that may be closed by this pull request
@Kryptos-FR Kryptos-FR self-assigned this Mar 22, 2026
Copy link
Copy Markdown
Member

@Kryptos-FR Kryptos-FR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. It works well. I have made a few remarks but otherwise LGTM.

</Styles.Resources>

<!-- Style for SearchComboBox -->
<Style Selector="sd|SearchComboBox">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might not have been obvious but I try to keep only editor styles here that are used by the property grid. Other styles go to a different file for now, though they might all get merged together at some point.

Can you extract that style to a new file (e.g. named SearchComboBoxStyle.axaml) and reference it in App.axaml from Stride.GameStudio.Avalonia.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

set => SetValue(AlternativeCommandProperty, value);
}

/// <summary>Gets or sets the modifier keys that activate the alternative command.</summary>
Copy link
Copy Markdown
Member

@Kryptos-FR Kryptos-FR Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: style preference, usually always on three lines or more. Never inlined. It makes it easier to maintain.

Note: there are a couple more occurrences of it in this file.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added newlines for the description for this and the other occurrences.

@@ -0,0 +1,17 @@
// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a new class/type that didn't exist before, we don't add "silicon studio" to the copyright header.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed "and Silicon Studio Corp. (https://www.siliconstudio.co.jp)". The other files are based on existing Wpf code, so I didn't update those.

}

/// <summary>
/// Gets or sets the collection of tags associated to this asset.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"gets or sets" is incorrect here since it only has a getter. I would only keep "The collection of tags associated to this asset".

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! I removed "Gets or sets" in other added summaries, as well.


/// <inheritdoc/>
public override int GetHashCode() =>
unchecked(((int)Category * 397) ^ StringComparer.OrdinalIgnoreCase.GetHashCode(Filter));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use the newer Api to compute the hash by combining Category and Filter.

HashCode.Combine(Category, Filter)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@xianbaum
Copy link
Copy Markdown
Author

Thanks for the contribution. It works well. I have made a few remarks but otherwise LGTM.

I appreciate the feedback. I will get on those requested changes.

</FluentTheme>
<!-- FIXME xplat-editor aggregate all custom styles into a single style/theme -->
<StyleInclude Source="avares://Stride.Core.Presentation.Avalonia/Themes/EditorStyles.axaml"/>
<StyleInclude Source="avares://Stride.Core.Presentation.Avalonia/Themes/SearchComboBoxStyle.axaml"/>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'm trying to keep them sorted. It should be moved between hyperlink and textlogviewer.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetized!

Copy link
Copy Markdown
Member

@Kryptos-FR Kryptos-FR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

❕🟢𝐌 Asset view filters

2 participants