-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Multiple UI/UX fixes -feb #2997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
03dde20
82dec6d
f5f2ad3
820f4b8
22cca0e
e622d1b
e2b3719
7b26f8d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import { useFetcher } from "@remix-run/react"; | ||
| import { useEffect, useRef } from "react"; | ||
| import { useTypedLoaderData } from "remix-typedjson"; | ||
| import type { loader } from "~/root"; | ||
|
|
||
| export function TimezoneSetter() { | ||
| const { timezone: storedTimezone } = useTypedLoaderData<typeof loader>(); | ||
| const fetcher = useFetcher(); | ||
| const hasSetTimezone = useRef(false); | ||
|
|
||
| useEffect(() => { | ||
| if (hasSetTimezone.current) return; | ||
|
|
||
| const browserTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone; | ||
|
|
||
| if (browserTimezone && browserTimezone !== storedTimezone) { | ||
| hasSetTimezone.current = true; | ||
| fetcher.submit( | ||
| { timezone: browserTimezone }, | ||
| { | ||
| method: "POST", | ||
| action: "/resources/timezone", | ||
| encType: "application/json", | ||
| } | ||
| ); | ||
| } | ||
| }, [storedTimezone, fetcher]); | ||
|
|
||
| return null; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| import { ArrowPathIcon, ArrowTopRightOnSquareIcon } from "@heroicons/react/20/solid"; | ||
| import { Link } from "@remix-run/react"; | ||
| import { useEffect, useRef, useState } from "react"; | ||
| import { cn } from "~/utils/cn"; | ||
| import { Button } from "~/components/primitives/Buttons"; | ||
|
|
@@ -8,7 +9,7 @@ import { useProject } from "~/hooks/useProject"; | |
| import type { LogEntry } from "~/presenters/v3/LogsListPresenter.server"; | ||
| import { getLevelColor, highlightSearchText } from "~/utils/logUtils"; | ||
| import { v3RunSpanPath } from "~/utils/pathBuilder"; | ||
| import { DateTime } from "../primitives/DateTime"; | ||
| import { DateTimeAccurate } from "../primitives/DateTime"; | ||
| import { Paragraph } from "../primitives/Paragraph"; | ||
| import { Spinner } from "../primitives/Spinner"; | ||
| import { TruncatedCopyableValue } from "../primitives/TruncatedCopyableValue"; | ||
|
|
@@ -24,8 +25,6 @@ import { | |
| TableRow, | ||
| type TableVariant, | ||
| } from "../primitives/Table"; | ||
| import { PopoverMenuItem } from "~/components/primitives/Popover"; | ||
| import { Link } from "@remix-run/react"; | ||
|
|
||
| type LogsTableProps = { | ||
| logs: LogEntry[]; | ||
|
|
@@ -34,6 +33,7 @@ type LogsTableProps = { | |
| isLoadingMore?: boolean; | ||
| hasMore?: boolean; | ||
| onLoadMore?: () => void; | ||
| onCheckForMore?: () => void; | ||
| variant?: TableVariant; | ||
| selectedLogId?: string; | ||
| onLogSelect?: (logId: string) => void; | ||
|
|
@@ -63,6 +63,7 @@ export function LogsTable({ | |
| isLoadingMore = false, | ||
| hasMore = false, | ||
| onLoadMore, | ||
| onCheckForMore, | ||
| selectedLogId, | ||
| onLogSelect, | ||
| }: LogsTableProps) { | ||
|
|
@@ -161,7 +162,7 @@ export function LogsTable({ | |
| boxShadow: getLevelBoxShadow(log.level), | ||
| }} | ||
| > | ||
| <DateTime date={log.startTime} /> | ||
| <DateTimeAccurate date={log.startTime} /> | ||
| </TableCell> | ||
| <TableCell className="min-w-24"> | ||
| <TruncatedCopyableValue value={log.runId} /> | ||
|
|
@@ -203,20 +204,15 @@ export function LogsTable({ | |
| {/* Infinite scroll trigger */} | ||
| {hasMore && logs.length > 0 && ( | ||
| <div ref={loadMoreRef} className="flex items-center justify-center py-12"> | ||
| <div | ||
| className={cn( | ||
| "flex items-center gap-2", | ||
| !showLoadMoreSpinner && "invisible" | ||
| )} | ||
| > | ||
| <div className={cn("flex items-center gap-2", !showLoadMoreSpinner && "invisible")}> | ||
| <Spinner /> <span className="text-text-dimmed">Loading more…</span> | ||
| </div> | ||
| </div> | ||
| )} | ||
| {/* Show all logs message */} | ||
| {/* Show all logs message with check for more button */} | ||
| {!hasMore && logs.length > 0 && ( | ||
| <div className="flex items-center justify-center py-12"> | ||
| <div className="flex items-center gap-2"> | ||
| <div className="flex flex-col items-center gap-3"> | ||
| <span className="text-text-dimmed">Showing all {logs.length} logs</span> | ||
| </div> | ||
| </div> | ||
|
Comment on lines
213
to
218
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 The PR description states "Added a check for new logs button, previously once the user got to the end of the logs he could not check for newer logs." The route component creates Root Cause and ImpactThe entire "check for new logs" pipeline is wired up on the backend side: The "Show all logs" message area at Impact: Users who reach the end of their logs list have no way to check for newer logs without manually refreshing the page, which is exactly the problem this feature was supposed to fix. (Refers to lines 213-219) Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.