Problem/Motivation

In preparation of merging Gin as the default admin theme into core (see #3530852: [META] Admin theme modernisation), Gin needs to be prepared outside of code. This meta issue provides the overview of all related tasks that need to be completed.

Proposed solution

Gin 5.x branch is in active use with Drupal 11.2, and to avoid unintended updates to this WIP by composer, the preparation will take place in the new 6.x branch. The prioritized steps are:

  • Must-have / blocking
    • Remove dependency on Claro
      • This affects libraries, CSS files, templates, and PHP code
      • Include Claro base into Gin
    • Move contrib module integrations out of Gin, and file corresponding issues in the respective contrib projects
    • A lot of code (PHP, JS, and some CSS) deals with too many different contexts, all of which can be removed once Gin only supports the latest version of Drupal
    • Core merge regression tests

      Write regression tests to make sure we get the same result after cleaning up and merging Gin into core.
  • Should-have
    • Deduplicate Claro code
      • Gin inherits all of Claro, but also overrides a lot of it. This needs to be simplified.
  • Nice to have
    • Restructure CSS files into component-related files
    • Build the library structure accordingly
    • Clean-up Gin PHP
      • Optimize code
  • TBD
    • Add tests for PHP code (needs MVP defined)
      • Are there no tests at all for the PHP? Some? Discuss. The extent of current coverage will determine how much of this is "must-have" and how much is "should-have" or even "nice-to-have".
    • Clean-up Gin settings
      • Remove navigation types and toolbar
      • Remove sticky action buttons
    • Get regression tests green

Important notes for testing: Please turn off gin_toolbar in case you're using it. This is because it alters the libraries and adds some Claro related libraries, which is surprising that this even works, although Claro is not enabled.

Comments

pameeela created an issue. See original summary.

jurgenhaas’s picture

jurgenhaas credited catch.

jurgenhaas credited ckrina.

jurgenhaas credited xjm.

jurgenhaas’s picture

pameeela’s picture

Title: [META] Gin 6.x » [META] Gin 6.x: Preparation for merging into core
damienmckenna’s picture

For the test coverage, would it be better to just copy all of Claro's tests and tidy them up, or just recreate them as needed?

damienmckenna’s picture

I created a sub issue for the tests: #3533986: Recreate/copy Claro tests to Gin 6.x

jurgenhaas’s picture

kentr’s picture

Regarding tests, I suggest looking into calling the Nightwatch admin a11y tests with the --adminTheme option.

Based on the README, this might be the command:

yarn test:nightwatch --tag a11y:admin --adminTheme gin
jurgenhaas’s picture

Version: 5.0.x-dev » 6.x-dev
Component: Code » Documentation
Issue summary: View changes
Issue tags: +Gin merge into Core

I've broken the tasks down into child issues. All of them are against the 6.x branch, and they're tagged with Gin merge into Core.

mgifford’s picture

An important, outstanding issue with Gin is that accessibility issues have been raised and not addressed. Bringing Gin into Core will be a regression for accessibility, unless these issues are fixed. Many of the issues in https://www.drupal.org/project/gin/issues/3506302 were raised for Drupal CMS, where we were also attempting to meet WCAG requirements.

damienmckenna’s picture

@mgifford: That's amazing work, thanks to everyone involved!

Should we list all of the accessibility tasks under one priority category, or list them individually based upon their individual importance?

xmacinfo’s picture

The more I work with Single Directory Components (SDC), the more I’m convinced that SDC is mature and that is should be adopted in core themes.

For Gin 6.x, it could be an excellent opportunity to start shipping with a set of accessible, base-level SDC components. This would not only modernize Gin’s architecture but also provide reusable building blocks for consistency and future growth.

A first iteration could include foundational components such as:

  • gin-link
  • gin-input
  • gin-pagination
  • gin-radios
  • gin-select
  • gin-text
  • gin-textarea

This is just a starting sample. The list can easily expand to include other essentials like gin-breadcrumb, gin-button, and more as we refine the component library.

To support both development and adoption, we might consider how to best showcase and test these components:

  • Would a Stylebook-like repository (or Storybook integration) be valuable to document, preview, and track progress?
  • Or would the new components folder structure alone be sufficient for contributors at this stage?

Each SDC component should align with Gin’s project requirements, namely:

  • Accessibility-first implementation
  • Light and Dark color mode support
  • Consistent Gin styling and UX patterns

This leads to the key question:

> Is Gin 6.x the right branch to begin implementing SDC components in a systematic way?

damienmckenna’s picture

@xmacinfo: IMHO the first effort should be to make the necessary fixes to make it core-worthy, refactoring efforts should be held for later.

jurgenhaas’s picture

Issue summary: View changes

I've updated the IP with a not for testing. Also wanted to note that the first major step has been completed, the 6.x branch is now available and completely decoupled from Claro. It still renders the same result as before. Now it's time to go into details for cleaning up stuff.

Regarding #17, I do agree with #18 that the scope of merging Gin into core is to make the least possible structural changes, and get ready for improvements afterwards.

jurgenhaas’s picture

Next step has been completed: Code for 19 contrib projects has been removed from Gin 6.x and each of those project got an issue in their queue with a link to the MR to ask them to incorporate that code into their own projects. #3541800: Remove special treatment of contrib modules

jurgenhaas’s picture

And another significant milestone: The PHP code of Gin 6.x has been cleaned up such that there is no procedural code and no includes any longer. Thanks to @nicxvan and his work over at #3544715: Add oop support to hooks currently supported by themes to provide OO Hook support for themes. This is not yet merged into Drupal core 11.x, which is why Gin 6.x currently contains the current changes from that issue as a patch which should be applied to core before testing this.

lauriii’s picture

kentr’s picture

Is this issue still relevant?

pameeela’s picture

Status: Active » Fixed

I don't think so since the merge is done, will mark it fixed. There's plenty of follow up work to come but we don't need this one open anymore.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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