@@ -23,7 +23,7 @@ import {
2323} from "@trigger.dev/core/v3" ;
2424import type { RuntimeEnvironmentType } from "@trigger.dev/database" ;
2525import { motion } from "framer-motion" ;
26- import { useCallback , useEffect , useMemo , useRef , useState } from "react" ;
26+ import { useCallback , useEffect , useRef , useState } from "react" ;
2727import { useHotkeys } from "react-hotkeys-hook" ;
2828import { redirect } from "remix-typedjson" ;
2929import { MoveToTopIcon } from "~/assets/icons/MoveToTopIcon" ;
@@ -320,7 +320,7 @@ export default function Page() {
320320 text : "Runs" ,
321321 } }
322322 title = { < >
323- < CopyableText value = { run . friendlyId } variant = "text-below" className = "font-mono" />
323+ < CopyableText value = { run . friendlyId } variant = "text-below" className = "font-mono px-0 py-0 pb-[2px] " />
324324 { tableState && ( < div className = "flex" >
325325 < PreviousRunButton to = { previousRunPath } />
326326 < NextRunButton to = { nextRunPath } />
@@ -1674,55 +1674,53 @@ function useAdjacentRunPaths({
16741674 run : { friendlyId : string } ;
16751675 runsList : RunsListNavigation | null ;
16761676} ) : [ string | null , string | null ] {
1677- return useMemo ( ( ) => {
1678- if ( ! runsList || runsList . runs . length === 0 ) {
1679- return [ null , null ] ;
1680- }
1677+ if ( ! runsList || runsList . runs . length === 0 ) {
1678+ return [ null , null ] ;
1679+ }
16811680
1682- const currentIndex = runsList . runs . findIndex ( ( r ) => r . friendlyId === run . friendlyId ) ;
1683-
1684- if ( currentIndex === - 1 ) {
1685- return [ null , null ] ;
1686- }
1681+ const currentIndex = runsList . runs . findIndex ( ( r ) => r . friendlyId === run . friendlyId ) ;
1682+
1683+ if ( currentIndex === - 1 ) {
1684+ return [ null , null ] ;
1685+ }
16871686
1688- // Determine previous run: use prevPageLastRun if at first position, otherwise use previous run in list
1689- let previousRun : { friendlyId : string } | null = null ;
1690- const previousRunTableState = new URLSearchParams ( tableState ) ;
1691- if ( currentIndex > 0 ) {
1692- previousRun = runsList . runs [ currentIndex - 1 ] ;
1693- } else if ( runsList . prevPageLastRun ) {
1694- previousRun = runsList . prevPageLastRun ;
1695- // Update tableState with the new cursor for the previous page
1696- previousRunTableState . set ( "cursor" , runsList . prevPageLastRun . cursor ) ;
1697- previousRunTableState . set ( "direction" , "backward" ) ;
1698- }
1687+ // Determine previous run: use prevPageLastRun if at first position, otherwise use previous run in list
1688+ let previousRun : { friendlyId : string } | null = null ;
1689+ const previousRunTableState = new URLSearchParams ( tableState ) ;
1690+ if ( currentIndex > 0 ) {
1691+ previousRun = runsList . runs [ currentIndex - 1 ] ;
1692+ } else if ( runsList . prevPageLastRun ) {
1693+ previousRun = runsList . prevPageLastRun ;
1694+ // Update tableState with the new cursor for the previous page
1695+ previousRunTableState . set ( "cursor" , runsList . prevPageLastRun . cursor ) ;
1696+ previousRunTableState . set ( "direction" , "backward" ) ;
1697+ }
16991698
1700- // Determine next run: use nextPageFirstRun if at last position, otherwise use next run in list
1701- let nextRun : { friendlyId : string } | null = null ;
1702- const nextRunTableState = new URLSearchParams ( tableState ) ;
1703- if ( currentIndex < runsList . runs . length - 1 ) {
1704- nextRun = runsList . runs [ currentIndex + 1 ] ;
1705- } else if ( runsList . nextPageFirstRun ) {
1706- nextRun = runsList . nextPageFirstRun ;
1707- // Update tableState with the new cursor for the next page
1708- nextRunTableState . set ( "cursor" , runsList . nextPageFirstRun . cursor ) ;
1709- nextRunTableState . set ( "direction" , "forward" ) ;
1710- }
1699+ // Determine next run: use nextPageFirstRun if at last position, otherwise use next run in list
1700+ let nextRun : { friendlyId : string } | null = null ;
1701+ const nextRunTableState = new URLSearchParams ( tableState ) ;
1702+ if ( currentIndex < runsList . runs . length - 1 ) {
1703+ nextRun = runsList . runs [ currentIndex + 1 ] ;
1704+ } else if ( runsList . nextPageFirstRun ) {
1705+ nextRun = runsList . nextPageFirstRun ;
1706+ // Update tableState with the new cursor for the next page
1707+ nextRunTableState . set ( "cursor" , runsList . nextPageFirstRun . cursor ) ;
1708+ nextRunTableState . set ( "direction" , "forward" ) ;
1709+ }
17111710
1712- const previousURLSearchParams = new URLSearchParams ( ) ;
1713- previousURLSearchParams . set ( "tableState" , previousRunTableState . toString ( ) ) ;
1714- const previousRunPath = previousRun
1715- ? v3RunPath ( organization , project , environment , previousRun , previousURLSearchParams )
1716- : null ;
1711+ const previousURLSearchParams = new URLSearchParams ( ) ;
1712+ previousURLSearchParams . set ( "tableState" , previousRunTableState . toString ( ) ) ;
1713+ const previousRunPath = previousRun
1714+ ? v3RunPath ( organization , project , environment , previousRun , previousURLSearchParams )
1715+ : null ;
17171716
1718- const nextURLSearchParams = new URLSearchParams ( ) ;
1719- nextURLSearchParams . set ( "tableState" , nextRunTableState . toString ( ) ) ;
1720- const nextRunPath = nextRun
1721- ? v3RunPath ( organization , project , environment , nextRun , nextURLSearchParams )
1722- : null ;
1717+ const nextURLSearchParams = new URLSearchParams ( ) ;
1718+ nextURLSearchParams . set ( "tableState" , nextRunTableState . toString ( ) ) ;
1719+ const nextRunPath = nextRun
1720+ ? v3RunPath ( organization , project , environment , nextRun , nextURLSearchParams )
1721+ : null ;
17231722
1724- return [ previousRunPath , nextRunPath ] ;
1725- } , [ organization , project , environment , tableState , run . friendlyId , runsList ] ) ;
1723+ return [ previousRunPath , nextRunPath ] ;
17261724}
17271725
17281726
0 commit comments