| Philip Zeyliger | 272a90e | 2025-05-16 14:49:51 -0700 | [diff] [blame] | 1 | import { css, html, LitElement } from "lit"; |
| 2 | import { customElement } from "lit/decorators.js"; |
| 3 | |
| 4 | /** |
| 5 | * A component that displays helpful information when the diff view is empty |
| 6 | */ |
| 7 | @customElement("sketch-diff-empty-view") |
| 8 | export class SketchDiffEmptyView extends LitElement { |
| 9 | static styles = css` |
| 10 | :host { |
| 11 | display: flex; |
| 12 | flex-direction: column; |
| 13 | align-items: center; |
| 14 | justify-content: center; |
| 15 | height: 100%; |
| 16 | width: 100%; |
| 17 | box-sizing: border-box; |
| 18 | } |
| 19 | |
| 20 | .empty-diff-box { |
| 21 | margin: 2rem auto; |
| 22 | max-width: 1200px; |
| 23 | width: 90%; |
| 24 | padding: 2rem; |
| 25 | border: 2px solid #e0e0e0; |
| 26 | border-radius: 8px; |
| 27 | box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); |
| 28 | background-color: #ffffff; |
| 29 | text-align: center; |
| 30 | } |
| 31 | |
| 32 | .empty-diff-title { |
| 33 | font-size: 1.5rem; |
| 34 | font-weight: 600; |
| 35 | margin-bottom: 1.5rem; |
| 36 | text-align: center; |
| 37 | color: #333; |
| 38 | } |
| 39 | |
| 40 | .empty-diff-content { |
| 41 | color: #666; |
| 42 | line-height: 1.6; |
| 43 | font-size: 1rem; |
| 44 | text-align: left; |
| 45 | margin-bottom: 1rem; |
| 46 | } |
| 47 | |
| 48 | strong { |
| 49 | font-weight: 600; |
| 50 | color: #333; |
| 51 | } |
| 52 | `; |
| 53 | |
| 54 | render() { |
| 55 | return html` |
| 56 | <div class="empty-diff-box"> |
| 57 | <h2 class="empty-diff-title">How to use the Diff View</h2> |
| Autoformatter | 8c46362 | 2025-05-16 21:54:17 +0000 | [diff] [blame] | 58 | |
| Philip Zeyliger | 272a90e | 2025-05-16 14:49:51 -0700 | [diff] [blame] | 59 | <p class="empty-diff-content"> |
| Autoformatter | 8c46362 | 2025-05-16 21:54:17 +0000 | [diff] [blame] | 60 | By default, the diff view shows differences between when you started |
| 61 | Sketch (the "sketch-base" tag) and the current state. Choose a commit |
| 62 | to look at, or, a range of commits, and navigate across files. |
| Philip Zeyliger | 272a90e | 2025-05-16 14:49:51 -0700 | [diff] [blame] | 63 | </p> |
| 64 | |
| 65 | <p class="empty-diff-content"> |
| Autoformatter | 8c46362 | 2025-05-16 21:54:17 +0000 | [diff] [blame] | 66 | You can select text to leave comments on the code. These will be added |
| 67 | to your chat window, and you can click Send to send them along to the |
| 68 | agent, which will respond in the chat window. |
| Philip Zeyliger | 272a90e | 2025-05-16 14:49:51 -0700 | [diff] [blame] | 69 | </p> |
| 70 | |
| 71 | <p class="empty-diff-content"> |
| Autoformatter | 8c46362 | 2025-05-16 21:54:17 +0000 | [diff] [blame] | 72 | If the range includes <strong>Uncommitted Changes</strong>, you can |
| 73 | <strong>edit</strong> the text as well, and it auto-saves. If you want |
| 74 | to clear up a comment or write your own text, just go ahead and do it! |
| 75 | Once you're done, though, be sure to commit your changes, either by |
| 76 | asking the agent to do so or in the Terminal view. |
| Philip Zeyliger | 272a90e | 2025-05-16 14:49:51 -0700 | [diff] [blame] | 77 | </p> |
| 78 | </div> |
| 79 | `; |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | declare global { |
| 84 | interface HTMLElementTagNameMap { |
| 85 | "sketch-diff-empty-view": SketchDiffEmptyView; |
| 86 | } |
| 87 | } |