With more Git controlled repos in a project or elements that may contain many items, like the ignored files, it might be preferred to have the most extensive last section of the report initially collapsed considering the generic purpose.

EDIT:
Now that we have the report on a dedicated page, we can pick this up to limit long lists with a "more" link that uncollapses the remaining items. We only show a certain amount up to a configurable threshold.

Comments

lolandese created an issue. See original summary.

lolandese’s picture

We tried this initially using Details | Details.php | Drupal 8.7.x | Drupal API.

Unfortunately, with #665790: Redesign the status report page the collapsing behavior was changed to only kick-in on small screens for all status report items. We should override this behavior for our Git section to get this feature back for all screen sizes.

lolandese’s picture

lolandese’s picture

A valid alternative could be to add an ellipsis ( ... ) with a read more link. That might be easier to implement.

Note that we already cut off the git status output after 600 characters using substr($statuscmd, 0, 600).

Some resources to explore further:

lolandese’s picture

Priority: Normal » Major
lolandese’s picture

Another alternative is to aggregate possibly long lists (changed and ignored files) and show only a count, once going over a threshold (preferably configurable).

lolandese’s picture

Alternatively, we could render the Git Info report on its own page. To explore how we could still have the warning/error detection system from Drupal core to apply also for this new route and suppress it on the Status report without hacking Drupal core.

Probably to adopt part of Drupal's API calls for this in our own code. To start by looking into:
function hook_requirements($phase) in core/lib/Drupal/Core/Extension/module.api.php.

Routing of the Status report is in /var/www/html/brown.localhost/web/core/modules/system/system.routing.yml and the route name is system.status. The menu link is in /var/www/html/brown.localhost/web/core/modules/system/system.links.menu.yml.

To see where the report output is tied to that route.

EDIT:
Ah.We thought of that before: #3087770: Move the GIT Info Report to its own page

lolandese’s picture

lolandese’s picture

Status: Active » Closed (won't fix)

Obsolete as #3087770: Move the GIT Info Report to its own page is a better way to go.

lolandese’s picture

Issue summary: View changes
Status: Closed (won't fix) » Active

Now that we have the report on a dedicated page, we can pick this up to limit long lists with a "more" link that uncollapses the remaining items. We only show a certain amount up to a configurable threshold.

See for probably the easiest implementation Painless Collapsible Divs In Drupal ⚡ | TimOnWeb. Adding a dependency on ctools to the module would be acceptable.

lolandese’s picture

Issue summary: View changes

Uuf! Seems that this was removed from D8 cTools and did not go into Drupal core either. Doing a search in contrib did not give usable options either. Seems that we should make a small helper module and replicate what was done in cTools. Obviously D8 theming has changed completely, although /sites/all/modules/contrib/ctools/js/collapsible-div.js seems to be for the most part reusable.

lolandese’s picture

lolandese’s picture

Status: Active » Needs review
StatusFileSize
new13 KB

Status: Needs review » Needs work

The last submitted patch, 13: gitinfo-collapsible_lists-3076640-13.patch, failed testing. View results

lolandese’s picture

Priority: Major » Normal

Besides fixing of the test we should also implement the non-limited (-1) option for number of last commits, where we remove the word "last" if all commits are shown.

lolandese’s picture

Status: Needs work » Needs review
StatusFileSize
new18.4 KB

  • lolandese committed 41c8e4e on 8.x-1.x
    Issue #3076640 by lolandese: Collapse part of the report
    
lolandese’s picture

Status: Needs review » Fixed

Happy this could be done with the drupal core function mentioned in #12. It is more likely the collapsible element created this way will render without issues on the common admin themes.

  • lolandese committed 41c8e4e on 8.x-1.x
    Issue #3076640 by lolandese: Collapse part of the report
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.