Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/app/src/components/LogsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export function LogsView() {
className="text-xs px-3 py-1.5 border border-border bg-card text-txt cursor-pointer"
value={logLevelFilter}
onChange={handleLevelChange}
aria-label="Filter logs by level"
>
<option value="">All levels</option>
<option value="debug">Debug</option>
Expand All @@ -111,6 +112,7 @@ export function LogsView() {
className="text-xs px-3 py-1.5 border border-border bg-card text-txt cursor-pointer"
value={logSourceFilter}
onChange={handleSourceChange}
aria-label="Filter logs by source"
>
<option value="">All sources</option>
{logSources.map((s) => (
Comment on lines 112 to 118

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential runtime error if logSources is undefined or not an array

The dropdown options are generated by mapping over logSources. If logSources is undefined or not an array, this will cause a runtime error. To improve robustness, ensure logSources is always an array:

{(logSources ?? []).map((s) => (
  <option key={s} value={s}>{s}</option>
))}

Alternatively, validate logSources in the context provider.

Expand All @@ -125,6 +127,7 @@ export function LogsView() {
className="text-xs px-3 py-1.5 border border-border bg-card text-txt cursor-pointer"
value={logTagFilter}
onChange={handleTagChange}
aria-label="Filter logs by tag"
>
<option value="">All tags</option>
{logTags.map((tag) => (
Comment on lines 127 to 133

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential runtime error if logTags is undefined or not an array

Although the dropdown is conditionally rendered with logTags.length > 0, if logTags is undefined, this will cause a runtime error. To improve robustness, ensure logTags is always an array:

{(logTags ?? []).map((tag) => (
  <option key={tag} value={tag}>{tag}</option>
))}

Alternatively, validate logTags in the context provider.

Expand Down
Loading