Too much redundant information displayed in links between versions on api.drupal.org

Created on 30 April 2019, about 6 years ago
Updated 5 July 2024, 11 months ago

When trying to switch between versions of a class or function, the pages repeats a lot of information that is identical between them, making it too difficult to scan for the information that is actually different, namely the version of core:

As you can see in the image above, even the current version being viewed is quite subtle.

I propose that this switcher between versions should be much more prominent, and clearly display the current version, with alternate versions displayed in a dropdown (or perhaps in a simplified details element, more clearly styled). For example:

โœจ Feature request
Status

Active

Version

2.0

Component

User interface

Created by

๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • ๐Ÿ‡ช๐Ÿ‡ธSpain fjgarlin

    I feel like after doing the branch clean up and also changing the styling of the element, this doesn't seem like a big issue:

  • ๐Ÿ‡ช๐Ÿ‡ธSpain fjgarlin

    Though I agree that maybe it's a lot of information not really needed, as it is same name and namespace already).
    Maybe something like this feels "cleaner"?

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    I would use a select form element like in the first screenshot on comment #5 and as the issue summary suggests. It should be clear it takes to the same page, but for a different Drupal version.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    Now that the fieldset has been changed to Same name in other branches, this is probably no longer needed.

    Same name in other branches means the namespace could be different, even if the class name is the same. For example, for the Block class, some of the classes given in that fieldset are the following.

    • core/modules/views/src/Plugin/views/display/Block.php \Drupal\views\Plugin\views\display\Block
    • core/modules/block/src/Entity/Block.php \Drupal\block\Entity\Block
    • core/lib/Drupal/Core/Block/Annotation/Block.php \Drupal\Core\Block\Annotation\Block

    The only repeated parts are core/ in the path and \Drupal\ in the namespace, which I would rather show in that list.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    It is still possible to show less redundant information if the information would be grouped by filename.

    • core/modules/views/src/Plugin/views/display/Block.php \Drupal\views\Plugin\views\display\Block
      • Link for Drupal 10
      • Link for Drupal 9
      • Link for Drupal 8
    • core/modules/block/src/Plugin/migrate/source/Block.php \Drupal\block\Plugin\migrate\source\Block
    • Link for Drupal 10
    • Link for Drupal 9
    • Link for Drupal 8

    As the link texts should be preferably different from Link for Drupal 10, some redundant information would still be shown. I am not sure it is worth changing how those links are rendered.

  • ๐Ÿ‡ช๐Ÿ‡ธSpain fjgarlin

    That grouping by namespace/filename looks good, but agree that there would still be some repetition.
    It's all controlled here: https://git.drupalcode.org/project/api/-/blob/2.x/src/Formatter.php?ref_...

    Maybe we can even put all links in 1 row?

    ie:

    • core/modules/views/src/Plugin/views/display/Block.php \Drupal\views\Plugin\views\display\Block
      • [Drupal 10] [Drupal 9] [Drupal 8]
    • core/modules/block/src/Plugin/migrate/source/Block.php \Drupal\block\Plugin\migrate\source\Block
      • [Drupal 10] [Drupal 9] [Drupal 8]

    Where [something] represents a link.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    Using Drupal X as link text, those links could be placed on a single line. Even if the text would be Drupal 9999, there should not be any problem. ๐Ÿ‘๐Ÿป

  • ๐Ÿ‡ญ๐Ÿ‡บHungary Gรกbor Hojtsy Hungary

    ๐Ÿ“Œ Add 'supported' flag to branches to use to direct users and bots Active that is already committed and will be deployed later this week help a lot with this IMHO, although not directly implementing this per say.

Production build 0.71.5 2024