diff --git a/apps/tracer/package-lock.json b/apps/tracer/package-lock.json index 86ad991..67901b9 100644 --- a/apps/tracer/package-lock.json +++ b/apps/tracer/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.0", "dependencies": { "@blueprintjs/core": "^5.12.0", + "@curvenote/ansi-to-react": "^7.0.0", "@frida/react-use-r2": "^1.0.2", "@monaco-editor/react": "^4.6.0", "monaco-editor": "^0.51.0", @@ -393,6 +394,22 @@ } } }, + "node_modules/@curvenote/ansi-to-react": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@curvenote/ansi-to-react/-/ansi-to-react-7.0.0.tgz", + "integrity": "sha512-+m4V86QPmaZ7udMp7Yg81A31dLBGO8gglkPGWPzUJNxLCSyOrJ04pQmdZQelNBEA7MSGz8wf+6RHcuEaujdhHw==", + "dependencies": { + "anser": "^2.1.1", + "escape-carriage": "^1.3.1" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "react": "^16.3.2 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.3.2 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", @@ -1189,6 +1206,11 @@ "vite": "^4.2.0 || ^5.0.0" } }, + "node_modules/anser": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/anser/-/anser-2.3.0.tgz", + "integrity": "sha512-pGGR7Nq1K/i9KGs29PvHDXA8AsfZ3OiYRMDClT3FIC085Kbns9CJ7ogq9MEiGnrjd9THOGoh7B+kWzePHzZyJQ==" + }, "node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -1434,6 +1456,11 @@ "node": ">=6" } }, + "node_modules/escape-carriage": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/escape-carriage/-/escape-carriage-1.3.1.tgz", + "integrity": "sha512-GwBr6yViW3ttx1kb7/Oh+gKQ1/TrhYwxKqVmg5gS+BK+Qe2KrOa/Vh7w3HPBvgGf0LfcDGoY9I6NHKoA5Hozhw==" + }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", diff --git a/apps/tracer/package.json b/apps/tracer/package.json index e03f4ba..0e42de8 100644 --- a/apps/tracer/package.json +++ b/apps/tracer/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "@blueprintjs/core": "^5.12.0", + "@curvenote/ansi-to-react": "^7.0.0", "@frida/react-use-r2": "^1.0.2", "@monaco-editor/react": "^4.6.0", "monaco-editor": "^0.51.0", diff --git a/apps/tracer/src/EventView.css b/apps/tracer/src/EventView.css index 816e156..b18f935 100644 --- a/apps/tracer/src/EventView.css +++ b/apps/tracer/src/EventView.css @@ -12,27 +12,21 @@ margin-left: 104px; } -.event-item { - display: grid; - grid-template-columns: min-content; - white-space: nowrap; -} - -.event-summary { - grid-row: 1; - grid-column: 1; +.event-summary .bp5-button { + padding-top: 7px; + white-space: pre; } .event-details { - grid-row: 2; - grid-column: 1; - padding-right: 24px !important; + display: inline-block; + margin: 3px 0 0 86px; } .event-timestamp { - padding: 0 10px; + display: inline-block; + padding: 7px; color: #555; - vertical-align: middle; + vertical-align: top; text-align: right; } @@ -45,18 +39,6 @@ outline: 0; } -.event-selected .event-summary { - background-color: #ef6456; -} - -.event-selected .event-timestamp { - color: white !important; -} - -.event-selected .event-message { - color: white !important; -} - .event-item .bp5-card { color: #1e1e1e; } @@ -81,6 +63,16 @@ font-size: 10px; } +.event-selected { + background: linear-gradient(to right, #ef6456, #1e1e1e); + background-size: 90px; + background-repeat: no-repeat; +} + +.event-selected .event-timestamp { + color: white; +} + .event-dismiss { margin-top: 10px; } diff --git a/apps/tracer/src/EventView.tsx b/apps/tracer/src/EventView.tsx index c0fb157..a45f832 100644 --- a/apps/tracer/src/EventView.tsx +++ b/apps/tracer/src/EventView.tsx @@ -1,6 +1,7 @@ import "./EventView.css"; import { DisassemblyTarget, Event, HandlerId } from "./model.js"; import { Button, Card } from "@blueprintjs/core"; +import Ansi from "@curvenote/ansi-to-react"; import { ReactElement, useCallback, useEffect, useRef, useState } from "react"; import { useStayAtBottom } from "react-stay-at-bottom"; @@ -176,7 +177,7 @@ export default function EventView({ alignText="left" onClick={() => onActivate(targetId, i)} > - {message} + {message} {isSelected ? selectedEventDetails : null}