InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

Add row context (right click) additionally to actions in tables

Open matmair opened this issue 1 year ago • 4 comments

This draft PR adds right-click context menus to tables. The content can be determined by a custom callback or computed from the row actions. I am interested in feedback - you should be able to play with it using the preview deployment. grafik Closes https://github.com/invenhost/InvenTree/issues/128

matmair avatar Aug 27 '24 22:08 matmair

Deploy Preview for inventree-web-pui-preview ready!

Name Link
Latest commit 3708d24e031660394a89982f79f3e8d6657abd59
Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/6736654c87da7c00083a652f
Deploy Preview https://deploy-preview-8013--inventree-web-pui-preview.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 86 (no change from production)
Best Practices: 100 (no change from production)
SEO: 78 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Aug 27 '24 22:08 netlify[bot]

Codecov Report

Attention: Patch coverage is 18.18182% with 9 lines in your changes missing coverage. Please review.

Project coverage is 84.41%. Comparing base (ee01ac5) to head (3708d24). Report is 286 commits behind head on master.

Files with missing lines Patch % Lines
src/frontend/src/tables/InvenTreeTable.tsx 18.18% 9 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8013      +/-   ##
==========================================
+ Coverage   84.38%   84.41%   +0.02%     
==========================================
  Files        1178     1178              
  Lines       53733    53744      +11     
  Branches     2022     2027       +5     
==========================================
+ Hits        45345    45368      +23     
+ Misses       7875     7849      -26     
- Partials      513      527      +14     
Flag Coverage Δ
pui 68.87% <18.18%> (+0.15%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 27 '24 22:08 codecov[bot]

I think we need to have a larger conversation about how we interact with tables - and make the "user expectation" consistent.

There are:

  • Row actions (via buttons)
  • Row actions (via context menu)
  • Some rows take you somewhere else when you click them
  • Some rows open up a context drawer when clicked on

Is there a way we can visually indicate what happens when you left-click or right-click on a row, do you think?

SchrodingersGat avatar Aug 29 '24 09:08 SchrodingersGat

I am not aware that other apps provide this, have not seen this pattern somewhere else consciously. Maybe linking somewhere else should just be a highlighted link somewhere at the beginning of the table to make it clear.

matmair avatar Aug 29 '24 16:08 matmair

@SchrodingersGat how should we proceed here?

matmair avatar Nov 12 '24 11:11 matmair

@matmair I am happy with this in principle. Looking at the current state, there are some visual styling issues that need to be addressed:

Here is a regular row-context menu (via the drop-down in the "actions" column):

image

And the same menu accessed via right-click context menu:

image

So, the colors need fixing, and some padding around the menu item

SchrodingersGat avatar Nov 13 '24 22:11 SchrodingersGat

I will look into reusing the renderer from the actions dropdown

matmair avatar Nov 14 '24 07:11 matmair

@SchrodingersGat I have addressed the styling; ready for review & merge

matmair avatar Nov 14 '24 21:11 matmair

Fantastic, looks great now. This is a really nice addition.

SchrodingersGat avatar Nov 14 '24 23:11 SchrodingersGat