Skip to content

Code Quality: Fixed an issue where suggestions in Path mode don't update when switching tabs #17263

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 3 commits into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions src/Files.App.Controls/Omnibar/Omnibar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ internal protected bool TryToggleIsSuggestionsPopupOpen(bool wantToOpen)
return false;
}

if (CurrentSelectedMode is not null)
{
_textBoxSuggestionsListView.ItemTemplate = CurrentSelectedMode.ItemTemplate;
_textBoxSuggestionsListView.ItemsSource = CurrentSelectedMode.ItemsSource;
}

_textBoxSuggestionsPopup.IsOpen = wantToOpen;

GlobalHelper.WriteDebugStringForOmnibar("The suggestions pop-up is open.");
Expand Down
8 changes: 7 additions & 1 deletion src/Files.App.Controls/Omnibar/OmnibarMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ protected override void OnApplyTemplate()

_modeButton = GetTemplateChild(TemplatePartName_ModeButton) as Button
?? throw new MissingFieldException($"Could not find {TemplatePartName_ModeButton} in the given {nameof(OmnibarMode)}'s style.");


RegisterPropertyChangedCallback(ItemsSourceProperty, (d, dp) =>
{
if (_ownerRef is not null && _ownerRef.TryGetTarget(out var owner))
owner.TryToggleIsSuggestionsPopupOpen(true);
});

Loaded += OmnibarMode_Loaded;
_modeButton.PointerEntered += ModeButton_PointerEntered;
_modeButton.PointerPressed += ModeButton_PointerPressed;
Expand Down
21 changes: 12 additions & 9 deletions src/Files.App/UserControls/NavigationToolbar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -407,26 +407,29 @@
<DataTemplate x:DataType="dataitems:NavigationBarSuggestionItem">
<Grid Padding="0,0,4,0" ColumnSpacing="12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="16" />
<!--<ColumnDefinition Width="Auto" />-->
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>

<Grid Grid.Column="0">
<!--<Grid
Grid.Column="0"
Width="16"
Height="16">
<Viewbox
Width="16"
Height="16"
Visibility="{x:Bind Glyph, Converter={StaticResource NullToVisibilityCollapsedConverter}}">
<FontIcon Foreground="{ThemeResource App.Theme.IconBaseBrush}" Glyph="{x:Bind Glyph}" />
Visibility="{x:Bind Glyph, Converter={StaticResource NullToVisibilityCollapsedConverter}, Mode=OneWay}">
<FontIcon Foreground="{ThemeResource App.Theme.IconBaseBrush}" Glyph="{x:Bind Glyph, Mode=OneWay}" />
</Viewbox>
<controls:ThemedIcon Style="{x:Bind ThemedIconStyle}" Visibility="{x:Bind ThemedIconStyle, Converter={StaticResource NullToVisibilityCollapsedConverter}}" />
<controls:ThemedIcon Style="{x:Bind ThemedIconStyle, Mode=OneWay}" Visibility="{x:Bind ThemedIconStyle, Converter={StaticResource NullToVisibilityCollapsedConverter}, Mode=OneWay}" />
<Image Source="{x:Bind ActionIconSource, Mode=OneWay}" />
</Grid>
</Grid>-->

<!-- Primary Title -->
<TextBlock
x:Name="PrimaryDisplayBlock"
Grid.Column="1"
Grid.Column="0"
VerticalAlignment="Center"
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
TextTrimming="CharacterEllipsis"
Expand All @@ -437,9 +440,9 @@
<!-- Keyboard Shortcuts -->
<keyboard:KeyboardShortcut
x:Name="RightAlignedKeyboardShortcut"
Grid.Column="2"
Grid.Column="1"
VerticalAlignment="Center"
HotKeys="{x:Bind HotKeys}" />
HotKeys="{x:Bind HotKeys, Mode=OneWay}" />
</Grid>
</DataTemplate>
</controls:OmnibarMode.ItemTemplate>
Expand Down
Loading