InvenTree
InvenTree copied to clipboard
feat(PUI): Make header tabs links to simpilfy new tab behaviour
This PR enables opening header tab items per right-click to new tabs.
@sur5r 👀
Deploy Preview for inventree-web-pui-preview ready!
| Name | Link |
|---|---|
| Latest commit | cc21d0bfda2a368605279c68af805670ebd04b4e |
| Latest deploy log | https://app.netlify.com/projects/inventree-web-pui-preview/deploys/685af4f6810d9e0008a1f3d8 |
| Deploy Preview | https://deploy-preview-8779--inventree-web-pui-preview.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
Lighthouse |
1 paths audited Performance: 80 (🔴 down 18 from production) Accessibility: 81 (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 project configuration.
Codecov Report
:x: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 86.36%. Comparing base (0b451dc) to head (cc21d0b).
:warning: Report is 317 commits behind head on master.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| src/frontend/src/components/panels/PanelGroup.tsx | 50.00% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #8779 +/- ##
==========================================
- Coverage 86.56% 86.36% -0.20%
==========================================
Files 1243 1235 -8
Lines 54696 54263 -433
Branches 2230 2234 +4
==========================================
- Hits 47347 46865 -482
- Misses 6783 6830 +47
- Partials 566 568 +2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@matmair this is a nice addition. It would make sense to add it for the "Panel" nav tab links too?
Propaply; should this be included in this patch?
@matmair yes I think so, should be only very minimal diff
@SchrodingersGat added
@matmair I have noticed something here - the target link is different depending on how the click event is interpreted:
Starting Point
From this starting point, I will click the "Manufacturing" tab:
Left Mouse Button
Navigates to "Manufacturing" page in same tab
Left Mouse Button + Control Key
Opens "Manufacturing" page in new tab
Middle Mouse Button
Opens "Manufacturing" page (via demo site) in new tab:
Note that the URL in the address bar is different in this case!
The same behaviour hapens with the side panels too...
@SchrodingersGat I am not familiar with middle button. Which control key is this?
I am not familiar with middle button. Which control key is this?
No control key, just click on the link by pressing the scroll wheel on the mouse. Typically this just opens a link in a new tab (similar to ctrl+click).
However, it bypasses the browser onClick event system somehow so we can't catch it like a normal click. Somehow, this type of click uses a different baseUrl when generating the link target
Not really sure what to do about the middle click, I can not find where it is getting it's link in that case and why it is diefferent
Middle click doesn't work at all for me. It's not surprising given the main menu items are no links (a href) but buttons. I guess this is just a clash of worlds. This is no longer web browsing, so we can't expect it to behave as such.
that is the thing - there should be/is an a element rendered - so it should work the same as "normal" html
@matmair it looks like most of the effects of this PR have been reverted, not sure if that is intentional? But the <a> elements are no longer in play
I have re-introduced the rendering as elements; seems to work but I do not have a middle click for debug would appreciate a review @sur5r @SchrodingersGat
The links are there, but one doesn't end up on the correct view/subpage. It neither works with middle click nor with "copy link" and pasting the link into a new tab.
Example: Open a part and use the link from e.g. "Part pricing" to open an new tab. It opens the Part, but on "Part Details".
It seems to URLs are generated incorrectly, i.e. they point to /part/301/details/pricing instead of /part/301/pricing.
Seems to work on my machine - are we talking about the same thing?
https://github.com/user-attachments/assets/cf33177d-bc33-44c2-b6df-1776a9d07fd7
No, I'm talking about these links:
@sur5r it now should also work on the panels - can you please confirm?
Looks good, middle mouse button is working now! Thanks @matmair
