Skip to content

feat(client/kotlin): add Favorite Resources menu#6107

Merged
ReactorScram merged 25 commits intomainfrom
feat/kotlin/favorites-menu
Aug 6, 2024
Merged

feat(client/kotlin): add Favorite Resources menu#6107
ReactorScram merged 25 commits intomainfrom
feat/kotlin/favorites-menu

Conversation

@ReactorScram
Copy link
Contributor

@ReactorScram ReactorScram commented Jul 31, 2024

It's missing a couple pieces, see the tasklist

image

Refs #5123

- [x] Add `Add to Favorites` and `Remove from Favorites` buttons
- [x] Update Changelog
- [x] Load and save Favorites from `SharedPreferences`
- [x] Wire up `onClick` events
- [x] Hide and show Resources in the menu based on whether they're favorited
- [x] Hide tabs if nothing is favorited
- [x] Tab icons
- [ ] Make the "Reset Settings" button also reset Favorites
- [ ] Change the "Add to Favorites" and "Remove from Favorites" to a checkbox or star or something cool

@ReactorScram ReactorScram self-assigned this Jul 31, 2024
@vercel
Copy link

vercel bot commented Jul 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
firezone ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 6, 2024 9:50pm

import ChangeItem from "./ChangeItem";
import Entries from "./Entries";
import Entry from "./Entry";
import Link from "next/link";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alphabetized

Copy link
Member

Choose a reason for hiding this comment

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

Can we enforce this with a formatter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not aware of one, but probably

@github-actions
Copy link

github-actions bot commented Aug 1, 2024

🐰Bencher

ReportTue, August 6, 2024 at 22:18:54 UTC
ProjectFirezone
Branchfeat/kotlin/favorites-menu
Testbedgithub-actions
Click to view all benchmark results
BenchmarkThroughputThroughput Results
bits/s | (Δ%)
Throughput Lower Boundary
bits/s | (%)
direct-tcp-client2server✅ (view plot)239,671,662.55 (-0.91%)237,136,976.31 (98.94%)
direct-tcp-server2client✅ (view plot)252,261,251.33 (+1.61%)241,460,754.60 (95.72%)
direct-udp-client2server✅ (view plot)288,524,984.95 (-0.16%)271,982,711.85 (94.27%)
direct-udp-server2client✅ (view plot)390,809,121.57 (-1.33%)384,035,718.45 (98.27%)
relayed-tcp-client2server✅ (view plot)249,794,902.11 (+1.55%)239,479,677.85 (95.87%)
relayed-tcp-server2client✅ (view plot)260,336,740.88 (+1.12%)247,098,680.16 (94.92%)
relayed-udp-client2server✅ (view plot)240,726,380.40 (+4.84%)218,931,548.08 (90.95%)
relayed-udp-server2client✅ (view plot)337,257,274.93 (-0.06%)317,821,760.44 (94.24%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

@ReactorScram ReactorScram marked this pull request as ready for review August 5, 2024 22:01
Copy link
Member

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

Nice work! I left some ideas and a question.

import ChangeItem from "./ChangeItem";
import Entries from "./Entries";
import Entry from "./Entry";
import Link from "next/link";
Copy link
Member

Choose a reason for hiding this comment

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

Can we enforce this with a formatter?

Comment on lines +54 to +76
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@+id/tvResourcesList"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:tabInlineLabel="true">

<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/baseline_star_24"
android:text="@string/resources_favorites" />

<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:icon="@drawable/all_resources"
android:text="@string/resources_all" />

</com.google.android.material.tabs.TabLayout>
Copy link
Member

Choose a reason for hiding this comment

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

This isn't a blocking concern but more of a question.

I don't really understand the choice of tabs here. To me, tabs are useful to separate unrelated entities, like Messages, Calls and Status in Whatsapp.

Favourite and non-favourite resources are still resources. Why split them into different tabs? In Fastmail for example, I can "Pin" emails (which is basically like a favourite). Those are sticky at the top of all my emails and the rest is sorted by "Recevied" date.

Copy link
Contributor Author

@ReactorScram ReactorScram Aug 6, 2024

Choose a reason for hiding this comment

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

Absolutely no reason, I just had the tabs half-way implemented and I forgot what the conclusion was for UX.

@Patticatti If the pinned / sticky favorites sounds good, I'll change it to that before merging later on. Your call as UX person

Copy link
Contributor

@Patticatti Patticatti left a comment

Choose a reason for hiding this comment

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

Looks nice - maybe we can start leaning into theme colours eventually

@ReactorScram ReactorScram enabled auto-merge August 6, 2024 22:16
@ReactorScram ReactorScram added this pull request to the merge queue Aug 6, 2024
auto-merge was automatically disabled August 6, 2024 22:18

Pull Request is not mergeable

Merged via the queue into main with commit 861ca18 Aug 6, 2024
@ReactorScram ReactorScram deleted the feat/kotlin/favorites-menu branch August 6, 2024 22:27
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.

3 participants