Show zero counts in embedded views
What does this MR do and why?
Adds the ability for embedded views (GLQL tables) to display "0" in their collapsed title, making it easy to scan multiple tables and quickly identify which ones have no results without expanding them.
Technical Investigation
During investigation with #575103 (comment 2829392633) we discovered that crud_component's zero display logic was tied to having an icon prop: this.icon && !this.count ? '0' : this.count
We searched the codebase and found:
- 55+ components use crud_component
- Only 3-4 components actually pass an icon prop (child items, linked items, list_selector)
- This meant most components couldn't display zero counts
Solution
Added an explicit showZeroCount prop to crud_component that:
- Provides a semantic way to control zero count display
- Maintains backward compatibility with existing icon-based logic
- Allows embedded views to show "0" for empty results when collapsed
Known Consideration
There's a potential brief flicker during initial page load if loading state isn't properly initialized in parent components.
Discussing optimal pattern with reviewer.
Screenshots
| Before | After |
|---|---|
| No count shown for empty results | Shows "0" for empty results |
![]() |
![]() |
MR checklist
-
Added showZeroCountprop to crud_component -
Updated GLQL facade to use the new prop -
Tested with both zero and non-zero results -
Added comprehensive unit tests for both components -
Verified backward compatibility with existing components -
Added screenshots
@himkp @mmacfarlane FYI
Edited by Alex Fracazo

