Home / Function/ TroubleshootingListControllerInternal() — supabase Function Reference

TroubleshootingListControllerInternal() — supabase Function Reference

Architecture documentation for the TroubleshootingListControllerInternal() function in Troubleshooting.ui.client.tsx from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  71ab7703_5840_6100_57f2_d212311b9522["TroubleshootingListControllerInternal()"]
  d6b58f41_efbc_4023_278f_9b90e8e39130["useTroubleshootingSearchState()"]
  71ab7703_5840_6100_57f2_d212311b9522 -->|calls| d6b58f41_efbc_4023_278f_9b90e8e39130
  50418d02_d583_5686_b750_bfbb4179ffa8["entryMatchesFilter()"]
  71ab7703_5840_6100_57f2_d212311b9522 -->|calls| 50418d02_d583_5686_b750_bfbb4179ffa8
  style 71ab7703_5840_6100_57f2_d212311b9522 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/features/docs/Troubleshooting.ui.client.tsx lines 358–400

function TroubleshootingListControllerInternal() {
  const allEntries = useRef<HTMLElement[]>([])

  const { selectedProducts, selectedErrorCodes, selectedTags, searchState } =
    useTroubleshootingSearchState()

  useEffect(() => {
    const container = document.getElementById(TROUBLESHOOTING_CONTAINER_ID)
    if (!container) return

    const entries = Array.from(
      container.querySelectorAll(
        `[${TROUBLESHOOTING_DATA_ATTRIBUTES.QUERY_ATTRIBUTE}="${TROUBLESHOOTING_DATA_ATTRIBUTES.QUERY_VALUE_ENTRY}"]`
      )
    ) as HTMLElement[]
    allEntries.current = entries
  }, [])

  useEffect(() => {
    if (
      !searchState &&
      selectedProducts.length === 0 &&
      selectedErrorCodes.length === 0 &&
      selectedTags.length === 0
    ) {
      allEntries.current.forEach((entry) => {
        entry.style.removeProperty('display')
      })
    } else {
      allEntries.current.forEach((entry) => {
        if (
          entryMatchesFilter(entry, selectedProducts, selectedErrorCodes, selectedTags, searchState)
        ) {
          entry.style.removeProperty('display')
        } else {
          entry.style.display = 'none'
        }
      })
    }
  }, [searchState, selectedProducts, selectedErrorCodes, selectedTags])

  return null
}

Subdomains

Frequently Asked Questions

What does TroubleshootingListControllerInternal() do?
TroubleshootingListControllerInternal() is a function in the supabase codebase.
What does TroubleshootingListControllerInternal() call?
TroubleshootingListControllerInternal() calls 2 function(s): entryMatchesFilter, useTroubleshootingSearchState.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free