Problem/Motivation

This particular issue came out from the design QA review process conducted by @jwitkowski79.

There seems to be a bug in the table header row when you start to scroll down

  • Text in the table header becomes larger
  • Text in table header row becomes center aligned
  • Can we keep the styles for the table header row consistent so the same styles that you see before you start scrolling apply to the fixed header? See attached screenshots

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

proeung created an issue. See original summary.

proeung’s picture

Issue summary: View changes
proeung’s picture

Version: 9.1.x-dev » 9.2.x-dev

Changing this design QA issue to be included in the 9.2.x-dev

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Harish1688’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new1.01 MB

mentioned requirements for table design are implemented in the version 9.4 to 10.1 attached a screenshot.
as per requirements looks good for RTBC.
3180282-design-issue.png

bnjmnm’s picture

Status: Reviewed & tested by the community » Needs work

#8 is incorrect. The issue reported is still happening. As stated in the issue summary, the problem occurs when enough items/scrollling is present for the header to be sticky. The screenshot is of a table that is not engaging a sticky header.

gauravvvv’s picture

StatusFileSize
new1.4 KB

This issue still exists in D10. I have attached a patch for same. Please review.

gauravvvv’s picture

Status: Needs work » Needs review
_utsavsharma’s picture

StatusFileSize
new496 bytes
new1.34 KB

Tried to fix CCF.
Please review.

Shubham Sharma 77’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new104.28 KB
new101.21 KB

Applied patch #12 applied successfully in drupal-10.1.x-dev. We can move this ticket to RTBC.
All the above-mentioned issues are fixed now.
For ref sharing screenshots...

bnjmnm’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/themes/olivero/css/components/table.css
@@ -101,6 +101,18 @@
+.sticky-header th {
+  margin-block: 0;
+  margin-inline-start: 0;
+  margin-inline-end: 0;
+  text-align: start;
+  letter-spacing: 0.02em;
+  color: var(--color-text-neutral-loud);
+  font-family: var(--font-sans);
+  font-size: 0.875rem;
+  line-height: var(--sp);
+}

Adding the .views-table class to the element with .sticky-header eliminates the need for all this additional CSS. Aside from being less to change, this has the added benefit of ensuring any change to the not-sticky header styles will automatically be applied to the sticky header as well. With this approach, theres a risk of changing th styles in one place and neglecting to make the corresponding change in the other.

gauravvvv’s picture

Status: Needs work » Needs review
StatusFileSize
new647 bytes
new1.98 KB

Addressed #14, Attached patch for same. Please review

_utsavsharma’s picture

StatusFileSize
new682 bytes
new670 bytes

Fixed CCF for #15.

nayana_mvr’s picture

StatusFileSize
new3.24 MB
new3.31 MB

Verified the patch #16 and tested it on Drupal version 10.1.x. The patch works fine and I have added the before and after screen recordings for reference.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs issue summary update, +Needs screenshots

This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

Can the issue summary be updated with the proposed solution. I see the points of the issue but what was decided to solve them?

Before/after screenshots of the issue would be useful as well.

bnjmnm’s picture

index 4c60e6d517..d939d8d2f9 100644
--- a/core/misc/tableheader.js

--- a/core/misc/tableheader.js
+++ b/core/misc/tableheader.js

+++ b/core/misc/tableheader.js
@@ -211,7 +211,9 @@

@@ -211,7 +211,9 @@
         // Clone the table header so it inherits original jQuery properties.
         const $stickyHeader = this.$originalHeader.clone(true);
         // Hide the table to avoid a flash of the header clone upon page load.
-        this.$stickyTable = $('<table class="sticky-header"></table>')
+        this.$stickyTable = $(
+          '<table class="sticky-header views-table"></table>',
+        )
           .css({
             visibility: 'hidden',
             position: 'fixed',

This is a change to core code, so it would impact all themes. There would need to be testing with all core themes to confirm this doesn't introduce problems.

Another option is to implement this in a manner specific to Olivero. One option is to override TableHeader.prototype.createSticky. The safest way is to probably invoke the original then add the class to this.$stickyTable. There are likely other options but that is one that comes to mind.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

quietone’s picture

Title: [Olivero Theme] [Design QA]: Tighten up the Tables » [Design QA]: Tighten up the Tables
Status: Needs work » Postponed

The Olivero theme was approved for removal in #3590816: [policy, no patch] Deprecate Olivero and move to contrib.

This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

The deprecation work is in #3595082: [meta] Tasks to deprecate the Olivero theme and the removal work in #3595085: [meta] Tasks to remove the Olivero theme.

quietone’s picture

Project: Drupal core » Olivero
Version: main » 2.0.0
Component: Olivero theme » Code
Status: Postponed » Needs work
quietone’s picture

Version: 2.0.0 » 2.x-dev