Skip to content

Add dynamic CSS "empty" disclaimer to all datagrids#2704

Merged
niklasmohrin merged 3 commits intoe-valuation:mainfrom
niklasmohrin:empty-table-css
May 4, 2026
Merged

Add dynamic CSS "empty" disclaimer to all datagrids#2704
niklasmohrin merged 3 commits intoe-valuation:mainfrom
niklasmohrin:empty-table-css

Conversation

@niklasmohrin
Copy link
Copy Markdown
Member

Closes #2662

I made two separate commits, the first has the meaningful changes and the second fixes the indentation.

Copy link
Copy Markdown
Member

@janno42 janno42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see the 🎆

Comment thread evap/staff/templates/staff_questionnaire_index.html Outdated
Comment thread evap/evaluation/templates/profile.html
@niklasmohrin
Copy link
Copy Markdown
Member Author

niklasmohrin commented Apr 20, 2026

Waiting for #2587 to spare them the rebase

@niklasmohrin
Copy link
Copy Markdown
Member Author

I think we are running into a firefox bug on the questionnaire index. The first time (per tab) that I filter for something, if it matches nothing (i.e. you have to enter something like adljaladljad right away without a table update from a prefix), the disclaimer does not show up. The disclaimer shows up if:

  1. this is not the first time that the table contents change
  2. the table is initially empty (for example reload page with something in search box)

It does work again if you remove the filter, switch to another questionnaire tab, and enter alkjhdf again. Very strange. In chromium everything works as expected

@niklasmohrin
Copy link
Copy Markdown
Member Author

niklasmohrin commented Apr 24, 2026

Oh, I can also get it to break in other places. Semester view, enter something that doesn't match anything (evaluation or course list, doesn't matter). Reload page. Empty table, no disclaimer. Funnily enough, this is exactly the opposite of when it breaks on the questionnaire page

@niklasmohrin
Copy link
Copy Markdown
Member Author

Probably firefox is tripping up with our table contents remove and append here

protected renderToDOM() {
[...this.container.children].map(element => element as HTMLElement).forEach(element => element.remove());
const elements = this.rows.filter(row => row.isDisplayed).map(row => row.element);
this.container.append(...elements);
this.saveStateToStorage();
}
and fails to apply CSS rules?

@fekoch
Copy link
Copy Markdown
Collaborator

fekoch commented Apr 27, 2026

Oh, I can also get it to break in other places. Semester view, enter something that doesn't match anything (evaluation or course list, doesn't matter). Reload page. Empty table, no disclaimer. Funnily enough, this is exactly the opposite of when it breaks on the questionnaire page

Interesting, I can reproduce it, but not consistently. When reloading multiple times, the notice sometimes shows and sometimes is missing.

Additionally, I can not reproduce it, if I have my devtools open 🙃 ...

@fekoch
Copy link
Copy Markdown
Collaborator

fekoch commented Apr 27, 2026

I opened a ticket at bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=2035307

@niklasmohrin
Copy link
Copy Markdown
Member Author

What do we do with this in the meantime? I guess the new disclaimer always shows up when the old one would have, that is, if there are no items to begin with. Do we still want to merge it then, or do we think with the FF bug it would be distracting? Personally I don't think that one would usually notice

@richardebeling
Copy link
Copy Markdown
Member

Yeah I think we can merge already and just get a better feature automagically when Firefox fixes their CSS logic

@niklasmohrin niklasmohrin requested a review from janno42 May 1, 2026 21:50
@niklasmohrin niklasmohrin merged commit 0a1c64b into e-valuation:main May 4, 2026
16 checks passed
@niklasmohrin niklasmohrin deleted the empty-table-css branch May 4, 2026 18:19
@niklasmohrin
Copy link
Copy Markdown
Member Author

(we talked in person)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Use CSS for "no matching entries" tables

4 participants