-
Notifications
You must be signed in to change notification settings - Fork 45
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
More natural click behaviour for tables #2889
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Taylor.
Can we extend this behavior to all tables?
Workflows -> Workflows list (Addressed in the comment)
Subscriptions -> Subscriptions list
Billing Account -> BAs list
Yes! (Please see the PR though... workflows is different and will take more work. And the others will be in TB.) |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2889 +/- ##
==========================================
+ Coverage 91.41% 91.44% +0.03%
==========================================
Files 343 343
Lines 12355 12354 -1
==========================================
+ Hits 11294 11297 +3
+ Misses 1061 1057 -4 ☔ View full report in Codecov by Sentry. |
@theroinaochieng , can we try to get this reviewed and merged before release for staging tomorrow AM? it has product approval, needs Elixir |
@@ -173,15 +174,11 @@ defmodule LightningWeb.DashboardLive.Components do | |||
<.tr | |||
:for={project <- @projects} | |||
id={"projects-table-row-#{project.id}"} | |||
class="hover:bg-gray-100 transition-colors duration-200" | |||
class="hover:bg-gray-100 transition-colors duration-200 cursor-pointer" | |||
phx-click={JS.navigate(~p"/projects/#{project.id}/w")} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the component a bit rigid. Could we instead inject the click behavior by introducing a on_row_click
attribute. Something like this ?
<.tr
:for={project <- @projects}
id={"projects-table-row-#{project.id}"}
class="hover:bg-gray-100 transition-colors duration-200 cursor-pointer"
phx-click={@on_row_click && @on_row_click.(project)}
>
and on_row_click
would be something like this
<.user_projects_table
projects={@projects}
on_row_click={fn project -> JS.navigate(~p"/projects/#{project.id}/w") end}
/>
Description
In Ghana this week, users were having a very hard time figuring out how to access their project after signing up. While other changes are required, this is a cheap fix for a behaviour I noticed... even when people move their mouse of the projects item in the table, they can't figure out how to actually access it. (Hint: you've got to move your mouse over the text of the project name.)
This PR makes the whole row in the projects table clickable, while ensuring that individual links and buttons still prevent that row-level behaviour and take you where you want to go.
Note that I really wanted to do this for the workflow table, but that table seems to be built in a much different way and I couldn't figure it out with a quick google/chatgpt so moving on. (We don't have access to
<.tr >
in the workfows table 😔)Validation steps
AI Usage
Please disclose how you've used AI in this work (it's cool, we just want to know!):
You can read more details in our Responsible AI Policy
Pre-submission checklist
:owner
,:admin
,:editor
,:viewer
)