Page MenuHomePhorge

Add CSS class to object handle if user object is system agent
Needs ReviewPublic

Authored by aklapper on Fri, May 2, 23:53.

Details

Summary

Set the base for future customization to easier differentiate between human actors and machines.

Test Plan

Inspect the CSS of a bot account handle and a user account handle in a Maniphest task. See that <a> has an additional phui-system-agent class.

Diff Detail

Repository
rP Phorge
Branch
T16051 (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1923
Build 1923: arc lint + arc unit

Event Timeline

aklapper requested review of this revision.Fri, May 2, 23:53

Don't bool with the bool otherwise it bools

always set a bool so we have an explicit value and don't just fallback to "false"

Uhm... can we sleep with the very possible possibility of having "User Bot" possibly everywhere? 🌈

having "User Bot" possibly everywhere? 🌈

No. Because consistency.

Uhm. I don't know why but locally I cannot find the selector. Also this should help in getting the selector but without success, both from the home, or from a task created and assigned to a bot.

.phui-system-agent {
  background: red !important;
}

P.S., maybe useful for the test plan: to create a task from a bot, create a bot, with conduit token, then:

arc --conduit-uri http://phorge.localhost --conduit-token=api-asdasd todo ASD

Edited: maybe better phui-link-system-agent like the other one already present that has phui-link - sorry lol

Uhm. I don't know why but locally I cannot find the selector.

Huh?

Screenshot From 2025-05-06 18-25-44.png (362×897 px, 45 KB)

Screenshot From 2025-05-06 18-26-17.png (657×947 px, 107 KB)

Screenshot From 2025-05-06 18-26-37.png (889×1 px, 252 KB)

@matmarex: please look at the screenshots of Andre above: can I ask if such new selector would really simplify your downstream job? or, is there anything else missing / that we should do instead?

I ask this since the new selector will be very specific to the "user handle", but maybe you would love to easily catch the .phui-timeline-shell, with a .phui-timeline-shell-bot or similar, and not the handle.

Thanks for guiding us a bit here, so we better understand how deep we have to dig.

src/applications/phid/PhabricatorObjectHandle.php
380

Maybe a little comment that explains why currently we have no CSS rules and why it still makes sense

381

Maybe with -link prefix like the other selector in old line 368

Note that in the screenshots I used an extremely broad CSS selector as that broad one was specifically mentioned in the previous comment here.

Also, avivey does not like this approach so I'll likely decline this patch anyway.

Note that in the screenshots I used an extremely broad CSS selector as that broad one was specifically mentioned

I was drunk sorry. The phui-link-system-agent makes more sense.

Also, avivey does not like this approach so I'll likely decline this patch anyway.

I see. But aren't you curious about what @matmarex would like, to see where that would lead? I think the selector should be on the biggest container (e.g. phui-timeline-shell). Let's wait for feedback but, if yes, I think 90% of the patch is perfect as-is, and 10% could be moved to the thing who generates phui-timeline-shell (since it could now read PhabricatorObjectHandle#getSystemAgent() - so it's possible).

I mean, at least WMF Phabricator or other installs can pull this patch, if they want, and it would be probably exactly what they need to easily beautify 10 years of legacy data.

For my use case of styling Maniphest comments and other actions, it would be most convenient to have the extra class on phui-timeline-shell. But I'll be fine with maintaining my styles the way they currently are, if we drop this patch.