Page MenuHomePhorge

Diffusion: add "Permalink" button
Needs ReviewPublic

Authored by valerio.bozzolan on Jun 16 2023, 23:09.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 18, 20:23
Unknown Object (File)
Thu, Apr 4, 01:12
Unknown Object (File)
Thu, Apr 4, 00:22
Unknown Object (File)
Mar 24 2024, 07:02
Unknown Object (File)
Mar 24 2024, 07:02
Unknown Object (File)
Mar 20 2024, 11:01
Unknown Object (File)
Mar 20 2024, 11:01
Unknown Object (File)
Mar 15 2024, 14:11

Details

Reviewers
None
Group Reviewers
O1: Blessed Committers
Maniphest Tasks
T15256: Diffusion file: add a way to copy permalink
Summary

The intent of this change is to allow people to have such lovely conversation
and that they make sense over time even after subsequent commit:

  • A: where the hell is the logic of this?!?
  • B: yeah look here <permalink> line 420

After this change, having that "<permalink>" is easier thanks to the "Permalink" button
that just generates the canonical URL with the stable commit hash:

Diffusion after D25301 highlighted with GIMP green peppers.png (763×994 px, 142 KB)

From there, you can highlight line 420, being sure that your quote will always remain correct.

To clarify, if you are visiting this page:

https://we.phorge.it/source/phorge/browse/master/webroot/rsrc/css/application/base/phui-theme.css

This would be the destination of the Permalink button:

https://we.phorge.it/source/phorge/browse/master/webroot/rsrc/css/application/base/phui-theme.css;ad01e26af71e7d7936dd2347eca47674255a7838

Note that other platforms have such button. For example, see the "Permalink" button
on this random GitLab repository:

https://gitlab.com/ItalianLinuxSociety/linux.it/-/blob/master/_config.yml

There is still some room for contribution to make the URL change without reloading
the page. Any follow-up patch is welcome.

Closes T15256

Test Plan

Browse a Diffusion file: should see a "Permalink" button.

Visit that button: now it's marked as selected.

Browse a Diffusion directory: it should have not that button.

Diff Detail

Repository
rP Phorge
Branch
diffusion-permalink-buttonzzzzzz
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/applications/diffusion/controller/DiffusionBrowseController.php:630XHP16TODO Comment
Unit
Tests Passed
Build Status
Buildable 570
Build 570: arc lint + arc unit

Event Timeline

I’m not sure about Permalink being a top-level button. Maybe under the View Options menu?

I’m not sure about Permalink being a top-level button. Maybe under the View Options menu?

I explored a bit. It seems View Options is boldly related to "changing a small portion of the boxed file View". Instead the top buttons are related to "interacting with the whole page".

I think this explains the Raw file button that is a top link instead.