• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / codegate-ui / 12873148879

20 Jan 2025 05:30PM UTC coverage: 68.482% (-0.06%) from 68.538%
12873148879

push

github

web-flow
refactor: some small refactors (#134)

* extract <Pages />

* refactor: fetch markdown source using react query

* refactor: remove unused file

258 of 459 branches covered (56.21%)

Branch coverage included in aggregate %.

4 of 14 new or added lines in 2 files covered. (28.57%)

509 of 661 relevant lines covered (77.0%)

58.15 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

17.65
/src/hooks/useHelpContent.ts
1
import { useQuery } from "@tanstack/react-query";
2
import Prism from "prismjs";
3

4
const fetchHelpContent = async (
2✔
5
  section: string | undefined,
6
): Promise<string> => {
NEW
7
  if (!section) {
×
NEW
8
    throw new Error("Section is required");
×
9
  }
10

NEW
11
  const response = await fetch(`/help/${section}.md`);
×
NEW
12
  if (!response.ok) {
×
NEW
13
    throw new Error("Failed to load content");
×
14
  }
15

NEW
16
  return response.text();
×
17
};
18

19
export const useHelpContent = (section: string | undefined) => {
2✔
20
  return useQuery({
1✔
21
    queryKey: ["helpContent", section],
NEW
22
    queryFn: () => fetchHelpContent(section),
×
23
    enabled: !!section,
24
    staleTime: 0,
25
    select: (data) => {
26
      // Allow content to render before highlighting
NEW
27
      setTimeout(() => {
×
NEW
28
        Prism.highlightAll();
×
29
      }, 0);
NEW
30
      return data;
×
31
    },
32
  });
33
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc