blob: a8f35d42111dbeb970b42a3b5d714a0684a0369f [file] [log] [blame]
Sean McCullough86b56862025-04-18 13:04:03 -07001<html>
2 <head>
3 <title>sketch-timeline-message demo</title>
4 <link rel="stylesheet" href="demo.css" />
Philip Zeyliger72682df2025-04-23 13:09:46 -07005 <script type="module" src="../sketch-timeline-message.ts"></script>
Sean McCullough86b56862025-04-18 13:04:03 -07006
7 <script>
8 const messages = [
9 {
10 type: "agent",
11 content: "an agent message",
12 },
13 {
14 type: "user",
15 content: "a user message",
16 },
17 {
18 type: "tool",
19 content: "a tool use message",
20 },
21 {
22 type: "commit",
23 end_of_turn: false,
24 content: "",
25 commits: [
26 {
27 hash: "ece101c103ec231da87f4df05c1b5e6a24e13add",
28 subject: "Add README.md for web components directory",
29 body: "This adds documentation for the web components used in the Loop UI,\nincluding a description of each component, usage examples, and\ndevelopment guidelines.\n\nCo-Authored-By: sketch\nadd README.md for loop/webui/src/web-components",
30 pushed_branch:
31 "sketch/create-readmemd-for-web-components-directory",
32 },
33 ],
34 timestamp: "2025-04-14T16:39:33.639533919Z",
35 conversation_id: "",
36 idx: 17,
37 },
38 {
39 type: "agent",
40 content: "an end-of-turn agent message",
41 end_of_turn: true,
42 },
43 ];
44 document.addEventListener("DOMContentLoaded", () => {
45 messages.forEach((msg, idx) => {
46 const jsonEl = document.createElement("pre");
47 jsonEl.innerText = `.message property: ${JSON.stringify(msg)}`;
48 document.body.append(jsonEl);
49 const messageEl = document.createElement("sketch-timeline-message");
50 messageEl.message = msg;
51 document.body.appendChild(messageEl);
52 });
Sean McCullough71941bd2025-04-18 13:31:48 -070053 window.addEventListener("show-commit-diff", (evt) => {
54 console.log("show-commit-diff", evt);
55 });
Sean McCullough86b56862025-04-18 13:04:03 -070056 });
57 </script>
58 </head>
59 <body>
60 <h1>sketch-timeline-message demo</h1>
61 </body>
62</html>