-
Notifications
You must be signed in to change notification settings - Fork 1
fix(OPENFRAM-001-2): CU-86akhf8u5 4 review findings across 2 files #392
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
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 |
|---|---|---|
|
|
@@ -79,7 +79,7 @@ function buildActions( | |
| onNewFolder: () => void, | ||
| emphasizeAddArticle = false, | ||
| ): PageActionButton[] { | ||
| const newArticleHref = parentId ? `/knowledge-base/new?folderId=${parentId}` : '/knowledge-base/new'; | ||
| const newArticleHref = parentId ? routes.knowledgeBase.new(parentId) : routes.knowledgeBase.new(); | ||
| const actions: PageActionButton[] = [ | ||
| { | ||
| label: 'New Folder', | ||
|
Comment on lines
79
to
85
Contributor
Author
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. 𦩠π΄ Relay connection IDs computed via ad-hoc local helper calls rather than a documented central key module No code change was made for this finding. The finding calls for a new shared normalization helper module for connection-id parameter construction across multiple files (this component plus archive/move modals not shown here). Introducing such a helper safely requires seeing all call sites ( π€ Prompt for AI agentsfix confidence: π΄ 15 low β review closely β react π/π to teach the reviewer |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -211,6 +211,33 @@ interface LogsTableContentProps { | |
| onMobileFilterClose: () => void; | ||
| } | ||
|
|
||
| /** | ||
| * Builds the internal `/log-details` navigation URL for a log row. | ||
| * | ||
| * NOTE: kept as a local, explicit query-string builder rather than routed | ||
| * through a centralized registry entry, because no `logs`/`logDetails` entry | ||
| * currently exists in the routes registry to reuse without inventing its | ||
| * shape. Centralizing this path-building here (a single named helper) at | ||
| * least removes the inline duplication risk at the call site; migrating to | ||
| * a shared `routes.ts` entry should be a follow-up once that entry exists. | ||
| */ | ||
| function buildLogDetailsPath(params: { | ||
| id: string; | ||
| ingestDay: string; | ||
| toolType: string; | ||
| eventType: string; | ||
| timestamp?: string | null; | ||
| }): string { | ||
| const searchParams = new URLSearchParams({ | ||
| id: params.id, | ||
| ingestDay: params.ingestDay, | ||
| toolType: params.toolType, | ||
| eventType: params.eventType, | ||
| timestamp: params.timestamp || '', | ||
| }); | ||
| return `/log-details?${searchParams.toString()}`; | ||
| } | ||
|
|
||
| // ---------------------------------------------------------------- | ||
| // Inner content β uses Relay hooks, must be inside Suspense | ||
| // ---------------------------------------------------------------- | ||
|
|
@@ -343,7 +370,7 @@ function LogsTableContent({ | |
| ? ('grey' as const) | ||
| : log.severity === 'CRITICAL' | ||
| ? ('critical' as const) | ||
| : ('success' as const), | ||
| : ('grey' as const), | ||
| }, | ||
| source: { | ||
| name: toToolLabel(log.toolType), | ||
|
Comment on lines
370
to
376
Contributor
Author
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. 𦩠π Log severity 'INFO' is mapped to grey Tag variant while 'error' status default falls through to success In π€ Prompt for AI agentsfix confidence: π’ 90 high β react π/π to teach the reviewer |
||
|
|
@@ -363,7 +390,13 @@ function LogsTableContent({ | |
| const getLogDetailsUrl = useCallback((log: UiLogEntry): string => { | ||
|
Contributor
Author
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. 𦩠π΄ Hard-coded route path built with string interpolation in getLogDetailsUrl In π€ Prompt for AI agentsfix confidence: π΄ 35 low β review closely β react π/π to teach the reviewer |
||
| const original = log.originalLogEntry; | ||
| const id = log.id || log.logId; | ||
| return `/log-details?id=${id}&ingestDay=${original.ingestDay}&toolType=${original.toolType}&eventType=${original.eventType}×tamp=${encodeURIComponent(original.timestamp || '')}`; | ||
| return buildLogDetailsPath({ | ||
| id, | ||
| ingestDay: original.ingestDay, | ||
| toolType: original.toolType, | ||
| eventType: original.eventType, | ||
| timestamp: original.timestamp, | ||
| }); | ||
| }, []); | ||
|
|
||
| const columns = useMemo<ColumnDef<UiLogEntry>[]>( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
𦩠π΄ Hardcoded href strings bypass the centralized routes registry
In
buildActions(knowledge-base-body.tsx), replaced the raw string concatenation`/knowledge-base/new?folderId=${parentId}`/'/knowledge-base/new'withroutes.knowledgeBase.new(parentId)/routes.knowledgeBase.new(), per the finding's suggested fix. This assumessrc/lib/routes.tsexports aknowledgeBase.new(folderId?: string)function; that file was not provided, so I could not verify the exact signature exists. Ifroutes.knowledgeBase.newdoes not exist or has a different signature, this will fail to compile β the reviewer must confirm/add that export insrc/lib/routes.ts.π€ Prompt for AI agents
fix confidence: π΄ 55 low β review closely β react π/π to teach the reviewer