Skip to content
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

Feature: Added slider to control item size (phase 1) #14719

Merged
merged 2 commits into from
Feb 20, 2024
Merged

Conversation

yaira2
Copy link
Member

@yaira2 yaira2 commented Feb 14, 2024

Resolved / Related Issues

  • Were these changes approved in an issue or discussion with the project maintainers? In order to prevent extra work, feature requests and changes to the codebase must be approved before the pull request will be reviewed. This prevents extra work for the contributors and maintainers.
    For Feature: Slider to control thumbnail size #10492...

Validation
How did you test these changes?

  • Did you build the app and test your changes?
  • Did you check for accessibility? You can use Accessibility Insights for this.
  • Did you remove any strings from the en-us resource file?
    • Did you search the solution to see if the string is still being used?
  • Did you implement any design changes to an existing feature?
    • Was this change approved?
  • Are there any other steps that were used to validate these changes?
    1. Confirm view type can still be overridden in folders (unless syncing is enabled)
    2. Confirm the view size syncs between all folders (even when syncing is turned off)
    3. Confirm each view type remembers it's size
    4. Confirm keyboard shortcuts to change view & view size are working
    5. Confirm size slider is working

Screenshots (optional)
Add screenshots here.

@yaira2 yaira2 marked this pull request as draft February 14, 2024 03:22
@yaira2 yaira2 force-pushed the ya/DetailsHeight branch 3 times, most recently from 8eb9f21 to 3f9d349 Compare February 14, 2024 04:30
Copy link
Member Author

Choose a reason for hiding this comment

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

Note to update docs

@yaira2 yaira2 marked this pull request as ready for review February 14, 2024 05:10
@yaira2 yaira2 changed the title Feature: Item size slider Feature: Added slider to control item size Feb 14, 2024
@yaira2 yaira2 requested a review from 0x5bfa February 14, 2024 05:36
0x5bfa

This comment was marked as outdated.

@Aghyads
Copy link

Aghyads commented Feb 14, 2024

Sorry i'm new hear. So this is still in progress, not yet done to use, right?

@yaira2
Copy link
Member Author

yaira2 commented Feb 14, 2024

@Aghyads this pull request adds the requested feature, there is still work to be done but the basic implementation is almost complete.

@yaira2 yaira2 requested a review from 0x5bfa February 14, 2024 19:41
@yaira2 yaira2 force-pushed the ya/DetailsHeight branch 3 times, most recently from 9949496 to e53df41 Compare February 15, 2024 04:18
@@ -206,6 +170,7 @@ protected virtual void OnContextChanged(string propertyName)

internal class LayoutDecreaseSizeAction : IAction
Copy link
Member

Choose a reason for hiding this comment

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

IsExecutable should be implemented.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

if (UserSettingsService.LayoutSettingsService.ItemSizeColumnsView > Constants.IconHeights.ColumnsView.Minimum)
UserSettingsService.LayoutSettingsService.ItemSizeColumnsView -= Constants.IconHeights.ColumnsView.Increment;
break;
}

return Task.CompletedTask;
}
}

internal class LayoutIncreaseSizeAction : IAction
Copy link
Member

Choose a reason for hiding this comment

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

As above.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

Copy link
Member

Choose a reason for hiding this comment

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

The values of LayoutDecreaseSizeDescription and LayoutIncreaseSizeDescription should be changed because their messages are currently limited to the grid layout.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

@yaira2 yaira2 force-pushed the ya/DetailsHeight branch 2 times, most recently from e039d09 to f6ce634 Compare February 15, 2024 19:09
@yaira2 yaira2 changed the title Feature: Added slider to control item size Feature: Added slider to control item size (phase 1) Feb 15, 2024
Comment on lines 189 to 190
public bool IsExecutable
=> contentPageContext.PageType is not ContentPageTypes.Home;
Copy link
Member

Choose a reason for hiding this comment

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

IsExecutable should be false when ExecuteAsync does nothing.

Copy link
Member Author

@yaira2 yaira2 Feb 16, 2024

Choose a reason for hiding this comment

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

We can add that but it's a lot of additional logic with little benefit.

Copy link
Member

Choose a reason for hiding this comment

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

It prevents meaningless commands from appearing in the command palette.

@yaira2 yaira2 requested a review from hishitetsu February 18, 2024 03:26
Copy link
Member

@0x5bfa 0x5bfa left a comment

Choose a reason for hiding this comment

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

✅ Tested locally; works for me.

Comment on lines 266 to 268
private static readonly IUserSettingsService UserSettingsService = Ioc.Default.GetRequiredService<IUserSettingsService>();
private readonly IDisplayPageContext displayPageContext = Ioc.Default.GetRequiredService<IDisplayPageContext>();
private readonly IContentPageContext contentPageContext = Ioc.Default.GetRequiredService<IContentPageContext>();
Copy link
Member

Choose a reason for hiding this comment

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

Should all be private properties with pascal case.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

Comment on lines 173 to 175
private static readonly IUserSettingsService UserSettingsService = Ioc.Default.GetRequiredService<IUserSettingsService>();
private readonly IDisplayPageContext displayPageContext = Ioc.Default.GetRequiredService<IDisplayPageContext>();
private readonly IContentPageContext contentPageContext = Ioc.Default.GetRequiredService<IContentPageContext>();
Copy link
Member

Choose a reason for hiding this comment

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

As above.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

Comment on lines 69 to 72
if (value != UserSettingsService.LayoutSettingsService.ItemSizeDetailsView)
{
NotifyPropertyChanged(nameof(ItemSize));
}
Copy link
Member

Choose a reason for hiding this comment

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

Remove brackets

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

@hishitetsu
Copy link
Member

I tried to test, but #14785 prevents me from testing properly.

@yaira2 yaira2 added ready to merge Pull requests that are approved and ready to merge and removed needs - code review labels Feb 20, 2024
@yaira2 yaira2 merged commit 4c40a7d into main Feb 20, 2024
6 checks passed
@yaira2 yaira2 deleted the ya/DetailsHeight branch February 20, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants