From 73c8a76fc775a24e451eb85896a2835bdd6532ee Mon Sep 17 00:00:00 2001
From: Maxime Jacquemin <maxime2.jacquemin@gmail.com>
Date: Fri, 25 Feb 2022 15:16:04 +0100
Subject: [PATCH] [ivette] Minor details

- Make a section disapear if it is empty.
- The filter button tooltip now displays the ratio of currently
  displayed functions over the toal number of functions
---
 ivette/src/dome/renderer/frame/sidebars.tsx | 2 +-
 ivette/src/frama-c/kernel/Globals.tsx       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ivette/src/dome/renderer/frame/sidebars.tsx b/ivette/src/dome/renderer/frame/sidebars.tsx
index 443f786a94e..f199904ad3f 100644
--- a/ivette/src/dome/renderer/frame/sidebars.tsx
+++ b/ivette/src/dome/renderer/frame/sidebars.tsx
@@ -134,7 +134,7 @@ export function Section(props: SectionProps): JSX.Element | null {
   const icon = state ? 'TRIANGLE.DOWN' : 'TRIANGLE.RIGHT';
 
   const { enabled = true, disabled = false, children } = props;
-  if (disabled || !enabled) return null;
+  if (disabled || !enabled || React.Children.count(children) === 0) return null;
 
   const visible = unfold ?? state;
   const maxHeight = visible ? 'max-content' : 0;
diff --git a/ivette/src/frama-c/kernel/Globals.tsx b/ivette/src/frama-c/kernel/Globals.tsx
index 679aa6a5935..48b87b105ab 100644
--- a/ivette/src/frama-c/kernel/Globals.tsx
+++ b/ivette/src/frama-c/kernel/Globals.tsx
@@ -184,7 +184,7 @@ export default function Globals(): JSX.Element {
 
   const filterButtonProps = {
     icon: 'TUNINGS',
-    title: 'Functions filtering options',
+    title: `Functions filtering options (${nFilter} / ${nTotal})`,
     onClick: onContextMenu,
     visible: !(onContextMenu === undefined),
     className: 'dome-xSideBarSection-filterButton'
-- 
GitLab