Skip to content

RouteList: add bookmark icon to flagged routes#98

Merged
incognitojam merged 8 commits intocommaai:masterfrom
ugtthis:show-clearer-bookmarked-routes
Mar 26, 2025
Merged

RouteList: add bookmark icon to flagged routes#98
incognitojam merged 8 commits intocommaai:masterfrom
ugtthis:show-clearer-bookmarked-routes

Conversation

@ugtthis
Copy link
Copy Markdown
Contributor

@ugtthis ugtthis commented Aug 16, 2024

I noticed that the car icon doesn't have much utility. I also noticed that although new-connect does show the # of user flags, we can make it clearer that a route has been bookmarked by showing a bookmark icon and making the CardHeader hierarchy clearer. I removed Avatar.tsx since it was only used to add the circle background behind the car icon.

A clearer hierarchy with a bookmark icon appearing on routes that have user flags helps with finding routes quicker while making use of a previous icon.


New Card Header UI w/bookmark

new-ui

Comparing UI Video

comparing-card-header-ui.mp4

@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 16, 2024

deployed preview: https://98.connect-d5y.pages.dev

Welcome to connect! Make sure to:

  • read the contributing guidelines
  • mark your PR as a draft until it's ready to review
  • post the preview on Discord; feedback from users will speedup the PR review

Mobile

Desktop

@incognitojam
Copy link
Copy Markdown
Collaborator

incognitojam commented Jan 10, 2025

I feel like having a bookmark icon makes it seem like a button that you could press to bookmark routes from the web

@ugtthis
Copy link
Copy Markdown
Contributor Author

ugtthis commented Jan 10, 2025

TL;DR - It can appear clickable though the tradeoff could be worth it since it improves searching for clips for users today in a lean, minimal, familiar way

--

Main reason why I choose a bookmark, versus heart or star, etc. is because openpilot UI uses the same symbol when people are flagging things while driving. I thought it was consistent with what you’d expect when looking on connect and seeing a clip with the same icon that you pressed on your comma device while driving.

I guess if a “heart” feature is about to get implemented where you can favorite clips so they appear in a different folder(similar to the photo UX on iPhones) then I’d say the bookmark feature isn’t worth implementing right now.

The “heart” feature seems to be more complex than the bookmark feature so I thought the bookmark feature would be a good intermediary thing to have to improve the UX in searching for clips that users could use sooner vs waiting on the “heart” feature

@ugtthis
Copy link
Copy Markdown
Contributor Author

ugtthis commented Jan 10, 2025

Either way I’d still do a PR to remove the top left circle car icon on the card. It doesn’t help make searching for drives easier since it appears on all cars and is more stylistic(which is fine) but with the small space the card has, the icon ends up creating more noise. I think trip cards should only contain elements that help user find drives easier/faster which is important because currently most users go on connect to do one thing, which is look for past drives

@incognitojam incognitojam added design UI/UX discussion or updates enhancement new feature or request labels Jan 31, 2025
@incognitojam incognitojam changed the title UI: Change car icon to show bookmarked routes RouteList: add bookmark icon to flagged routes Mar 25, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 25, 2025

Changes:

path lines diff
./pages/dashboard/components/RouteList.tsx 126 +12
./components/material/Avatar.tsx 0 -23

Total lines: 4048 (-11)

@incognitojam
Copy link
Copy Markdown
Collaborator

Sorry you didn't get a response on this, priority has been shipping the updated flash.comma.ai the last month or so

TL;DR - It can appear clickable though the tradeoff could be worth it since it improves searching for clips for users today in a lean, minimal, familiar way

I think we can avoid making it look clickable with a different icon/having it filled? In #172 I tried adding an icon for this and just used a flag in a circle (forgot that we use the bookmark icon in openpilot) and it doesn't look like a button to me.
image

Want to rebase this PR and try adding it again?

@incognitojam incognitojam marked this pull request as draft March 25, 2025 13:23
@ugtthis ugtthis force-pushed the show-clearer-bookmarked-routes branch from 07f9865 to 36ad513 Compare March 26, 2025 14:53
@ugtthis
Copy link
Copy Markdown
Contributor Author

ugtthis commented Mar 26, 2025

No worries! Thanks for getting back to me

I think we can avoid making it look clickable with a different icon/having it filled?

I changed the icon to match the timeline colors of what you'd see if a user has flags on the timeline UI but I am using the same flag icon you referenced. I also was aiming for the flag icon to look more like a badge to indicate the status of a card rather than a element that can be clicked/interacted with.

flag-ui-change-1


I still kept Avatar component removed since it is still not being used by anything else.

@ugtthis ugtthis marked this pull request as ready for review March 26, 2025 15:41
@incognitojam
Copy link
Copy Markdown
Collaborator

Those stats are a little concerning 😅

Copy link
Copy Markdown
Collaborator

@incognitojam incognitojam left a comment

Choose a reason for hiding this comment

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

I'm okay with merging this, there is still a decision to be made about whether to use "bookmarks" or "flags" (like you said openpilot has a bookmark icon, so maybe we should just use that too) but the style can be changed later.

}
subhead={location()}
trailing={
<Show when={timeline()?.userFlags}>
Copy link
Copy Markdown
Collaborator

@incognitojam incognitojam Mar 26, 2025

Choose a reason for hiding this comment

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

I think this should be wrapped in a <Suspense> otherwise it blocks the RouteCard from showing until the timeline is fetched

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I dont think suspense is needed here because:

  • We're simply conditionally showing the flag icon only after the data loads - using timeline()?.userFlags with <Show> automatically handles the pending state by showing nothing until the data arrives
  • RouteCard won't be blocked because in SolidJS, resources are granular - the rest of the component continues rendering while timeline() loads. Only the specific UI element that depends on timeline()?.userFlags waits
  • Suspense would be needed if we wanted to show a loading indicator instead of nothing while the data loads

Let me know what you think

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

When I scroll the route list right now on the live site, I can see the stats loading, but on this PR when I scroll it shows the whole card loading instead

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

• I think the root issue was "Engaged" statistic was accessing timeline data directly without checking if it exists
• Fixed by adding timeline() ? check before calling formatEngagement
• This prevents rendering from blocking while timeline data loads
• Cards now render immediately with statistics loading independently, just like on the live site

The PR site seems to be loading as expected when I checked. let me know if you see differently

Copy link
Copy Markdown
Collaborator

@incognitojam incognitojam Mar 26, 2025

Choose a reason for hiding this comment

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

It's still doing the same thing

Fixed by adding timeline() ? check before calling formatEngagement

Calling a resource like timeline() is what triggers suspense, and the next parent <Suspense> component is in <RouteList>

@ugtthis
Copy link
Copy Markdown
Contributor Author

ugtthis commented Mar 26, 2025

there is still a decision to be made about whether to use "bookmarks" or "flags"

I thought the flag was a good idea cause it is more consistent with connect's "User Flag" metric and maybe it might make more sense to change the bookmark icon on openpilot to a flag icon. But like you mentioned this can be handled later

@ugtthis ugtthis requested a review from incognitojam March 26, 2025 16:51
@incognitojam incognitojam merged commit 0431e83 into commaai:master Mar 26, 2025
7 checks passed
@ugtthis ugtthis deleted the show-clearer-bookmarked-routes branch March 28, 2025 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design UI/UX discussion or updates enhancement new feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants