@youtyan/code-viewer 0.1.35 → 0.1.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/web/index.html CHANGED
@@ -146,6 +146,26 @@
146
146
  <button id="annotation-clear" type="button" title="delete all annotations">clear</button>
147
147
  <button id="annotation-panel-close" type="button">close</button>
148
148
  </div>
149
+ <div id="annotation-player" hidden>
150
+ <button id="annotation-player-toggle" type="button" title="Play / Pause">▶</button>
151
+ <button id="annotation-player-prev" type="button" title="Previous">‹</button>
152
+ <button id="annotation-player-next" type="button" title="Next">›</button>
153
+ <span id="annotation-player-progress"></span>
154
+ <button id="annotation-player-mute" type="button" title="Mute">🔊</button>
155
+ <select id="annotation-player-rate" title="Speed" aria-label="Playback speed">
156
+ <option value="0.5">0.5x</option>
157
+ <option value="0.75">0.75x</option>
158
+ <option value="1" selected>1x</option>
159
+ <option value="1.25">1.25x</option>
160
+ <option value="1.5">1.5x</option>
161
+ <option value="2">2x</option>
162
+ </select>
163
+ </div>
164
+ <div class="annotation-list-head">
165
+ <strong>Sessions</strong>
166
+ <span id="annotation-list-count"></span>
167
+ </div>
168
+ <div id="annotation-sessions"></div>
149
169
  <div id="annotation-detail" hidden>
150
170
  <div class="annotation-detail-head">
151
171
  <span id="annotation-detail-session"></span>
@@ -157,11 +177,6 @@
157
177
  <a id="annotation-detail-location" href="#"></a>
158
178
  <div id="annotation-detail-body" class="markdown-body"></div>
159
179
  </div>
160
- <div class="annotation-list-head">
161
- <strong>Sessions</strong>
162
- <span id="annotation-list-count"></span>
163
- </div>
164
- <div id="annotation-sessions"></div>
165
180
  </aside>
166
181
 
167
182
  <main id="content">
package/web/style.css CHANGED
@@ -4051,6 +4051,63 @@ body.annotation-panel-open #content {
4051
4051
  color: var(--danger);
4052
4052
  border-color: var(--danger);
4053
4053
  }
4054
+ /* ---- Annotation playback toolbar ---- */
4055
+ #annotation-player {
4056
+ display: flex;
4057
+ align-items: center;
4058
+ gap: 6px;
4059
+ padding: 4px 10px;
4060
+ border-bottom: 1px solid var(--border);
4061
+ font-size: 12px;
4062
+ flex-shrink: 0;
4063
+ }
4064
+ #annotation-player[hidden] { display: none; }
4065
+ #annotation-player-toggle,
4066
+ #annotation-player-prev,
4067
+ #annotation-player-next,
4068
+ #annotation-player-mute {
4069
+ border: 1px solid var(--border);
4070
+ border-radius: 6px;
4071
+ background: var(--bg-soft);
4072
+ color: var(--fg-muted);
4073
+ font-size: 12px;
4074
+ padding: 2px 8px;
4075
+ cursor: pointer;
4076
+ line-height: 1;
4077
+ }
4078
+ #annotation-player-toggle:hover,
4079
+ #annotation-player-prev:hover,
4080
+ #annotation-player-next:hover,
4081
+ #annotation-player-mute:hover {
4082
+ border-color: var(--border-strong);
4083
+ background: var(--bg-mute);
4084
+ color: var(--fg);
4085
+ }
4086
+ #annotation-player-progress {
4087
+ margin-left: auto;
4088
+ opacity: .7;
4089
+ font-variant-numeric: tabular-nums;
4090
+ }
4091
+ #annotation-player.playing #annotation-player-toggle {
4092
+ color: var(--accent);
4093
+ border-color: var(--accent);
4094
+ }
4095
+ #annotation-player-rate {
4096
+ border: 1px solid var(--border);
4097
+ border-radius: 6px;
4098
+ background: var(--bg-soft);
4099
+ color: var(--fg);
4100
+ font: inherit;
4101
+ font-size: 12px;
4102
+ padding: 2px 4px;
4103
+ cursor: pointer;
4104
+ }
4105
+ #annotation-player-rate:focus {
4106
+ outline: none;
4107
+ border-color: var(--accent);
4108
+ box-shadow: 0 0 0 3px var(--accent-muted);
4109
+ }
4110
+ /* ---- end annotation playback toolbar ---- */
4054
4111
  #annotation-sessions {
4055
4112
  flex: 1;
4056
4113
  overflow-y: auto;
@@ -4076,13 +4133,29 @@ body.annotation-panel-open #content {
4076
4133
  font-size: 12px;
4077
4134
  }
4078
4135
  .annotation-session {
4079
- margin-bottom: 14px;
4136
+ /* Each session is a distinct card: a bordered group whose header doubles
4137
+ as the "show this walkthrough inline" toggle. */
4138
+ border: 1px solid var(--border);
4139
+ border-radius: 8px;
4140
+ background: var(--bg);
4141
+ margin-bottom: 12px;
4142
+ overflow: hidden;
4143
+ }
4144
+ .annotation-session.active {
4145
+ border-color: var(--accent);
4080
4146
  }
4081
4147
  .annotation-session-head {
4082
4148
  display: flex;
4083
4149
  align-items: center;
4084
4150
  gap: 6px;
4085
- margin: 6px 0;
4151
+ margin: 0;
4152
+ padding: 4px 6px;
4153
+ background: var(--bg-soft);
4154
+ border-bottom: 1px solid var(--border);
4155
+ }
4156
+ .annotation-session.active .annotation-session-head {
4157
+ background: var(--accent-subtle);
4158
+ border-bottom-color: var(--accent);
4086
4159
  }
4087
4160
  .annotation-session-select {
4088
4161
  flex: 1;
@@ -4093,39 +4166,46 @@ body.annotation-panel-open #content {
4093
4166
  font-size: 12px;
4094
4167
  font-weight: 600;
4095
4168
  text-align: left;
4096
- padding: 2px 4px;
4169
+ padding: 3px 4px;
4097
4170
  border-radius: 6px;
4098
4171
  cursor: pointer;
4099
4172
  overflow: hidden;
4100
4173
  text-overflow: ellipsis;
4101
4174
  white-space: nowrap;
4102
4175
  }
4103
- .annotation-session-select:hover {
4104
- background: var(--accent-subtle);
4105
- }
4106
4176
  .annotation-session.active .annotation-session-select {
4107
- background: var(--accent-subtle);
4108
4177
  color: var(--accent);
4109
4178
  }
4179
+ .annotation-session-time {
4180
+ flex: none;
4181
+ font-size: 10px;
4182
+ color: var(--fg-subtle);
4183
+ white-space: nowrap;
4184
+ }
4110
4185
  .annotation-entries {
4111
4186
  list-style: none;
4112
4187
  margin: 0;
4113
- padding: 0;
4188
+ padding: 4px;
4114
4189
  counter-reset: annotation-step;
4115
4190
  }
4116
4191
  .annotation-entries li {
4117
4192
  display: flex;
4118
- align-items: flex-start;
4193
+ align-items: center;
4119
4194
  gap: 4px;
4120
4195
  border-radius: 6px;
4121
4196
  counter-increment: annotation-step;
4122
4197
  }
4198
+ .annotation-entries li:hover {
4199
+ background: var(--bg-soft);
4200
+ }
4123
4201
  .annotation-entries li.active {
4124
4202
  background: var(--accent-subtle);
4125
4203
  }
4126
4204
  .annotation-entry-open {
4127
4205
  flex: 1;
4128
- display: block;
4206
+ display: grid;
4207
+ grid-template-columns: 18px minmax(0, 1fr);
4208
+ column-gap: 4px;
4129
4209
  text-align: left;
4130
4210
  border: 0;
4131
4211
  background: none;
@@ -4135,17 +4215,28 @@ body.annotation-panel-open #content {
4135
4215
  min-width: 0;
4136
4216
  }
4137
4217
  .annotation-entry-open::before {
4138
- content: counter(annotation-step) ". ";
4218
+ content: counter(annotation-step);
4219
+ grid-row: 1 / span 2;
4139
4220
  color: var(--fg-subtle);
4140
4221
  font-size: 11px;
4222
+ line-height: 1.6;
4223
+ text-align: center;
4224
+ }
4225
+ .annotation-entries li.active .annotation-entry-open::before {
4226
+ color: var(--accent);
4227
+ font-weight: 600;
4141
4228
  }
4142
4229
  .annotation-entry-location {
4230
+ grid-column: 2;
4143
4231
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
4144
4232
  font-size: 11px;
4145
4233
  color: var(--accent);
4146
- word-break: break-all;
4234
+ overflow: hidden;
4235
+ text-overflow: ellipsis;
4236
+ white-space: nowrap;
4147
4237
  }
4148
4238
  .annotation-entry-summary {
4239
+ grid-column: 2;
4149
4240
  display: block;
4150
4241
  font-size: 12px;
4151
4242
  color: var(--fg-muted);
@@ -4153,6 +4244,21 @@ body.annotation-panel-open #content {
4153
4244
  text-overflow: ellipsis;
4154
4245
  white-space: nowrap;
4155
4246
  }
4247
+ /* Per-row actions stay quiet until the row (or the panel item) is hovered,
4248
+ so the list reads as content, not as a wall of trash cans. */
4249
+ .annotation-session-head .annotation-icon-btn,
4250
+ .annotation-entries li .annotation-icon-btn {
4251
+ opacity: 0;
4252
+ transition: opacity 0.12s;
4253
+ }
4254
+ .annotation-session-head:hover .annotation-icon-btn,
4255
+ .annotation-entries li:hover .annotation-icon-btn,
4256
+ .annotation-icon-btn:focus-visible {
4257
+ opacity: 1;
4258
+ }
4259
+ .annotation-entries li .annotation-icon-btn {
4260
+ margin-right: 4px;
4261
+ }
4156
4262
  .annotation-delete {
4157
4263
  border: 1px solid transparent;
4158
4264
  border-radius: 6px;
@@ -4168,11 +4274,15 @@ body.annotation-panel-open #content {
4168
4274
  }
4169
4275
 
4170
4276
  #annotation-detail {
4277
+ /* Docked under the session list with a FIXED height: the list above never
4278
+ moves when the entry body is longer or shorter, so click targets stay
4279
+ put while stepping through a walkthrough. */
4171
4280
  flex: none;
4172
4281
  display: flex;
4173
4282
  flex-direction: column;
4174
- max-height: 55%;
4175
- border-bottom: 1px solid var(--border);
4283
+ height: 45%;
4284
+ min-height: 220px;
4285
+ border-top: 1px solid var(--border);
4176
4286
  background: var(--bg-soft);
4177
4287
  }
4178
4288
  .annotation-detail-head {
@@ -4223,6 +4333,7 @@ body.annotation-panel-open #content {
4223
4333
  text-decoration: underline;
4224
4334
  }
4225
4335
  #annotation-detail-body {
4336
+ flex: 1;
4226
4337
  overflow-y: auto;
4227
4338
  overflow-x: hidden;
4228
4339
  padding: 8px 12px 12px;
@@ -4242,6 +4353,12 @@ body.annotation-panel-open #content {
4242
4353
  background: var(--bg-soft);
4243
4354
  }
4244
4355
  .gdp-annotation-inline {
4356
+ /* The code table can scroll horizontally; keep the note pinned to the
4357
+ visible area (width is synced to the scroll container in
4358
+ annotations-ui.ts). */
4359
+ position: sticky;
4360
+ left: 8px;
4361
+ box-sizing: border-box;
4245
4362
  margin: 4px 8px;
4246
4363
  padding: 8px 12px;
4247
4364
  border: 1px solid var(--border);
@@ -4271,3 +4388,75 @@ body.annotation-panel-open #content {
4271
4388
  .gdp-annotation-inline-body p:last-child {
4272
4389
  margin-bottom: 0;
4273
4390
  }
4391
+
4392
+ /* Annotation editing + AI-ready reference copy */
4393
+ .gdp-annotation-inline {
4394
+ position: sticky;
4395
+ }
4396
+ .annotation-icon-btn {
4397
+ border: 1px solid var(--border);
4398
+ border-radius: 6px;
4399
+ background: var(--bg);
4400
+ color: var(--fg-muted);
4401
+ line-height: 1;
4402
+ padding: 3px 6px;
4403
+ cursor: pointer;
4404
+ display: inline-flex;
4405
+ align-items: center;
4406
+ }
4407
+ .annotation-icon-btn svg {
4408
+ width: 13px;
4409
+ height: 13px;
4410
+ display: block;
4411
+ }
4412
+ .annotation-icon-btn:hover {
4413
+ color: var(--accent);
4414
+ border-color: var(--accent);
4415
+ }
4416
+ .annotation-icon-btn.copied {
4417
+ color: var(--success);
4418
+ border-color: var(--success);
4419
+ }
4420
+ .annotation-icon-btn.failed {
4421
+ color: var(--danger);
4422
+ border-color: var(--danger);
4423
+ }
4424
+ .gdp-annotation-inline-copy {
4425
+ float: right;
4426
+ margin-left: 8px;
4427
+ }
4428
+ .annotation-edit-form {
4429
+ display: flex;
4430
+ flex-direction: column;
4431
+ gap: 8px;
4432
+ height: 100%;
4433
+ }
4434
+ .annotation-edit-form input,
4435
+ .annotation-edit-form textarea {
4436
+ width: 100%;
4437
+ box-sizing: border-box;
4438
+ border: 1px solid var(--border);
4439
+ border-radius: 6px;
4440
+ background: var(--bg);
4441
+ color: var(--fg);
4442
+ font-size: 12px;
4443
+ padding: 6px 8px;
4444
+ }
4445
+ .annotation-edit-form textarea {
4446
+ flex: 1;
4447
+ resize: vertical;
4448
+ font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
4449
+ }
4450
+ .annotation-edit-buttons {
4451
+ display: flex;
4452
+ gap: 8px;
4453
+ justify-content: flex-end;
4454
+ }
4455
+
4456
+ .gdp-annotation-spacer td {
4457
+ padding: 0;
4458
+ background: var(--bg-soft);
4459
+ }
4460
+ .gdp-annotation-spacer td > div {
4461
+ height: 0;
4462
+ }