Page MenuHomePhorge

Workboard: improve the Create Task link to mention the Project slug
ClosedPublic

Authored by Dylsss on Feb 21 2023, 03:06.

Details

Summary

This expands a specific link in a specific menu of Workboard Columns.

You may never notice this difference unless you like to open links in another tab.

If you go to a Workboard, and you open its context menu, and you hover your mouse on the
Create Task action, you see this URL or a similar one:

http://example.com/maniphest/task/edit/form/default/

After this change, you see this URL or a similar one:

http://example.com/maniphest/task/edit/form/default/?tags=test

You see that the PhutilURI class was used to add the Project slug to the 'tags' query param so
that users can still open the URL in a new tab and have the form prefilled with the Project Tag.

Closes T15147

Test Plan
  • visit a Workboard
  • open the context menu of a Column (the pencil icon)
  • see that the Create Task link has the Project slug is in the URL of its prefilled form

Diff Detail

Repository
rP Phorge
Branch
arcpatch-D25068
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 152
Build 152: arc lint + arc unit

Event Timeline

Dylsss requested review of this revision.Feb 21 2023, 03:06

I tested locally following the test plan and I've found this edit very useful.

NOTE: For testers: the current link it's a bit tricky and you cannot just CTRL+click to open it in another tab. You have to manually copy the destination (right-click, copy link) and then open it in a new tab, manually. Maybe because of some JavaScript popup-related that is listening to the onclick event and is maybe firing an event.preventDefault() too aggressively. I will open a separate Task for this problem, since this problem is not caused by this change.

Nice. Hint: the next step could be, preserving the column PHID as well.

I discovered that the ?tags= parameter both supports a PHID but... also any "Additional Hashtags". So for instance if we have a Project named "Test" we can then identify it as "?tags=test" instead of "tags=PHID-PROJ-sw7q6bislsityhc7isgp".

In short, I suggest to replace $project->getPHID() with $project->getPrimarySlug(), since the primary slug is the main component designed to be exposed to end-users, while I think the PHID is instead more designed for internal identification and can, among other things, create some confusion. Some people can then say that the PHID gives more possibilities of uniqueness than slug, but here we are building a URL useful to end users, not making an internal database relationship, so I think that the slug may fit better this job.

What do you think about?

src/applications/project/controller/PhabricatorProjectBoardViewController.php
700

Thank you again. I just suggest this change so to have better URLs and for the reasons expressed in the comment.

@Dylsss thanks - can I ask if you agree with the edit suggestion?

If yes, I can help you in amending that specific change, if necessary to save your time. Thank you so much. I like this Diff.

@Dylsss Are you OK with the small proposed change?

No problem if you need more help.

Let me know if you hate the proposed change or you like it.

I am very happy honestly that we can expose the friendly slug here instead of the PHID, right now, without any other change.

This revision now requires changes to proceed.Mar 13 2023, 07:38

I'm very interested in this improvement.

@Dylsss Can I help in updating this Diff to adopt $project->getPrimarySlug()? In 3 days I will assume a "Yep bro no problem"

Dylsss marked an inline comment as done.Mar 23 2023, 04:05
Dylsss retitled this revision from Add project PHID to tags query param in create action URLs on workboard column menus to Add project slug to tags query param in create action URLs on workboard column menus.
Dylsss edited the summary of this revision. (Show Details)
Dylsss edited the test plan for this revision. (Show Details)

I have tested this locally, it works, it has sense, I also trust Dylsss, so, in good faith I accept as O1 (note: this is my very first time I approve something with such level)

This revision is now accepted and ready to land.Mar 23 2023, 21:37

Do you want an hand to land this nice feature?

(I will assume "yeah my friend" in 3 days)

Do you want an hand to land this nice feature?

(I will assume "yeah my friend" in 3 days)

As promised, I will land this for you. No problem.

valerio.bozzolan retitled this revision from Add project slug to tags query param in create action URLs on workboard column menus to Workboard: add Project slug to query param in Create Task action of column menu.Mar 27 2023, 06:15
valerio.bozzolan edited the summary of this revision. (Show Details)
valerio.bozzolan edited the test plan for this revision. (Show Details)
valerio.bozzolan retitled this revision from Workboard: add Project slug to query param in Create Task action of column menu to Workboard: improve the Create Task link to mention the Project slug.Mar 27 2023, 06:17
valerio.bozzolan edited the summary of this revision. (Show Details)

Thank you @Dylsss this is awesome for me

If you want to test this online, feel free to visit this:

https://gitpull.it/project/board/2/

And click on the Edit Pencil icon of a column and see the destination of Create Task - that now is not anymore in this way:

https://gitpull.it/maniphest/task/edit/form/4/

But it's in this way as expected:

https://gitpull.it/maniphest/task/edit/form/4/?tags=libre_busto

Very nice!