Skip to content

feat(site): show previous agent scripts logs #12233

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

Merged
merged 12 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Display tabs for agent logs
  • Loading branch information
BrunoQuaresma committed Feb 20, 2024
commit 5436b15c97fa88d177712d7149fba698f887c1ff
2 changes: 2 additions & 0 deletions site/src/components/Tabs/Tabs.tsx
Copy link
Member

Choose a reason for hiding this comment

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

Big fan of the file changes – looks really clean now.
Once this PR is out, would you be okay with me adding some accessibility code? Mainly want to add some stuff from the APG example for tabs

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

100% I'm not attached to my code at all 😆

Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ const styles = {
fontSize: 14,
display: "block",
padding: `${TAB_PADDING_Y}px 16px`,
fontWeight: 500,
lineHeight: "1",

"&:hover": {
color: theme.palette.text.primary,
Expand Down
4 changes: 3 additions & 1 deletion site/src/modules/workspaces/WorkspaceBuildLogs/Logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { type FC, type ReactNode, useMemo } from "react";
import AnsiToHTML from "ansi-to-html";
import { MONOSPACE_FONT_FAMILY } from "theme/constants";

export const DEFAULT_LOG_LINE_SIDE_PADDING = 24;

const convert = new AnsiToHTML();

export interface Line {
Expand Down Expand Up @@ -127,7 +129,7 @@ const styles = {
height: "auto",
// Whitespace is significant in terminal output for alignment
whiteSpace: "pre",
padding: "0 32px",
padding: `0 ${DEFAULT_LOG_LINE_SIDE_PADDING}px`,

"&.error": {
backgroundColor: theme.roles.error.background,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import dayjs from "dayjs";
import { type FC, Fragment, type HTMLAttributes } from "react";
import type { ProvisionerJobLog } from "api/typesGenerated";
import { BODY_FONT_FAMILY, MONOSPACE_FONT_FAMILY } from "theme/constants";
import { Logs } from "./Logs";
import { DEFAULT_LOG_LINE_SIDE_PADDING, Logs } from "./Logs";
import { type Interpolation, type Theme, useTheme } from "@emotion/react";

const Language = {
Expand Down Expand Up @@ -99,7 +99,7 @@ const styles = {
header: (theme) => ({
fontSize: 13,
fontWeight: 600,
padding: "4px 24px",
padding: `4px ${DEFAULT_LOG_LINE_SIDE_PADDING}px`,
display: "flex",
alignItems: "center",
fontFamily: BODY_FONT_FAMILY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const WorkspaceBuildPageView: FC<WorkspaceBuildPageViewProps> = ({
value={a.id}
key={a.id}
>
{a.name}
coder_agent.{a.name}
</TabLink>
))}
</TabsList>
Expand Down