Problem/Motivation

Follow-up from #2784685: Streamline table header / row in GenericRevisionController

Header and row structure is still a bit complex and it's sometimes unclear what column is what.

Proposed resolution

To improve readability, we could use a col key in header and rows.
The keys are not used by the table element, but it still improves extensibiltiy and alterability as accessing cols is named.

Comments

miro_dietiker created an issue. See original summary.

miro_dietiker’s picture

IMHO this could still help with making the conditional columns more clear (in what is skipped, what is kept, in header VS content column consistency).

ginovski’s picture

Assigned: Unassigned » ginovski
Status: Active » Needs work
StatusFileSize
new4.44 KB

Initial patch for Unified fields layout.
1. Added keys to rows.
2. Removed row counter, since it is no longer needed.
3. Changed the if-condition array_slice with foreach unsetting the line-numbers at the end for the strip_tags filter.

@drobnjak will continue on this for Split fields layout.

johnchque’s picture

Status: Needs work » Needs review
johnchque’s picture

Status: Needs review » Needs work
+++ b/src/DiffLayoutManager.php
@@ -106,7 +106,7 @@ class DiffLayoutManager extends DefaultPluginManager {
-    if (!$has_htmlDiffAdvanced) {
+    if ($has_htmlDiffAdvanced) {

Unrelated change.

The last submitted patch, 3: introduce_header_row-2785857-3.patch, failed testing.

johnchque’s picture

Status: Needs work » Needs review
StatusFileSize
new3.94 KB

Just want to know if this breaks any test.

miro_dietiker’s picture

Status: Needs review » Needs work

Yeah, nice step.
Back to work to apply it to both plugins.

drobnjak’s picture

Assigned: ginovski » drobnjak
Status: Needs work » Needs review
StatusFileSize
new35.9 KB
new36.21 KB
new7.3 KB
new3.24 KB

Changes applied also to Split fields layout. Screenshots of both layouts provided.

johnchque’s picture

Status: Needs review » Needs work
  1. +++ b/src/Plugin/diff/Layout/SplitFieldsDiffLayout.php
    @@ -158,42 +158,32 @@ class SplitFieldsDiffLayout extends DiffLayoutBase {
    +          'left-row-body' =>[
    ...
    +          'right-row-body' =>[
    
    +++ b/src/Plugin/diff/Layout/UnifiedFieldsDiffLayout.php
    @@ -156,58 +155,48 @@ class UnifiedFieldsDiffLayout extends DiffLayoutBase {
    +            'row-body' => [
    ...
    +              'row-body' => [
    

    lets change body by data.

Besides looks really nice.

drobnjak’s picture

Status: Needs work » Needs review
StatusFileSize
new7.3 KB
new2.68 KB
johnchque’s picture

Status: Needs review » Reviewed & tested by the community

I like it really much.

miro_dietiker’s picture

Status: Reviewed & tested by the community » Fixed

Wonderful. Now even i can read it and follow the logic. ;-)

Status: Fixed » Closed (fixed)

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