| Philip Zeyliger | 38499cc | 2025-06-15 21:17:05 -0700 | [diff] [blame] | 1 | <!doctype html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8" /> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 6 | <title>Diff Header Demo</title> |
| 7 | <style> |
| 8 | body { |
| 9 | font-family: system-ui, sans-serif; |
| 10 | margin: 20px; |
| 11 | background: #f5f5f5; |
| 12 | } |
| 13 | .demo-container { |
| 14 | background: white; |
| 15 | border: 1px solid #ddd; |
| 16 | border-radius: 8px; |
| 17 | padding: 20px; |
| 18 | margin-bottom: 20px; |
| 19 | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); |
| 20 | } |
| 21 | .demo-title { |
| 22 | font-size: 18px; |
| 23 | font-weight: bold; |
| 24 | margin-bottom: 15px; |
| 25 | color: #333; |
| 26 | } |
| 27 | .demo-description { |
| 28 | margin-bottom: 15px; |
| 29 | color: #666; |
| 30 | } |
| 31 | .demo-layout { |
| 32 | border: 2px dashed #ccc; |
| 33 | padding: 15px; |
| 34 | background: #fafafa; |
| 35 | } |
| 36 | .header-section { |
| 37 | display: flex; |
| 38 | align-items: center; |
| 39 | gap: 12px; |
| 40 | padding: 8px 16px; |
| 41 | border: 1px solid #e0e0e0; |
| 42 | background: #f8f8f8; |
| 43 | margin-bottom: 10px; |
| 44 | } |
| 45 | .commits-section { |
| 46 | display: flex; |
| 47 | align-items: center; |
| 48 | gap: 12px; |
| 49 | flex: 1; |
| 50 | } |
| 51 | .commits-label { |
| 52 | font-weight: 500; |
| 53 | color: #333; |
| 54 | } |
| 55 | .commit-selector { |
| 56 | display: flex; |
| 57 | align-items: center; |
| 58 | gap: 8px; |
| 59 | } |
| 60 | .file-selector-container { |
| 61 | display: flex; |
| 62 | align-items: center; |
| 63 | gap: 8px; |
| 64 | } |
| 65 | .file-selector { |
| 66 | min-width: 200px; |
| 67 | padding: 8px 12px; |
| 68 | border: 1px solid #ccc; |
| 69 | border-radius: 4px; |
| 70 | } |
| 71 | .expand-button { |
| 72 | background: transparent; |
| 73 | border: 1px solid #e0e0e0; |
| 74 | border-radius: 4px; |
| 75 | padding: 6px 8px; |
| 76 | cursor: pointer; |
| 77 | display: flex; |
| 78 | align-items: center; |
| 79 | justify-content: center; |
| 80 | min-width: 32px; |
| 81 | min-height: 32px; |
| 82 | } |
| 83 | .expand-button:hover { |
| 84 | background: #e8e8e8; |
| 85 | } |
| 86 | .spacer { |
| 87 | flex: 1; |
| 88 | } |
| 89 | .old-layout { |
| 90 | opacity: 0.6; |
| 91 | } |
| 92 | .new-layout { |
| 93 | border-color: #4caf50; |
| 94 | background: #f8fff8; |
| 95 | } |
| 96 | .change-highlight { |
| 97 | background: #ffffcc; |
| 98 | padding: 2px 4px; |
| 99 | border-radius: 3px; |
| 100 | } |
| 101 | </style> |
| 102 | </head> |
| 103 | <body> |
| 104 | <h1>Diff Header Layout Changes</h1> |
| 105 | |
| 106 | <div class="demo-container"> |
| 107 | <div class="demo-title">Before: Original Layout</div> |
| 108 | <div class="demo-description"> |
| 109 | File selector on left, Commits with expand button, range picker on right |
| 110 | </div> |
| 111 | <div class="demo-layout old-layout"> |
| 112 | <div class="header-section"> |
| 113 | <select class="file-selector"> |
| 114 | <option>All files (3)</option> |
| 115 | <option>Modified: src/file1.ts</option> |
| 116 | <option>Added: src/file2.ts</option> |
| 117 | </select> |
| 118 | <div class="spacer"></div> |
| 119 | <div class="commits-section"> |
| 120 | <button class="expand-button">▶ Commits</button> |
| 121 | <!-- Hidden by default --> |
| 122 | </div> |
| 123 | </div> |
| 124 | </div> |
| 125 | </div> |
| 126 | |
| 127 | <div class="demo-container"> |
| 128 | <div class="demo-title">After: New Layout</div> |
| 129 | <div class="demo-description"> |
| 130 | <span class="change-highlight">From/To selectors directly visible</span> |
| 131 | on left, |
| 132 | <span class="change-highlight">file selector moved to right</span>, |
| 133 | <span class="change-highlight" |
| 134 | >expand button in header when single file selected</span |
| 135 | > |
| 136 | </div> |
| 137 | <div class="demo-layout new-layout"> |
| 138 | <div class="header-section"> |
| 139 | <div class="commits-section"> |
| 140 | <div class="commit-selector"> |
| 141 | <label>From:</label> |
| 142 | <select> |
| 143 | <option>abc1234 Initial commit</option> |
| 144 | <option selected>def5678 Add feature</option> |
| 145 | </select> |
| 146 | </div> |
| 147 | <div class="commit-selector"> |
| 148 | <label>To:</label> |
| 149 | <select> |
| 150 | <option selected>Uncommitted Changes</option> |
| 151 | <option>ghi9012 Fix bug</option> |
| 152 | </select> |
| 153 | </div> |
| 154 | </div> |
| 155 | <div class="spacer"></div> |
| 156 | <div class="file-selector-container"> |
| 157 | <select class="file-selector"> |
| 158 | <option>All files (3)</option> |
| 159 | <option>Modified: src/file1.ts</option> |
| 160 | <option>Added: src/file2.ts</option> |
| 161 | </select> |
| 162 | <!-- No expand button when "All files" selected --> |
| 163 | </div> |
| 164 | </div> |
| 165 | </div> |
| 166 | </div> |
| 167 | |
| 168 | <div class="demo-container"> |
| 169 | <div class="demo-title">After: Single File Selected</div> |
| 170 | <div class="demo-description"> |
| 171 | When a single file is selected, |
| 172 | <span class="change-highlight" |
| 173 | >expand/collapse button appears in header</span |
| 174 | > |
| 175 | </div> |
| 176 | <div class="demo-layout new-layout"> |
| 177 | <div class="header-section"> |
| 178 | <div class="commits-section"> |
| 179 | <div class="commit-selector"> |
| 180 | <label>From:</label> |
| 181 | <select> |
| 182 | <option>abc1234 Initial commit</option> |
| 183 | <option selected>def5678 Add feature</option> |
| 184 | </select> |
| 185 | </div> |
| 186 | <div class="commit-selector"> |
| 187 | <label>To:</label> |
| 188 | <select> |
| 189 | <option selected>Uncommitted Changes</option> |
| 190 | <option>ghi9012 Fix bug</option> |
| 191 | </select> |
| 192 | </div> |
| 193 | </div> |
| 194 | <div class="spacer"></div> |
| 195 | <div class="file-selector-container"> |
| 196 | <select class="file-selector"> |
| 197 | <option>All files (3)</option> |
| 198 | <option selected>Modified: src/file1.ts</option> |
| 199 | <option>Added: src/file2.ts</option> |
| 200 | </select> |
| 201 | <button |
| 202 | class="expand-button" |
| 203 | title="Expand: Show all lines including unchanged regions" |
| 204 | > |
| 205 | <svg |
| 206 | width="16" |
| 207 | height="16" |
| 208 | viewBox="0 0 16 16" |
| 209 | fill="currentColor" |
| 210 | > |
| 211 | <!-- Dotted line in the middle --> |
| 212 | <line |
| 213 | x1="2" |
| 214 | y1="8" |
| 215 | x2="14" |
| 216 | y2="8" |
| 217 | stroke="currentColor" |
| 218 | stroke-width="1" |
| 219 | stroke-dasharray="2,1" |
| 220 | /> |
| 221 | <!-- Large arrow pointing up --> |
| 222 | <path d="M8 2 L5 6 L11 6 Z" fill="currentColor" /> |
| 223 | <!-- Large arrow pointing down --> |
| 224 | <path d="M8 14 L5 10 L11 10 Z" fill="currentColor" /> |
| 225 | </svg> |
| 226 | </button> |
| 227 | </div> |
| 228 | </div> |
| 229 | </div> |
| 230 | </div> |
| 231 | |
| 232 | <h2>Summary of Changes</h2> |
| 233 | <ul> |
| 234 | <li> |
| 235 | ✅ Removed the "Commits" expand/collapse button and label - From/To now |
| 236 | directly visible |
| 237 | </li> |
| 238 | <li>✅ Moved file selector from left to right side of header</li> |
| 239 | <li> |
| 240 | ✅ Added expand/collapse button in header when single file is selected |
| 241 | </li> |
| 242 | <li> |
| 243 | ✅ All controls (From, To, File Selector) now on same horizontal line |
| 244 | </li> |
| 245 | <li> |
| 246 | ✅ Expand/collapse button controls showing/hiding unchanged regions in |
| 247 | diff |
| 248 | </li> |
| 249 | </ul> |
| 250 | </body> |
| 251 | </html> |