Skip to content

Feature/row highlight clean - #215

Open
Avatarsia wants to merge 6 commits into
OpenXE-org:masterfrom
Avatarsia:feature/row-highlight-clean
Open

Feature/row highlight clean#215
Avatarsia wants to merge 6 commits into
OpenXE-org:masterfrom
Avatarsia:feature/row-highlight-clean

Conversation

@Avatarsia

Copy link
Copy Markdown
Contributor
  • Ziel: Markierte Belege sofort erkennbar machen.
  • Umgesetzt: Markierte Angebote/Aufträge/Rechnungen werden beim Setzen der Checkbox mit einem Hintergrund hervorgehoben; auch nach DataTables-Init gesichert.
  • Erwartetes Verhalten: Selektierte Zeilen heben sich optisch ab, Selektionsstatus bleibt nach Tabellen-Reload bestehen.

@Avatarsia
Avatarsia force-pushed the feature/row-highlight-clean branch 2 times, most recently from 6e0d5e1 to 0c4c1fd Compare May 7, 2026 20:04
@Avatarsia

Copy link
Copy Markdown
Contributor Author

Force-Push-Hinweis: Branch wurde direkt auf upstream/master rebased, sodass der Diff jetzt nur noch den eigentlichen Fix zeigt — ohne die ~150 Fork-internen Commits, die vorher mitliefen. Code-Endstand byte-identisch, nur die Commit-SHAs sind neu.

Bestehende Inline-Kommentare auf alten SHAs erscheinen jetzt als „outdated" — gerne nochmal kommentieren auf den neuen Commits, falls noch was offen ist.

@Avatarsia
Avatarsia force-pushed the feature/row-highlight-clean branch from 6e49cb0 to 772dc2c Compare May 20, 2026 10:10
@Avatarsia
Avatarsia force-pushed the feature/row-highlight-clean branch from 772dc2c to c34b0ad Compare July 26, 2026 10:03
Avatarsia and others added 6 commits July 28, 2026 12:13
Two new rules at the end of datatables_custom.css:
  - tbody tr:nth-child(even)  -> #f7f9fb (very light blue tint)
  - tbody tr:nth-child(4n)    -> #eef3f8 (slightly deeper, since 4n is
                                 also even; later definition wins)

Improves readability on long DataTables-rendered lists. Marked rows
(.row-marked) keep priority via the existing !important rules above,
so the manual checkbox highlight stays visible regardless of stripe
position.
…not override

User reported the striping had no visible effect. Cause: the OpenXE
theme stylesheet (themes/new/css/styles.css) sets explicit white
backgrounds on table tr/td which beats the nth-child selectors
without !important. Added !important to both stripe rules and added
a third selector (.dataTables_wrapper tbody tr) to cover tables that
DataTables wraps but doesn't directly class as .dataTable.

.row-marked still wins because its selector specificity is higher,
and CSS rules at equal !important fall back to specificity.
…city

Earlier attempt used 'table.dataTable tbody tr:nth-child(even) td' which
loses the cascade against the OpenXE theme rule
'.dataTables_wrapper table.dataTable.display > tbody > tr > td' (more
classes + combinators). Even !important does not help because at equal
importance, specificity decides.

Verified directly against the live tree (Avatarsia 192.168.0.150) via
DOM/getComputedStyle: DataTables sets class='odd' / class='even' on
the data rows. Targeting tr.even with the same wrapper-prefix as the
theme rule wins specificity; the 4n stripe matches DOM 4n-positions
(.even rows at indexes 3, 7, 11, ... → effectively every 4th data row).
Bug-Reports vom User auf Avatarsia/192.168.0.150:
1. Markieren funktioniert auf "dunkleren" Zeilen (jede 4.) nicht.
2. Manche markierte Zeilen sehen aus wie "zwei Hintergruende".

Diagnose (verifiziert mit Codex):
- Spezifitaet table.dataTable tbody tr.row-marked td       = (0,2,4)
- Spezifitaet .dataTables_wrapper table.dataTable.display
    > tbody > tr.even > td                                 = (0,4,4)
- Spezifitaet .dataTables_wrapper ... > tr.even:nth-child(4n)
    > td                                                   = (0,5,4)
Bei gleichem !important entscheidet die Spezifitaet -> Stripe-Regeln
gewinnen ueber .row-marked. Der bisherige Code-Kommentar ("equal class
count + later defined") war falsch.

Zusaetzlich: DataTables setzt eigene td.sorting_1/_2/_3 Klassen auf der
sortierten Spalte mit Spezifitaet (0,4,4) und eigener Hintergrundfarbe,
wodurch die sortierte Zelle in markierten Zeilen aus der Reihe taenzt
("zwei Hintergruende"-Effekt).

Fix:
- Stripe-Regeln per :not(.row-marked) ausschliessen, sodass markierte
  Zeilen gar nicht erst gestriped werden. Damit muss .row-marked nicht
  mehr im Spezifitaets-Wettbewerb gewinnen.
- Override-Regel fuer td.sorting_1/_2/_3 in .row-marked Zeilen mit
  Wrapper-Pfad (Spezifitaet 0,5,4), damit die sortierte Spalte den
  einheitlichen Highlight bekommt.
@Avatarsia
Avatarsia force-pushed the feature/row-highlight-clean branch from c34b0ad to 7c50213 Compare July 28, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants