@visns-studio/visns-components 5.11.3 → 5.11.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -183,6 +183,7 @@ function Navigation({
183
183
  setSystemAuth,
184
184
  themeType,
185
185
  userProfile,
186
+ debugIcons = false, // Add debug flag
186
187
  }) {
187
188
  const [search, setSearch] = useState('');
188
189
  const [searchResultShow, setSearchResultShow] = useState(false);
@@ -197,6 +198,7 @@ function Navigation({
197
198
  const [isScrolled, setIsScrolled] = useState(false);
198
199
  const [navData, setNavData] = useState(navConfig);
199
200
  const [showBusinessCardOcr, setShowBusinessCardOcr] = useState(false);
201
+ const actionItemsRef = useRef(null);
200
202
 
201
203
  const appNavClasses = styles['app-nav'];
202
204
 
@@ -294,7 +296,7 @@ function Navigation({
294
296
  to={n.url}
295
297
  data-tooltip-id="system-tooltip"
296
298
  data-tooltip-content={n.label}
297
- className={`tooltip ${activeClass}`}
299
+ className={`${activeClass}`}
298
300
  target={n.target ? n.target : '_self'}
299
301
  title={n.label}
300
302
  >
@@ -532,13 +534,65 @@ function Navigation({
532
534
  useEffect(() => {
533
535
  function handleScroll() {
534
536
  setIsScrolled(window.scrollY > 0);
537
+
538
+ // Debug logging for icon visibility
539
+ if (debugIcons && actionItemsRef.current) {
540
+ const anchors = actionItemsRef.current.querySelectorAll('a');
541
+ const buttons =
542
+ actionItemsRef.current.querySelectorAll('button');
543
+
544
+ console.log('=== SCROLL DEBUG ===');
545
+ console.log('Scroll Y:', window.scrollY);
546
+ console.log('Anchors found:', anchors.length);
547
+ console.log('Buttons found:', buttons.length);
548
+
549
+ anchors.forEach((anchor, index) => {
550
+ const rect = anchor.getBoundingClientRect();
551
+ const computedStyle = window.getComputedStyle(anchor);
552
+ console.log(`Anchor ${index}:`, {
553
+ visible: rect.width > 0 && rect.height > 0,
554
+ position: {
555
+ top: rect.top,
556
+ left: rect.left,
557
+ width: rect.width,
558
+ height: rect.height,
559
+ },
560
+ zIndex: computedStyle.zIndex,
561
+ display: computedStyle.display,
562
+ visibility: computedStyle.visibility,
563
+ opacity: computedStyle.opacity,
564
+ transform: computedStyle.transform,
565
+ contain: computedStyle.contain,
566
+ });
567
+ });
568
+
569
+ buttons.forEach((button, index) => {
570
+ const rect = button.getBoundingClientRect();
571
+ const computedStyle = window.getComputedStyle(button);
572
+ console.log(`Button ${index}:`, {
573
+ visible: rect.width > 0 && rect.height > 0,
574
+ position: {
575
+ top: rect.top,
576
+ left: rect.left,
577
+ width: rect.width,
578
+ height: rect.height,
579
+ },
580
+ zIndex: computedStyle.zIndex,
581
+ display: computedStyle.display,
582
+ visibility: computedStyle.visibility,
583
+ opacity: computedStyle.opacity,
584
+ transform: computedStyle.transform,
585
+ contain: computedStyle.contain,
586
+ });
587
+ });
588
+ }
535
589
  }
536
590
 
537
591
  window.addEventListener('scroll', handleScroll);
538
592
  return () => {
539
593
  window.removeEventListener('scroll', handleScroll);
540
594
  };
541
- }, []);
595
+ }, [debugIcons]);
542
596
 
543
597
  return layout === 'simple' || layout === 'cms' ? (
544
598
  <div className={styles.cwrap}>
@@ -601,7 +655,12 @@ function Navigation({
601
655
  <span></span>
602
656
  </button>
603
657
  </div>
604
- <div className={styles['hactions-alternate']}>
658
+ <div
659
+ className={`${styles['hactions-alternate']} ${
660
+ debugIcons ? styles['debug-icons'] : ''
661
+ }`}
662
+ ref={actionItemsRef}
663
+ >
605
664
  <ul>
606
665
  {navData.settings.map((setting, settingKey) =>
607
666
  setting.permission === true ? (
@@ -653,11 +712,12 @@ function Navigation({
653
712
  </ul>
654
713
  </div>
655
714
  <div
656
- className={
715
+ className={`${
657
716
  themeType === 'alternate'
658
717
  ? styles['hactions-alternate']
659
718
  : styles.hactions
660
- }
719
+ } ${debugIcons ? styles['debug-icons'] : ''}`}
720
+ ref={actionItemsRef}
661
721
  >
662
722
  <ul>
663
723
  {navData.settings.map((setting, settingKey) =>