@@ -4,9 +4,16 @@ import {
44 Box ,
55 Button ,
66 Center ,
7+ Divider ,
78 Flex ,
89 HStack ,
910 Heading ,
11+ Popover ,
12+ PopoverArrow ,
13+ PopoverBody ,
14+ PopoverCloseButton ,
15+ PopoverContent ,
16+ PopoverTrigger ,
1017 Skeleton ,
1118 Spinner ,
1219 Stack ,
@@ -17,7 +24,6 @@ import {
1724 Text ,
1825 Th ,
1926 Thead ,
20- Tooltip ,
2127 Tr ,
2228} from "@chakra-ui/react" ;
2329import { useTranslation } from "react-i18next" ;
@@ -88,10 +94,20 @@ export const RequestHistory = () => {
8894 const hasNoData = data ?. result . requests . length === 0 && skip === 0 ;
8995
9096 return (
91- < Stack spacing = { 4 } mb = { 8 } >
92- < Heading size = "md" > { t ( "features.userFeeds.components.requestsTable.title" ) } </ Heading >
97+ < Stack spacing = { 4 } mb = { 8 } border = "solid 1px" borderColor = "gray.700" borderRadius = "md" >
98+ < Box >
99+ < Stack px = { 4 } py = { 4 } >
100+ < Heading size = "sm" as = "h3" m = { 0 } id = "request-history-table-title" >
101+ { t ( "features.userFeeds.components.requestsTable.title" ) }
102+ </ Heading >
103+ < Text > Outgoing HTTP requests to the feed URL along with their response details.</ Text >
104+ </ Stack >
105+ < Box px = { 4 } >
106+ < Divider />
107+ </ Box >
108+ </ Box >
93109 { status === "loading" && (
94- < Center >
110+ < Center pb = { 8 } >
95111 < Spinner />
96112 </ Center >
97113 ) }
@@ -117,18 +133,42 @@ export const RequestHistory = () => {
117133 ) }
118134 { data && ! hasNoData && (
119135 < Stack >
120- < Box border = "solid 1px" borderColor = "gray.600" borderRadius = "md" >
121- < TableContainer >
122- < Table size = "sm" >
136+ < Box >
137+ < TableContainer px = { 4 } >
138+ < Table size = "sm" variant = "simple" aria-labelledby = "request-history-table-title" >
123139 < Thead >
124140 < Tr >
125141 < Th > { t ( "features.userFeeds.components.requestsTable.tableHeaderDate" ) } </ Th >
126142 < Th > { t ( "features.userFeeds.components.requestsTable.tableHeaderStatus" ) } </ Th >
127143 < Th >
128144 Cache Duration{ " " }
129- < Tooltip label = "The duration, determined by the feed host, for which the contents of a particular request will be re-used before a new request is made. This is necessary to comply with polling requirements, and so it overrides this feed's refresh rate." >
130- < QuestionOutlineComponent aria-label = "Cache Duration" />
131- </ Tooltip >
145+ < Popover >
146+ < PopoverTrigger >
147+ < Button variant = "ghost" size = "xs" aria-label = "What is cache duration?" >
148+ < QuestionOutlineComponent />
149+ </ Button >
150+ </ PopoverTrigger >
151+ < PopoverContent >
152+ < PopoverArrow />
153+ < PopoverCloseButton />
154+ < PopoverBody >
155+ < Text
156+ fontFamily = "var(--chakra-fonts-body)"
157+ whiteSpace = "initial"
158+ textTransform = "none"
159+ fontWeight = "normal"
160+ color = "var(--chakra-colors-chakra-body-text)"
161+ fontSize = { 14 }
162+ lineHeight = "var(--chakra-lineHeights-base)"
163+ >
164+ The duration, determined by the feed host, for which the contents of a
165+ particular request will be re-used before a new request is made. This
166+ is necessary to comply with polling requirements, and so it overrides
167+ this feed's refresh rate.
168+ </ Text >
169+ </ PopoverBody >
170+ </ PopoverContent >
171+ </ Popover >
132172 </ Th >
133173 </ Tr >
134174 </ Thead >
@@ -160,23 +200,35 @@ export const RequestHistory = () => {
160200 </ Table >
161201 </ TableContainer >
162202 </ Box >
163- < Flex justifyContent = "flex-end" >
203+ < Flex p = { 4 } >
164204 < HStack >
165205 < Button
166206 width = "min-content"
167207 size = "sm"
168- onClick = { prevPage }
169- isDisabled = { onFirstPage || fetchStatus === "fetching" }
208+ onClick = { ( ) => {
209+ if ( onFirstPage || fetchStatus === "fetching" ) {
210+ return ;
211+ }
212+
213+ prevPage ( ) ;
214+ } }
215+ aria-disabled = { onFirstPage || fetchStatus === "fetching" }
170216 >
171- { t ( "features.feedConnections.components.filtersTabSection.prevPage" ) }
217+ Previous Page
172218 </ Button >
173219 < Button
174220 width = "min-content"
175221 size = "sm"
176- onClick = { nextPage }
177- isDisabled = { fetchStatus === "fetching" || data ?. result . requests . length === 0 }
222+ onClick = { ( ) => {
223+ if ( fetchStatus === "fetching" || data ?. result . requests . length === 0 ) {
224+ return ;
225+ }
226+
227+ nextPage ( ) ;
228+ } }
229+ aria-disabled = { fetchStatus === "fetching" || data ?. result . requests . length === 0 }
178230 >
179- { t ( "features.feedConnections.components.filtersTabSection.nextPage" ) }
231+ Next Page
180232 </ Button >
181233 </ HStack >
182234 </ Flex >
0 commit comments