vzcode 3.0.0 → 3.2.0

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.
@@ -354,8 +354,11 @@ export const VZSidebar = ({
354
354
  </Tooltip>
355
355
  }
356
356
  >
357
- <i
357
+ <button
358
+ type="button"
358
359
  id="ai-chat-icon"
360
+ aria-label="AI chat"
361
+ aria-pressed={isAIChatOpen}
359
362
  className="vz-icon-button"
360
363
  onClick={() =>
361
364
  handleAIChatButtonClick({
@@ -370,7 +373,7 @@ export const VZSidebar = ({
370
373
  }
371
374
  >
372
375
  <SparklesSVG />
373
- </i>
376
+ </button>
374
377
  </OverlayTrigger>
375
378
  )}
376
379
 
@@ -382,8 +385,15 @@ export const VZSidebar = ({
382
385
  </Tooltip>
383
386
  }
384
387
  >
385
- <i
388
+ <button
389
+ type="button"
386
390
  id="files-icon"
391
+ aria-label="Files"
392
+ aria-pressed={
393
+ !isAIChatOpen &&
394
+ !isSearchOpen &&
395
+ !isVisualEditorOpen
396
+ }
387
397
  className="vz-icon-button"
388
398
  onClick={() => {
389
399
  setIsSearchOpen(false);
@@ -393,7 +403,7 @@ export const VZSidebar = ({
393
403
  }}
394
404
  >
395
405
  <FolderSVG />
396
- </i>
406
+ </button>
397
407
  </OverlayTrigger>
398
408
 
399
409
  <OverlayTrigger
@@ -404,8 +414,11 @@ export const VZSidebar = ({
404
414
  </Tooltip>
405
415
  }
406
416
  >
407
- <i
417
+ <button
418
+ type="button"
408
419
  id="search-icon"
420
+ aria-label="Search"
421
+ aria-pressed={isSearchOpen}
409
422
  className="vz-icon-button"
410
423
  onClick={() => {
411
424
  setIsSearchOpen(true);
@@ -415,7 +428,7 @@ export const VZSidebar = ({
415
428
  }}
416
429
  >
417
430
  <SearchSVG />
418
- </i>
431
+ </button>
419
432
  </OverlayTrigger>
420
433
 
421
434
  <OverlayTrigger
@@ -426,8 +439,11 @@ export const VZSidebar = ({
426
439
  </Tooltip>
427
440
  }
428
441
  >
429
- <i
442
+ <button
443
+ type="button"
430
444
  id="visual-editor-icon"
445
+ aria-label="Visual editor"
446
+ aria-pressed={isVisualEditorOpen}
431
447
  className="vz-icon-button"
432
448
  onClick={() => {
433
449
  setIsVisualEditorOpen(true);
@@ -437,7 +453,7 @@ export const VZSidebar = ({
437
453
  }}
438
454
  >
439
455
  <AdjustmentSVG />
440
- </i>
456
+ </button>
441
457
  </OverlayTrigger>
442
458
 
443
459
  <OverlayTrigger
@@ -448,13 +464,15 @@ export const VZSidebar = ({
448
464
  </Tooltip>
449
465
  }
450
466
  >
451
- <i
467
+ <button
468
+ type="button"
452
469
  id="shortcut-icon"
470
+ aria-label="Keyboard shortcuts"
453
471
  className="vz-icon-button"
454
472
  onClick={handleQuestionMarkClick}
455
473
  >
456
474
  <QuestionMarkSVG />
457
- </i>
475
+ </button>
458
476
  </OverlayTrigger>
459
477
 
460
478
  <OverlayTrigger
@@ -467,12 +485,16 @@ export const VZSidebar = ({
467
485
  >
468
486
  <a
469
487
  href="https://github.com/vizhub-core/vzcode/issues/new"
488
+ aria-label="Report a bug"
470
489
  target="_blank"
471
490
  rel="noopener noreferrer"
472
491
  >
473
- <i id="bug-icon" className="vz-icon-button">
492
+ <span
493
+ id="bug-icon"
494
+ className="vz-icon-button"
495
+ >
474
496
  <BugSVG />
475
- </i>
497
+ </span>
476
498
  </a>
477
499
  </OverlayTrigger>
478
500
 
@@ -484,13 +506,15 @@ export const VZSidebar = ({
484
506
  </Tooltip>
485
507
  }
486
508
  >
487
- <i
509
+ <button
510
+ type="button"
488
511
  id="settings-icon"
512
+ aria-label="Editor settings"
489
513
  className="vz-icon-button"
490
514
  onClick={handleSettingsClick}
491
515
  >
492
516
  <GearSVG />
493
- </i>
517
+ </button>
494
518
  </OverlayTrigger>
495
519
 
496
520
  <OverlayTrigger
@@ -501,13 +525,15 @@ export const VZSidebar = ({
501
525
  </Tooltip>
502
526
  }
503
527
  >
504
- <i
528
+ <button
529
+ type="button"
505
530
  id="new-file-icon"
531
+ aria-label="Create file"
506
532
  className="vz-icon-button"
507
533
  onClick={handleOpenCreateFileModal}
508
534
  >
509
535
  <NewSVG />
510
- </i>
536
+ </button>
511
537
  </OverlayTrigger>
512
538
 
513
539
  {/*Directory Rename*/}
@@ -519,13 +545,15 @@ export const VZSidebar = ({
519
545
  </Tooltip>
520
546
  }
521
547
  >
522
- <i
548
+ <button
549
+ type="button"
523
550
  id="new-directory-icon"
551
+ aria-label="Create directory"
524
552
  className="vz-icon-button"
525
553
  onClick={handleOpenCreateDirModal}
526
554
  >
527
555
  <FileSVG />
528
- </i>
556
+ </button>
529
557
  </OverlayTrigger>
530
558
 
531
559
  {/*Toggle Follow*/}
@@ -539,8 +567,11 @@ export const VZSidebar = ({
539
567
  </Tooltip>
540
568
  }
541
569
  >
542
- <i
570
+ <button
571
+ type="button"
543
572
  id="auto-focus-icon"
573
+ aria-label="Follow collaborator cursor"
574
+ aria-pressed={enableAutoFollow}
544
575
  className={`vz-icon-button${
545
576
  enableAutoFollow
546
577
  ? ' vz-color-success-01'
@@ -548,9 +579,8 @@ export const VZSidebar = ({
548
579
  }`}
549
580
  onClick={toggleAutoFollow}
550
581
  >
551
- <i></i>
552
582
  <PinSVG />
553
- </i>
583
+ </button>
554
584
  </OverlayTrigger>
555
585
  {/* Start Voice Chat */}
556
586
  {enableLiveKit && (
@@ -562,15 +592,17 @@ export const VZSidebar = ({
562
592
  </Tooltip>
563
593
  }
564
594
  >
565
- <i
595
+ <button
596
+ type="button"
566
597
  id="mic-icon"
598
+ aria-label="Voice chat"
567
599
  className="vz-icon-button"
568
600
  onClick={() => {
569
601
  setVoiceChatModalOpen(true);
570
602
  }}
571
603
  >
572
604
  <MicSVG />
573
- </i>
605
+ </button>
574
606
  </OverlayTrigger>
575
607
  )}
576
608
  </div>
@@ -680,7 +712,7 @@ export const VZSidebar = ({
680
712
  title="Delete all files"
681
713
  >
682
714
  <Trash2 size={14} aria-hidden="true" />
683
- delete all
715
+ Delete all files
684
716
  </button>
685
717
  )}
686
718
  </div>
@@ -8,7 +8,8 @@
8
8
 
9
9
  .full-box {
10
10
  width: 100%;
11
- height: 100%;
11
+ flex: 1 1 auto;
12
+ min-height: 0;
12
13
  display: flex;
13
14
  flex-direction: row;
14
15
  justify-content: start;
@@ -182,12 +183,12 @@
182
183
  .file-or-directory:hover,
183
184
  .settings:hover {
184
185
  // background-color: #47546b;
185
- background-color: rgba(255, 255, 255, 0.075);
186
+ background-color: var(--vz-color-hover-dark);
186
187
  }
187
188
 
188
189
  .active-file,
189
190
  .active-file:hover {
190
- background-color: #264399;
191
+ background-color: rgba(3, 102, 214, 0.36);
191
192
  }
192
193
 
193
194
  .name {
@@ -201,6 +202,11 @@
201
202
  .arrow-wrapper {
202
203
  opacity: 0.5;
203
204
  }
205
+ .file-icon {
206
+ display: flex;
207
+ align-items: center;
208
+ justify-content: center;
209
+ }
204
210
  }
205
211
 
206
212
  .rename-input {
@@ -300,77 +306,79 @@
300
306
  }
301
307
  }
302
308
 
309
+ // File actions are a compact toolbar below the independently scrolling tree.
303
310
  .ai-buttons {
304
311
  display: flex;
312
+ flex: 0 0 auto;
305
313
  flex-direction: column;
306
- gap: 8px;
307
- padding: 10px 10px 0 10px;
308
- border-top: 1px solid var(--vz-color-neutral-02);
314
+ gap: 4px;
315
+ padding: 8px;
316
+ border-top: 1px solid
317
+ var(--vz-color-neutral-02, #202e46);
309
318
 
310
319
  .ai-button {
311
- padding: 8px 12px;
312
- border: 1px solid var(--vz-color-neutral-03);
320
+ appearance: none;
321
+ display: inline-flex;
322
+ align-items: center;
323
+ justify-content: flex-start;
324
+ gap: 10px;
325
+ width: 100%;
326
+ min-width: 0;
327
+ min-height: 38px;
328
+ padding: 8px 10px;
329
+ border: 1px solid transparent;
313
330
  border-radius: 6px;
314
- background: var(--vz-color-neutral-01);
315
- color: var(--vz-color-neutral-04);
316
- font-size: 12px;
331
+ background: rgba(255, 255, 255, 0.04);
332
+ color: var(--vz-color-neutral-04, #bdc7dc);
333
+ font-family: var(--vz-font-body, Inter, sans-serif);
334
+ font-size: 13px;
317
335
  font-weight: 500;
318
- font-family: var(--vzcode-font-family);
336
+ line-height: 1.2;
337
+ text-align: left;
319
338
  cursor: pointer;
320
- transition: all 0.2s ease;
339
+ transition:
340
+ background-color 0.15s ease,
341
+ border-color 0.15s ease;
321
342
 
322
- i {
323
- margin-right: 8px;
343
+ svg {
344
+ flex: 0 0 auto;
324
345
  }
325
346
 
326
347
  &:hover {
327
- background: var(--vz-color-hover-dark);
328
- border-color: var(--vz-color-neutral-04);
348
+ background: var(
349
+ --vz-color-hover-dark,
350
+ rgba(255, 255, 255, 0.1)
351
+ );
352
+ border-color: var(--vz-color-neutral-03, #576786);
329
353
  }
330
354
 
331
355
  &:active {
332
- background: var(--vz-color-neutral-03);
333
- }
334
-
335
- &.copy-button {
336
- border-color: var(--vz-color-primary-03);
337
-
338
- &:hover {
339
- background: var(--vz-color-hover-dark);
340
- border-color: var(--vz-color-primary-04);
341
- }
356
+ background: var(
357
+ --vz-color-active-dark,
358
+ rgba(255, 255, 255, 0.2)
359
+ );
342
360
  }
343
361
 
344
- &.export-button {
345
- border-color: var(--vz-color-primary-03);
346
-
347
- &:hover {
348
- background: var(--vz-color-hover-dark);
349
- border-color: var(--vz-color-neutral-04);
350
- }
362
+ &:focus-visible {
363
+ outline: 2px solid
364
+ var(--vz-color-action-01, #0366d6);
365
+ outline-offset: 2px;
351
366
  }
352
367
 
353
- &.paste-button {
354
- border-color: var(--vz-color-success-03);
355
-
356
- &:hover {
357
- background: var(--vz-color-hover-dark);
358
- border-color: var(--vz-color-success-04);
359
- }
368
+ &:disabled {
369
+ opacity: 0.5;
370
+ cursor: not-allowed;
360
371
  }
361
372
 
362
373
  &.delete-all-button {
363
- border-color: var(--vz-color-neutral-02);
364
- color: var(--vz-color-neutral-03);
365
- font-size: 11px;
366
- font-weight: 400;
367
- opacity: 0.7;
374
+ margin-top: 4px;
375
+ background: transparent;
376
+ color: var(--vz-color-neutral-04, #bdc7dc);
368
377
 
369
378
  &:hover {
370
- background: var(--vz-color-hover-dark);
371
- border-color: var(--vz-color-danger-03);
372
- color: var(--vz-color-danger-04);
373
- opacity: 1;
379
+ background: rgba(240, 53, 61, 0.13);
380
+ border-color: var(--vz-color-danger-03, #f0353d);
381
+ color: #ffd7da;
374
382
  }
375
383
  }
376
384
  }
@@ -6,13 +6,20 @@
6
6
  */
7
7
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@400;600;700&display=swap');
8
8
 
9
- :where(.app, .ai-chat-container, .vz-ui-modal) {
9
+ /* The embedded VZSidebar is also mounted directly by VizHub Cloud,
10
+ * without VZCode's standalone .app wrapper. Scope tokens to that root too. */
11
+ :where(
12
+ .app,
13
+ .vz-sidebar,
14
+ .ai-chat-container,
15
+ .vz-ui-modal
16
+ ) {
10
17
  --vz-color-neutral-01: #1f2022;
11
18
  --vz-color-neutral-02: #202e46;
12
19
  --vz-color-neutral-03: #576786;
13
20
  --vz-color-neutral-04: #bdc7dc;
14
- --vz-color-action-01: #3866e9;
15
- --vz-color-action-02: #022a9f;
21
+ --vz-color-action-01: #0366d6;
22
+ --vz-color-action-02: #0256c2;
16
23
  --vz-color-action-03: #e0e8ff;
17
24
  --vz-color-warning-01: #eb1c69;
18
25
  --vz-color-warning-02: #ffeff2;
@@ -29,8 +36,8 @@
29
36
  --vz-color-primary-04: var(--vz-color-action-03);
30
37
  --vz-color-success-03: #36bb4a;
31
38
  --vz-color-success-04: #d7f6dc;
32
- --vz-color-danger-03: #eb1c69;
33
- --vz-color-danger-04: #ffeff2;
39
+ --vz-color-danger-03: #f0353d;
40
+ --vz-color-danger-04: #fff1f2;
34
41
  --vz-font-body: Inter, sans-serif;
35
42
  --vz-font-heading: Poppins, sans-serif;
36
43
  }
@@ -315,3 +322,155 @@
315
322
  opacity: 1;
316
323
  visibility: visible;
317
324
  }
325
+
326
+ /* AI Studio design contract for VZCode controls.
327
+ * The code editor's dark surface and syntax highlighting remain unchanged.
328
+ * Dialogs are portaled to body, so modal selectors cannot rely on .app. */
329
+ :is(.app, .vz-sidebar) .vz-icon-button {
330
+ appearance: none;
331
+ display: inline-flex;
332
+ align-items: center;
333
+ justify-content: center;
334
+ min-width: 32px;
335
+ min-height: 32px;
336
+ padding: 4px;
337
+ border: 0;
338
+ border-radius: 6px;
339
+ background: transparent;
340
+ color: var(--vz-color-neutral-04);
341
+ font: inherit;
342
+ text-decoration: none;
343
+ cursor: pointer;
344
+ transition:
345
+ background-color 0.15s ease,
346
+ color 0.15s ease;
347
+ }
348
+ :is(.app, .vz-sidebar) .vz-icon-button:hover {
349
+ background: var(--vz-color-hover-dark);
350
+ }
351
+ :is(.app, .vz-sidebar) .vz-icon-button:active {
352
+ background: var(--vz-color-active-dark);
353
+ }
354
+ :is(.app, .vz-sidebar)
355
+ .vz-icon-button[aria-pressed='true'] {
356
+ background: rgba(3, 102, 214, 0.3);
357
+ color: #fff;
358
+ }
359
+ :is(.app, .vz-sidebar)
360
+ .vz-icon-button[aria-pressed='true']:hover {
361
+ background: rgba(3, 102, 214, 0.42);
362
+ }
363
+ :is(.app, .vz-sidebar) .vz-icon-button:focus-visible {
364
+ outline: 2px solid var(--vz-color-action-01);
365
+ outline-offset: 2px;
366
+ }
367
+ .vz-ui-button {
368
+ min-height: 36px;
369
+ gap: 8px;
370
+ padding: 8px 16px;
371
+ border-radius: 6px;
372
+ background: #f5f5f5;
373
+ color: #262626;
374
+ font:
375
+ 500 14px/1.25 Inter,
376
+ sans-serif;
377
+ transition:
378
+ background-color 0.15s ease,
379
+ border-color 0.15s ease,
380
+ color 0.15s ease;
381
+ }
382
+ .vz-ui-button:hover:not(:disabled) {
383
+ filter: none;
384
+ background: #e5e5e5;
385
+ }
386
+ .vz-ui-button--primary {
387
+ background: #0366d6;
388
+ color: #fff;
389
+ }
390
+ .vz-ui-button--primary:hover:not(:disabled) {
391
+ background: #0256c2;
392
+ }
393
+ .vz-ui-button--danger {
394
+ background: #f0353d;
395
+ color: #fff;
396
+ }
397
+ .vz-ui-button--danger:hover:not(:disabled) {
398
+ background: #d62e35;
399
+ }
400
+ .vz-ui-button--outline-secondary {
401
+ background: #fff;
402
+ border-color: #e5e5e5;
403
+ color: #262626;
404
+ }
405
+ .vz-ui-button--outline-secondary:hover:not(:disabled) {
406
+ background: #f5f5f5;
407
+ }
408
+ .vz-ui-button--outline-primary {
409
+ background: transparent;
410
+ border-color: #0366d6;
411
+ color: #0366d6;
412
+ }
413
+ .vz-ui-button--outline-primary:hover:not(:disabled) {
414
+ background: #e9f1fc;
415
+ color: #0256c2;
416
+ }
417
+ .vz-ui-button--sm {
418
+ min-height: 32px;
419
+ padding: 6px 12px;
420
+ font-size: 12px;
421
+ }
422
+ .vz-ui-button:focus-visible,
423
+ .vz-ui-control:focus-visible,
424
+ .vz-ui-select:focus-visible,
425
+ .vz-ui-close:focus-visible {
426
+ outline: 2px solid #0366d6;
427
+ outline-offset: 2px;
428
+ }
429
+ .vz-ui-modal {
430
+ border-radius: 10px;
431
+ }
432
+ .vz-ui-close {
433
+ border-radius: 6px;
434
+ }
435
+ .vz-ui-close:hover {
436
+ background: #f5f5f5;
437
+ color: #262626;
438
+ }
439
+ .vz-ui-control,
440
+ .vz-ui-select {
441
+ border-radius: 6px;
442
+ background: #fff;
443
+ padding: 8px 12px;
444
+ }
445
+ .vz-ui-control:focus,
446
+ .vz-ui-select:focus {
447
+ border-color: #0366d6;
448
+ }
449
+ .vz-ui-label {
450
+ font-size: 14px;
451
+ }
452
+ .vz-ui-control,
453
+ .vz-ui-select {
454
+ font-size: 14px;
455
+ }
456
+ @media (pointer: coarse) {
457
+ .vz-ui-control,
458
+ .vz-ui-select {
459
+ font-size: 16px;
460
+ }
461
+ }
462
+ @media (pointer: coarse) {
463
+ :is(.app, .vz-sidebar) .vz-icon-button {
464
+ min-width: 44px;
465
+ min-height: 44px;
466
+ }
467
+ .vz-ui-button {
468
+ min-height: 44px;
469
+ }
470
+ }
471
+ @media (prefers-reduced-motion: reduce) {
472
+ :is(.app, .vz-sidebar) .vz-icon-button,
473
+ .vz-ui-button {
474
+ transition: none;
475
+ }
476
+ }
package/src/client/ui.tsx CHANGED
@@ -300,7 +300,7 @@ export const OverlayTrigger = ({
300
300
  <span
301
301
  ref={anchor}
302
302
  className="vz-ui-tooltip-anchor"
303
- tabIndex={0}
303
+ // Nested interactive elements own keyboard focus; avoid an extra tab stop.
304
304
  onPointerEnter={update}
305
305
  onPointerLeave={() => setPosition(null)}
306
306
  onFocus={update}
@@ -891,3 +891,49 @@
891
891
  outline-offset: 2px;
892
892
  }
893
893
  }
894
+
895
+ /* Match AI Studio action/focus treatments without changing the dark chat surface. */
896
+ .ai-chat-mode-toggle .vz-chat-button-group .vz-chat-button,
897
+ .ai-chat-input-group .ai-chat-send-button {
898
+ border-radius: 6px;
899
+ transition:
900
+ background-color 0.15s ease,
901
+ border-color 0.15s ease,
902
+ color 0.15s ease;
903
+ }
904
+ .ai-chat-mode-toggle
905
+ .vz-chat-button-group
906
+ .vz-chat-button:focus-visible,
907
+ .ai-chat-input-group .ai-chat-send-button:focus-visible,
908
+ .jump-to-latest-button:focus-visible {
909
+ outline: 2px solid var(--vz-color-primary-01);
910
+ outline-offset: 2px;
911
+ }
912
+ .ai-chat-mode-toggle
913
+ .vz-chat-button-group
914
+ .vz-chat-button:disabled,
915
+ .ai-chat-input-group .ai-chat-send-button:disabled {
916
+ opacity: 0.5;
917
+ }
918
+ .ai-chat-input-group textarea:focus {
919
+ border-color: var(--vz-color-primary-01) !important;
920
+ box-shadow: 0 0 0 2px rgba(3, 102, 214, 0.3) !important;
921
+ }
922
+ .jump-to-latest-button {
923
+ transition:
924
+ background-color 0.15s ease,
925
+ box-shadow 0.15s ease;
926
+ }
927
+ .jump-to-latest-button:hover,
928
+ .jump-to-latest-button:active {
929
+ transform: translateX(-50%);
930
+ }
931
+ @media (prefers-reduced-motion: reduce) {
932
+ .ai-chat-mode-toggle
933
+ .vz-chat-button-group
934
+ .vz-chat-button,
935
+ .ai-chat-input-group .ai-chat-send-button,
936
+ .jump-to-latest-button {
937
+ transition: none;
938
+ }
939
+ }