Problem/Motivation
The URL alias page (/admin/config/search/path) truncates the alias to 47 characters and three elipsis. This number is far too small and makes even a small site difficult to manage because all aliases in the row results look the same. When trying to manage long aliases and trying to resolve the dreaded '-0' pattern, no amount of truncation is helpful
Steps to reproduce
- Go to /admin/config/search/path
- filter for any subsection of your site that has decent length of aliases
- Notice that you can tell one page from the other because the truncation makes them look the same
- Get sad because this interface is not helpful at all.
Proposed resolution
(patch #23) First suggestion is to remove truncation altogether. There is not really a problem that the truncation solves.
Other options are to:
Truncate at the beginning rather than the end. - Still obscures data needed to fill purpose of the UI.
Keep the beginning and the end, but put elipses in the middle. - Still obscures data needed to fill purpose of the UI.
Remaining tasks
User interface changes
Before

After

API changes
None
Data model changes
None
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | long-alias.png | 71.9 KB | swirt |
| #24 | untruncated-narrow.png | 119.66 KB | swirt |
| #24 | untruncated.png | 163.76 KB | swirt |
| #23 | 3351638-23.patch | 4.89 KB | swirt |
| too-short-alias.png | 152.51 KB | swirt |
Issue fork drupal-3351638
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
swirtI posted a PR.
Comment #4
swirtUploaded a patch file in case anyone needs an immutable version.
Comment #6
swirtI am working on fixing the test failures.
I did some digging into the history and found that this truncation came from this issue https://www.drupal.org/project/drupal/issues/86461 which arbitrarily picked 50 characters for the truncation by the first person attempting to patch it.
There was no discussion as to how useless this would render the UI and no discussion of alternative like CSS to solve the problem instead of hiding the relevant data completely. The issue itself did suggest truncation OR wrapping but it was never discussed and truncation was the first patch that came in.
Comment #8
swirtThis patch adjusts the test to not look for truncation.
Comment #9
swirtComment #10
swirtComment #11
skyriter commentedI tested this, and it's working in my environment.
Comment #12
smustgrave commentedCan see the problem with not being able to see the URLs
I don't think it should be an issue to remove.
Updated IS with the solution that was chosen.
Comment #13
swirtThank you @skywriter and @smustgrave
Just to be sure that this patch does not make a breaking change, I created a 255 char long alias. It displays just fine in the list of aliases
Comment #14
larowlanSo with some git archaeology 🤠 I traced this back to #86461: Truncate long paths and path aliases on admin/build/path - yes a 5 digit NID from 11 years ago where we made this change intentionally.
So now we're directly reversing that.
The motivation given there was 'it looks bad and can break template layout'
I think we should put this to the usability team to decide if the decision we made 11 years ago was the wrong one or not.
Comment #15
larowlanCrediting myself as the git archaeology required going back to before we even had controllers.
Comment #16
swirtThanks @larowlan. Glad to see you came to the same archeological roots that I called out in comment #6.
That issue made a lot of reference to the method of truncation and what tests were needed, but little was done to address concerns like
@Dries saying
@David_Rothstein : saying
That went unanswered and the 50 count just came from the original patch in the thread.
Until @Poker_10 commented a decade later
The problem is, the purpose of the Alias UI is to help you manage aliases. By truncating them to any level, we get in the way that purpose. In its current state, managing the aliases is like a child's game of memory.
The way I read the thread of the original issue, the usability of the page was never considered, or at least not discussed. We took a usable interface and made it less useful but slightly more pretty.
I also think there are Accessibility concerns introduced in the original issue too because the link title was made the same as the next column (the system path). So anyone using screen readers is presented with not enough information (due to the truncation) and they also get to hear the system path read twice back to back.

Listen to it with a screen reader, it is annoying.
That is not to say that this issue does not need usability review. I agree that it does and by essentially rolling back #86461 we are undoing the usability review that was never done on that issue.
Comment #17
mgiffordInteresting to see that the original issue was started in 2006, before the iPhone was released. The goal at the time was "When working with small-width templates, the long paths can destroy the nice look/layout of the template." Thanks for doing the research on this @swirt & @larowlan.
This does look like an accessibility problem currently. I haven't looked at the source code of this in a long time, however taking away the truncation and providing the whole link should resolve the accessibility problems with these links.
Comment #18
mgiffordComment #19
mgiffordComment #20
swirtSample html without truncation
Comment #21
maggiewachs commented+1 for removing the title attribute that was added for the purpose of showing the full path. Titles are best suited for situations where link text isn't available. In this case, the full text should be linked, making the title attribute redundant (and possibly noisy for screen readers).
Comment #22
swirtBased on what maggiewachs has identified, it sounds like we should be doing this
This includes:
* Yes this system path should lead to the alias version via a rewrite but sometimes there are redirects that interfere so this allows testing that in the UI.
Comment #23
swirtHere is an immutable patch file from the PR.
Comment #24
swirtProof of life
Example of untruncated output.

And here is the same output on a much narrower screen
Comment #25
larowlanRemoving my credit because I missed the comment in #6
@swirt could you reformat your link using the
[#nid]format so it gets updated to emit the title?Sounds like we have broad buy in here, next step is to visit the #ux channel in Slack and put this in the bot generated agenda reminder so the kind folks there can look at it in their next meeting. Before doing so, making sure we have before and after shots in the issue summary
Moving to 10.1.x as we don't commit tasks to 9.5.x
If you could make the argument that this is a bug it would be eligible to backport
Comment #26
swirtComment #27
swirtThanks @larowlan.
Crediting @larawlan because he gave great guidance on how to move this along. ;)
Added before and after screen caps to original.
Posted in the #UX channel.
I would call it a "Bug" because the Alias UI is intended to make make it possible to manage aliases effectively, and when we can't see the alias variations in a meaningful way, it prevents me from doing what I need to do.
Comment #28
swirtComment #29
swirtComment #30
swirtComment #32
swirtThis was presented at the #3350284: Drupal Usability Meeting 2023-04-07
That issue will have a link to a recording of the meeting.
For the record, the attendees at today's usability meeting were @benjifisher, @mgifford, @rkoller, @simohell, and @swirt.
Comment #33
swirtComment #34
swirtDiscussion on the call touched on whether this was fixing a bug, or just an improvement.
There was agreement that it borders on these bug criteria
Comment #35
swirtComment #36
smustgrave commentedChanging to a bug per #34
Sounds like from the UX meeting there is nothing that needs to be fixed. Think this is good for committer review.
Comment #37
skyriter commentedI just tested the patch in our PR environment. The URLs are no longer truncated and are thus visually distinguishable from each other.
Comment #38
swirtThank you both for reviewing and testing.
Comment #39
larowlanWhy was this change needed?
Comment #40
swirtThere were two reasons for this.
1. Having two visually different links that were the same destination in adjacent columns was misleading especially to visually impaired users since the links sound like different urls due to the anchor text, but are in fact the same href destination. (An accessibility concern)
2. There are times when a system link does not end up resolving to it's alias due to a redirect or some other rewiring. This allows the ability to verify where the actual system link resolves
Comment #41
larowlanShould we move those changes to a different issue to have a separate discussion?
Comment #42
swirt@larowlan That aspect was discussed specifically on the Drupal Usability Meeting
It received positive review from all in attendance. I tried to reference the meeting transcript or the recording but they have not been added yet #3350284
My vote would be not to separate it out as then this UI will still have have a significant accessibility issue.
Comment #43
larowlanOk, I'll wait for the recording and watch that - thanks
Comment #44
larowlanComment #45
quietone commentedTrying for a better title.
Comment #46
poker10 commented@larowlan Seems like the Drupal Usability Meeting recording was published today.
Comment #47
bnjmnmDue to the scope expansion that @larowlan identified in #39, one of the following changes needs to happen for this to be committable:
And I hope this additional process isn't too annoying. The rationale for the additional changes is good ones and I'd like to see those changes. The benefits to containing the scope of an issue are less immediate, but become more apparent later. For example, if accessibility concerns are brought up and someone demands a revert (this happens enough that it's example-worthy), we wind up losing the no-truncation benefit due to concerns that are unrelated to it.
Comment #48
swirtSounds good. I created #3362007: Make system path column more accurate and will break up this patch into two patches.
Comment #49
swirtI updated the MR to remove the use of the actual system path. The system path is back the way it was, now only with the truncation removed.
Comment #51
bnjmnmThanks for the flexibility @swirt, this looks ready to me.
For additional assurance this is a good idea, I messed with this at different widths and when the viewport is narrow enough to cause unwanted vertical scrolling, the experience really isn't improved with the truncation. Perhaps slightly less horizontal scrolling is needed, but it is still needed. That's a larger problem to be addressed in #3068696: Tables overflow on mobile
Comment #54
lauriiiCommitted 9daaabe and pushed to 11.x. Thanks!
Leaving open for potential 10.1.x backport.
Comment #57
lauriiiDecided to backport to 10.1.x with a +1 from @longwave.