Skip to content

Conversation

@leolost2605
Copy link
Member

@leolost2605 leolost2605 commented Mar 1, 2024

Introduce a BackButton that automatically lables itself correctly with the preceding page and navigates back when clicked. Useful for elementary/settings#300 as well as in videos, appcenter, etc.

This will introduce an Adw dependency with minimum required version 1.4 which will break building granite on OS 7

@leolost2605 leolost2605 requested review from a team and danirabbit March 1, 2024 22:45
danirabbit and others added 3 commits March 2, 2024 01:10
@leolost2605
Copy link
Member Author

leolost2605 commented Mar 2, 2024

It now won't hide when there is no preceding page since that caused problems with it not being mapped again because it's not visible so that it won't recheck whether anything changed. It could still be implemented if needed but since there's usually always exactly one page that's the first and we know which one it is (Home on appcenter, category on settings, welcome on videos) I don't think it's worth the effort.

@leolost2605 leolost2605 requested a review from alice-mkh March 2, 2024 13:36
@danirabbit
Copy link
Member

I think @tintou has some thoughts about adding Adw as a dep here in Granite

Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

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

It's slightly less magical, but I think it's still worth it to merge this without the adw dep. NavigationView adds a navigation.pop action we can use to at least make the button function and then all that needs to be done in-app is to set the label.

@danirabbit danirabbit removed the request for review from alice-mkh May 12, 2025 16:14
Co-authored-by: Danielle Foré <danielle@elementary.io>
@leolost2605
Copy link
Member Author

@danirabbit feel free to take over and merge, I'm currently really limited on time :/

@danirabbit danirabbit requested a review from a team May 14, 2025 16:50
@danirabbit
Copy link
Member

@wpkelso does this sound good to you?

@wpkelso
Copy link
Member

wpkelso commented May 15, 2025

I'm fine with this. However, it does feel a little weird to have a technically half-implemented widget sitting around in the library. I think this would ideally be joined by a first-party Navigation View, but I don't know if we have the bandwidth to build and maintain that right now.

@danirabbit
Copy link
Member

It's slightly more implemented than the style class was though 😅

@danirabbit danirabbit merged commit 35227be into main May 15, 2025
5 checks passed
@danirabbit danirabbit deleted the leolost/back-button branch May 15, 2025 00:53
@wpkelso
Copy link
Member

wpkelso commented May 15, 2025

It's slightly more implemented than the style class was though 😅

Agreed; I put it out more as a consideration for the future, rather than a blocker.

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.

6 participants