diff --git a/site/src/modules/resources/AgentLogs/AgentLogs.tsx b/site/src/modules/resources/AgentLogs/AgentLogs.tsx index 6370701843..ad087742f6 100644 --- a/site/src/modules/resources/AgentLogs/AgentLogs.tsx +++ b/site/src/modules/resources/AgentLogs/AgentLogs.tsx @@ -29,6 +29,7 @@ type AgentLogsProps = Omit< logs: readonly Line[]; sources: readonly WorkspaceAgentLogSource[]; overflowed: boolean; + showSourceIcons?: boolean; }; export const AgentLogs: React.FC = ({ @@ -36,6 +37,7 @@ export const AgentLogs: React.FC = ({ sources, overflowed, className, + showSourceIcons = true, ...listProps }) => { const logSourceById = Object.fromEntries(sources.map((s) => [s.id, s])); @@ -51,7 +53,7 @@ export const AgentLogs: React.FC = ({ // We need the div selector to be able to apply the padding // top from startupLogs className={cn( - "pt-4 [&>div]:relative bg-surface-secondary", + "py-4 [&>div]:relative bg-surface-secondary", // Add extra padding so that overflow indicator can't // fully cover up lines of text overflowed && "pb-10", @@ -126,18 +128,20 @@ export const AgentLogs: React.FC = ({ line={log} style={style} sourceIcon={ - - {icon} - - {logSource.display_name} - {assignedIcon && ( - -
- No icon specified! -
- )} -
-
+ showSourceIcons ? ( + + {icon} + + {logSource.display_name} + {assignedIcon && ( + +
+ No icon specified! +
+ )} +
+
+ ) : null } /> ); diff --git a/site/src/modules/resources/AgentRow.tsx b/site/src/modules/resources/AgentRow.tsx index 52ae1e1d04..dc7572980e 100644 --- a/site/src/modules/resources/AgentRow.tsx +++ b/site/src/modules/resources/AgentRow.tsx @@ -184,9 +184,11 @@ export const AgentRow: FC = ({ if (!parent) { return; } + // Use the parent's scrollHeight (not the inner div's) so that + // any padding on the scroll container is included in the + // calculation and doesn't inflate the "at bottom" zone. const distanceFromBottom = - logListDivRef.current.scrollHeight - - (props.scrollOffset + parent.clientHeight); + parent.scrollHeight - (props.scrollOffset + parent.clientHeight); setBottomOfLogs(distanceFromBottom < AGENT_LOG_LINE_HEIGHT); }; @@ -596,6 +598,7 @@ export const AgentRow: FC = ({ sources={agent.log_sources} overflowed={agent.logs_overflowed} className="bg-transparent" + showSourceIcons={selectedLogTab === "all"} /> )} diff --git a/site/src/modules/resources/DownloadSelectedAgentLogsButton.tsx b/site/src/modules/resources/DownloadSelectedAgentLogsButton.tsx index df75d9f091..fd2b9ecd07 100644 --- a/site/src/modules/resources/DownloadSelectedAgentLogsButton.tsx +++ b/site/src/modules/resources/DownloadSelectedAgentLogsButton.tsx @@ -61,7 +61,11 @@ export const DownloadSelectedAgentLogsButton: FC< - + {