@vitrinka/web 0.8.1 → 0.9.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.
- package/CHANGELOG.md +59 -0
- package/README.md +20 -9
- package/build/recorder/lead.d.ts +2 -0
- package/build/recorder/lead.js +4 -0
- package/build/recorder/version.d.ts +2 -2
- package/build/recorder/version.js +1 -1
- package/build/report/element.d.ts +2 -19
- package/build/report/element.js +76 -4
- package/build/report/face.d.ts +7 -0
- package/build/report/face.js +11 -0
- package/build/report/i18n.d.ts +10 -2
- package/build/report/i18n.js +22 -6
- package/build/report/keybind.d.ts +8 -0
- package/build/report/keybind.js +19 -9
- package/build/report/place.d.ts +11 -0
- package/build/report/place.js +14 -0
- package/build/report/settings.d.ts +7 -1
- package/build/report/settings.js +8 -0
- package/build/report/styles.d.ts +1 -1
- package/build/report/styles.js +32 -14
- package/build/report/widget.d.ts +8 -2
- package/build/report/widget.js +143 -63
- package/build/report-widget.mjs +39 -21
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,64 @@
|
|
|
1
1
|
# @vitrinka/web
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
- **Box first, and the default.** The marking bar reads **Box · Circle ·
|
|
6
|
+
Arrow · Cover**, with Box picked when marking starts: most problems are a
|
|
7
|
+
region, and a box is the one gesture nobody has to learn. Since 0.7.0
|
|
8
|
+
marking started on Circle.
|
|
9
|
+
- **Hide is now Cover, and says what it does.** Reporters did not know what
|
|
10
|
+
**Hide** was for. It is **Cover** (cs **Zakrýt**), and while it is picked
|
|
11
|
+
the bar's line reads "Cover what the team shouldn't see" (cs "Zakryjte, co
|
|
12
|
+
tým nemá vidět"). A placed cover reads "Covered — not sent" (cs "Zakryto —
|
|
13
|
+
neodešle se"), shown once the box is wide enough to hold it. What a cover
|
|
14
|
+
does is unchanged: the region is blank in everything the report sends.
|
|
15
|
+
- **The coach lives on the card, not on the page.** It no longer follows
|
|
16
|
+
the pointer over the page you are marking. It rides on the card's edge
|
|
17
|
+
that faces the page — above a card in a bottom corner, below one in a top
|
|
18
|
+
corner — or beside the card when the window is too short, and over the
|
|
19
|
+
card's top on a phone. Drawing goes on through it. It shows the picked
|
|
20
|
+
shape (a box dragged, a loop drawn, an arrow, a cover) with its own line
|
|
21
|
+
("Click, hold and move across the problem."), stays while you mark, and
|
|
22
|
+
leaves for good on **Got it, don't show again** (cs **Chápu, už
|
|
23
|
+
nezobrazovat**). **Settings → Marking tips** brings it back, per browser
|
|
24
|
+
(`vitrinka.report.coach`). The keyboard instructions left its face: they
|
|
25
|
+
are the marking layer's description for screen readers.
|
|
26
|
+
- **The coach draws under its pointer.** The pointer ran on SVG motion at a
|
|
27
|
+
steady pace and the line on an eased CSS animation of its own, so the line
|
|
28
|
+
drew ahead of the pointer. Both now run on one SVG clock with the same
|
|
29
|
+
timing: wherever the run is paused, the pointer's tip sits on the end of
|
|
30
|
+
the line. Since 0.7.0.
|
|
31
|
+
- **⌥⇧A opens Report a problem by default** (Alt+Shift+A on Windows and
|
|
32
|
+
Linux): the recorder pill's annotate chord, so "flag it here" is one key
|
|
33
|
+
in either face. A reporter records another in Settings or removes it, and
|
|
34
|
+
a removed shortcut stays removed (`off` in
|
|
35
|
+
`vitrinka.recorder.report.keybind`).
|
|
36
|
+
|
|
37
|
+
Upgrading:
|
|
38
|
+
|
|
39
|
+
- **A page that uses ⌥⇧A / Alt+Shift+A itself** now shares it with the
|
|
40
|
+
widget while Report a problem is mounted; the widget opens its card. A
|
|
41
|
+
reporter can remove or change the widget's shortcut in Settings.
|
|
42
|
+
- **Tests that named the tools** press **Cover** instead of **Hide** (cs
|
|
43
|
+
**Zakrýt** instead of **Skrýt**), and a first mark drawn without picking a
|
|
44
|
+
shape is now a box. The coach no longer leaves after the first mark: a
|
|
45
|
+
test that waited for it to hide presses **Got it, don't show again**.
|
|
46
|
+
|
|
47
|
+
## 0.8.2
|
|
48
|
+
|
|
49
|
+
- **Your own opener reaches Report a problem from the pill.** While a
|
|
50
|
+
linked member's recorder pill was on screen — after **Record**, a reload
|
|
51
|
+
onto a remembered pick, or a dev-mode member's first mount — every opener
|
|
52
|
+
the host owns did nothing: the element's and the handle's `open()`, and
|
|
53
|
+
the `open-selector` control, all spoke to the report face the pill had
|
|
54
|
+
replaced. A user menu's "Report a problem" item closed its menu and left
|
|
55
|
+
nothing open. An idle pill now swaps back, remembering Report a problem
|
|
56
|
+
as the pick exactly as the pill's own menu row does, and opens the card.
|
|
57
|
+
A pill that is recording, or still starting a recording, stays on
|
|
58
|
+
screen, since leaving would strand the session, and the console says why
|
|
59
|
+
once. `close()` on the pill still does
|
|
60
|
+
nothing. Since 0.8.0.
|
|
61
|
+
|
|
3
62
|
## 0.8.1
|
|
4
63
|
|
|
5
64
|
- **Record keeps the report you started.** A linked member's **Record**
|
package/README.md
CHANGED
|
@@ -306,10 +306,14 @@ profile** (set in vitrinka; see [`docs/PROTOCOL.md`](../../docs/PROTOCOL.md)
|
|
|
306
306
|
§ Report a problem). You need the project's report key (`vkb_…`).
|
|
307
307
|
|
|
308
308
|
**Marking.** **Show us where** puts a glass bar at the top of the page —
|
|
309
|
-
"Mark where the problem is", a segmented **
|
|
310
|
-
and **Cancel** — and you
|
|
311
|
-
|
|
312
|
-
|
|
309
|
+
"Mark where the problem is", a segmented **Box · Circle · Arrow · Cover**
|
|
310
|
+
(Box picked) and **Cancel** — and you box, circle, point at or cover parts
|
|
311
|
+
of the page. **Cover** blanks what is under it in everything the report
|
|
312
|
+
sends, and the bar says so while it is picked ("Cover what the team
|
|
313
|
+
shouldn’t see"). A coach on the card’s edge facing the page — above it, or
|
|
314
|
+
beside it when there is no room — shows the picked shape’s gesture ("click,
|
|
315
|
+
hold and move") until the reporter presses **Got it, don’t show again**;
|
|
316
|
+
**Settings → Marking tips** brings it back (`vitrinka.report.coach`). A mark carries a pin on the page (its number and ✕) and a line in
|
|
313
317
|
the card for its note; a press on the number puts the caret there, and a
|
|
314
318
|
note on a mark is enough to send. The card stays where it rested and moves
|
|
315
319
|
only when a mark lands under it, to the corner that covers the least of
|
|
@@ -446,7 +450,11 @@ Reporters never need it: your token vouches for them.
|
|
|
446
450
|
the widget's `base` gets **Record** and **Recent recordings** in the ⋯
|
|
447
451
|
menu. **Record** swaps Report a problem for the recorder pill in place,
|
|
448
452
|
recording on the member's link, never your `vkb_` key; the idle pill's ⋯
|
|
449
|
-
menu then offers **Report a problem**, which swaps back.
|
|
453
|
+
menu then offers **Report a problem**, which swaps back. Your own opener
|
|
454
|
+
does the same: `open()` or your `open-selector` control swaps back (the
|
|
455
|
+
pick, as the pill's row remembers it) and opens the card; while the pill
|
|
456
|
+
records, or starts to, it leaves the pill on screen and warns once in the console,
|
|
457
|
+
since leaving would strand the session. **Record** waits,
|
|
450
458
|
and says so, while the card holds a report not sent yet — words, a mark,
|
|
451
459
|
a picked type, a file — since the swap would lose it. The pick is
|
|
452
460
|
remembered per browser and origin (`vitrinka.report.face`); a member who
|
|
@@ -477,13 +485,16 @@ or press Alt+arrow while it has focus; the corner is remembered per site
|
|
|
477
485
|
(`vitrinka.report.dock`), and the card opens beside the button — above it
|
|
478
486
|
at the bottom, below it at the top. **Settings** (⋯) holds the shortcut
|
|
479
487
|
below, **Size** — Small · Medium · Large, one scale for the button, the
|
|
480
|
-
card and the marking bar (`vitrinka.report.size`) — and **Technical
|
|
488
|
+
card and the marking bar (`vitrinka.report.size`) — **Marking tips**, and **Technical
|
|
481
489
|
details** for a support conversation: version, capture window, whether
|
|
482
490
|
capture runs, the buffer and its cap, the server.
|
|
483
491
|
|
|
484
|
-
**The shortcut.**
|
|
485
|
-
|
|
486
|
-
|
|
492
|
+
**The shortcut.** ⌥⇧A on a Mac, Alt+Shift+A elsewhere — the recorder
|
|
493
|
+
pill’s annotate chord, so "flag it here" is one key in either face. A
|
|
494
|
+
reporter records another in **Settings** by pressing it (a modifier other
|
|
495
|
+
than Shift is required, Esc cancels) or removes it, and a removed shortcut
|
|
496
|
+
stays removed. It is kept in `localStorage`
|
|
497
|
+
(`vitrinka.recorder.report.keybind`; `off` once removed).
|
|
487
498
|
|
|
488
499
|
**Typing stays in the widget.** A key typed into a field of the card, a
|
|
489
500
|
mark's line or a pill sheet never reaches your page's shortcuts — even one
|
package/build/recorder/lead.d.ts
CHANGED
|
@@ -67,6 +67,8 @@ export declare function startLead(h: LeadHandlers, at?: OneEnv | null): () => vo
|
|
|
67
67
|
export declare function claimForStart(): void;
|
|
68
68
|
/** The Start settled: created (the claim moves on with the session) or not (it goes). */
|
|
69
69
|
export declare function settleStart(created: boolean): void;
|
|
70
|
+
/** A Start claimed this document and waits on its session: no session record yet, but one is on its way. */
|
|
71
|
+
export declare function startInFlight(): boolean;
|
|
70
72
|
/** This document's Stop is draining `sessionId` (null: it settled). */
|
|
71
73
|
export declare function setLeadStopping(sessionId: string | null): void;
|
|
72
74
|
/** The HUD's flow face (D7). */
|
package/build/recorder/lead.js
CHANGED
|
@@ -369,6 +369,10 @@ export function settleStart(created) {
|
|
|
369
369
|
releaseClaim(env, self.inst);
|
|
370
370
|
refresh();
|
|
371
371
|
}
|
|
372
|
+
/** A Start claimed this document and waits on its session: no session record yet, but one is on its way. */
|
|
373
|
+
export function startInFlight() {
|
|
374
|
+
return starting;
|
|
375
|
+
}
|
|
372
376
|
/** This document's Stop is draining `sessionId` (null: it settled). */
|
|
373
377
|
export function setLeadStopping(sessionId) {
|
|
374
378
|
stopping = sessionId;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Sent as `meta.recorder` and written as `data-vitrinka-page`; bumped with the package version. */
|
|
2
|
-
export declare const RECORDER_VERSION = "0.
|
|
3
|
-
export declare const RECORDER_ID = "web/0.
|
|
2
|
+
export declare const RECORDER_VERSION = "0.9.0";
|
|
3
|
+
export declare const RECORDER_ID = "web/0.9.0";
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The two ways in, shared by the npm entry (`@vitrinka/web/report`) and the
|
|
3
|
-
* single-file widget (`build/report-widget.mjs`): the `<vitrinka-report>`
|
|
4
|
-
* custom element and `mountReport(opts)`, which creates one.
|
|
5
|
-
*
|
|
6
|
-
* <vitrinka-report key="vkb_…" base="https://vitrinka.example"
|
|
7
|
-
* locale="cs" button="false" open-selector="#help-report">
|
|
8
|
-
*
|
|
9
|
-
* The element is a configuration holder that renders nothing itself: the
|
|
10
|
-
* widget paints into the shared HUD host on `<html>` (top layer, shadow
|
|
11
|
-
* root). Attributes are live — `locale` repaints in place, `button` shows or
|
|
12
|
-
* hides the floating button, `open-selector` rebinds; a changed `key` or
|
|
13
|
-
* `base` remounts. The face is config (QA Studio D6): `face: 'recorder'`
|
|
14
|
-
* mounts the recorder pill instead (npm entry only — it needs React and a
|
|
15
|
-
* `vkr_` key or a device link). A linked vitrinka member also switches faces
|
|
16
|
-
* in place (vt-8020 D8, face.ts): the report menu's Record swaps in the pill
|
|
17
|
-
* on the device link, the pill's "Report a problem" swaps back, and the pick
|
|
18
|
-
* survives a reload (npm entry only, like `face: 'recorder'`).
|
|
19
|
-
*/
|
|
20
1
|
import type { RecordLoader } from './engine';
|
|
21
2
|
import { type Locale } from './i18n';
|
|
22
3
|
import type { IdentifyInput } from './identity';
|
|
@@ -52,6 +33,7 @@ export interface ReportOptions extends ReportScriptOptions {
|
|
|
52
33
|
export interface ReportHandle {
|
|
53
34
|
/** The face on screen — a linked member's Record switch turns a `report` mount into `recorder`. */
|
|
54
35
|
readonly face: ReportFace;
|
|
36
|
+
/** Opens the card; on a member's switched pill it swaps back first (never while the pill records or starts to). */
|
|
55
37
|
open(): void;
|
|
56
38
|
close(): void;
|
|
57
39
|
identify(who: IdentifyInput): void;
|
|
@@ -64,6 +46,7 @@ export interface VitrinkaReportElement extends HTMLElement {
|
|
|
64
46
|
options: ReportScriptOptions;
|
|
65
47
|
/** The face on screen: `recorder` while a linked member has switched to the pill. */
|
|
66
48
|
readonly face: ReportFace;
|
|
49
|
+
/** Opens the card; on the pill it swaps back first (never while the pill records or starts to). */
|
|
67
50
|
open(): void;
|
|
68
51
|
close(): void;
|
|
69
52
|
identify(who: IdentifyInput): void;
|
package/build/report/element.js
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The two ways in, shared by the npm entry (`@vitrinka/web/report`) and the
|
|
3
|
+
* single-file widget (`build/report-widget.mjs`): the `<vitrinka-report>`
|
|
4
|
+
* custom element and `mountReport(opts)`, which creates one.
|
|
5
|
+
*
|
|
6
|
+
* <vitrinka-report key="vkb_…" base="https://vitrinka.example"
|
|
7
|
+
* locale="cs" button="false" open-selector="#help-report">
|
|
8
|
+
*
|
|
9
|
+
* The element is a configuration holder that renders nothing itself: the
|
|
10
|
+
* widget paints into the shared HUD host on `<html>` (top layer, shadow
|
|
11
|
+
* root). Attributes are live — `locale` repaints in place, `button` shows or
|
|
12
|
+
* hides the floating button, `open-selector` rebinds; a changed `key` or
|
|
13
|
+
* `base` remounts. The face is config (QA Studio D6): `face: 'recorder'`
|
|
14
|
+
* mounts the recorder pill instead (npm entry only — it needs React and a
|
|
15
|
+
* `vkr_` key or a device link). A linked vitrinka member also switches faces
|
|
16
|
+
* in place (vt-8020 D8, face.ts): the report menu's Record swaps in the pill
|
|
17
|
+
* on the device link, the pill's "Report a problem" swaps back, and the pick
|
|
18
|
+
* survives a reload (npm entry only, like `face: 'recorder'`). The host's
|
|
19
|
+
* openers — `open()` and `open-selector` — swap back too and open the card,
|
|
20
|
+
* except while the pill records or starts to.
|
|
21
|
+
*/
|
|
22
|
+
import { listen } from '../recorder/hud/listen';
|
|
23
|
+
import { memberLinked, pillRecording, rememberFace, startFace, watchMemberLink } from './face';
|
|
2
24
|
import { parseLocale } from './i18n';
|
|
3
|
-
import { ReportWidget } from './widget';
|
|
25
|
+
import { hitsOpener, ReportWidget } from './widget';
|
|
4
26
|
export const REPORT_TAG = 'vitrinka-report';
|
|
5
27
|
const ATTRS = ['key', 'base', 'open-selector', 'locale', 'button'];
|
|
6
28
|
function trimBase(raw) {
|
|
@@ -26,6 +48,10 @@ export function defineReportElement(faces) {
|
|
|
26
48
|
gen = 0;
|
|
27
49
|
/** The report widget currently offers Record. */
|
|
28
50
|
recordOffered = false;
|
|
51
|
+
/** The host's `open-selector` control while the pill shows (the report widget binds it otherwise). */
|
|
52
|
+
offPillOpener = null;
|
|
53
|
+
/** An open() refused on a recording pill has said why. */
|
|
54
|
+
warnedRecording = false;
|
|
29
55
|
offLink = null;
|
|
30
56
|
pendingIdentity = undefined;
|
|
31
57
|
get face() {
|
|
@@ -52,7 +78,7 @@ export function defineReportElement(faces) {
|
|
|
52
78
|
this.mount();
|
|
53
79
|
return;
|
|
54
80
|
}
|
|
55
|
-
// The rest are the report face's: the pill reads
|
|
81
|
+
// The rest are the report face's: the pill's opener reads `open-selector` per click, and a switch back reads them afresh.
|
|
56
82
|
if (!this.widget)
|
|
57
83
|
return;
|
|
58
84
|
if (name === 'locale')
|
|
@@ -63,7 +89,10 @@ export function defineReportElement(faces) {
|
|
|
63
89
|
this.widget.setOpenSelector(value);
|
|
64
90
|
}
|
|
65
91
|
open() {
|
|
66
|
-
this.
|
|
92
|
+
if (this.shown === 'recorder')
|
|
93
|
+
this.openFromPill();
|
|
94
|
+
else
|
|
95
|
+
this.widget?.open();
|
|
67
96
|
}
|
|
68
97
|
close() {
|
|
69
98
|
this.widget?.close();
|
|
@@ -105,6 +134,8 @@ export function defineReportElement(faces) {
|
|
|
105
134
|
this.widget?.unmount();
|
|
106
135
|
this.widget = null;
|
|
107
136
|
this.recordOffered = false;
|
|
137
|
+
this.offPillOpener?.();
|
|
138
|
+
this.offPillOpener = null;
|
|
108
139
|
this.pill?.();
|
|
109
140
|
this.pill = null;
|
|
110
141
|
}
|
|
@@ -116,6 +147,13 @@ export function defineReportElement(faces) {
|
|
|
116
147
|
const loadPill = faces.recorderFace;
|
|
117
148
|
if (face === 'recorder' && loadPill) {
|
|
118
149
|
this.shown = 'recorder';
|
|
150
|
+
// The widget that binds the host's control is down while the pill shows: the control still reaches the card.
|
|
151
|
+
this.offPillOpener = listen(document, 'click', (ev) => {
|
|
152
|
+
if (!hitsOpener(ev, this.getAttribute('open-selector')))
|
|
153
|
+
return;
|
|
154
|
+
ev.preventDefault();
|
|
155
|
+
this.open();
|
|
156
|
+
});
|
|
119
157
|
const gen = this.gen;
|
|
120
158
|
loadPill()
|
|
121
159
|
.then((mountPill) => {
|
|
@@ -161,6 +199,40 @@ export function defineReportElement(faces) {
|
|
|
161
199
|
this.recordOffered = offer;
|
|
162
200
|
this.widget.setRecordSwitch(offer ? () => this.switchTo('recorder') : null);
|
|
163
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* A host opener on the pill: back to Report a problem — remembered as the
|
|
204
|
+
* pill's own row does — and the card opens there. Deferred like switchTo,
|
|
205
|
+
* then decided on the face this mount shows by then (a remount — a new
|
|
206
|
+
* key or base, a reconnect — drops it), asked again right before the
|
|
207
|
+
* pill comes down: never while it records or a Start waits on its
|
|
208
|
+
* session, as leaving strands it.
|
|
209
|
+
*/
|
|
210
|
+
openFromPill() {
|
|
211
|
+
if (this.keepsPill())
|
|
212
|
+
return;
|
|
213
|
+
const at = this.at;
|
|
214
|
+
setTimeout(() => {
|
|
215
|
+
if (!at || this.at !== at)
|
|
216
|
+
return;
|
|
217
|
+
if (this.shown === 'recorder') {
|
|
218
|
+
if (this.keepsPill())
|
|
219
|
+
return;
|
|
220
|
+
rememberFace('report');
|
|
221
|
+
this.show('report');
|
|
222
|
+
}
|
|
223
|
+
this.widget?.open();
|
|
224
|
+
}, 0);
|
|
225
|
+
}
|
|
226
|
+
/** The pill is recording (or starting to): it stays, and the first refusal says why. */
|
|
227
|
+
keepsPill() {
|
|
228
|
+
if (!pillRecording())
|
|
229
|
+
return false;
|
|
230
|
+
if (!this.warnedRecording) {
|
|
231
|
+
console.warn('vitrinka: Report a problem stays closed while the recorder pill records — leaving would strand the session; stop the recording first');
|
|
232
|
+
}
|
|
233
|
+
this.warnedRecording = true;
|
|
234
|
+
return true;
|
|
235
|
+
}
|
|
164
236
|
/** The member's pick, remembered for this browser; applied once the menu that asked has let go of its click. */
|
|
165
237
|
switchTo(face) {
|
|
166
238
|
rememberFace(face);
|
package/build/report/face.d.ts
CHANGED
|
@@ -15,6 +15,13 @@ export declare const MODE_KEY = "vitrinka.report.mode";
|
|
|
15
15
|
export declare function rememberDisplayMode(mode: string | undefined): void;
|
|
16
16
|
/** The face a mount starts on: a member's last pick, else the pill for a dev-mode member; everyone else the report face. */
|
|
17
17
|
export declare function startFace(base: string): ReportFace;
|
|
18
|
+
/**
|
|
19
|
+
* The pill holds a recording — the session record its ⋯ menu reads, which
|
|
20
|
+
* offers "Report a problem" only while there is none (Menu.tsx) — or a Start
|
|
21
|
+
* still waiting on its session. Leaving the pill then would strand the
|
|
22
|
+
* session, so a host opener never switches away.
|
|
23
|
+
*/
|
|
24
|
+
export declare function pillRecording(): boolean;
|
|
18
25
|
/**
|
|
19
26
|
* Hear the stored link change: another tab's link or unlink (the storage
|
|
20
27
|
* event), or this document's (`storeLink` / `clearLink` notify). Returns the
|
package/build/report/face.js
CHANGED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { linkWorkspace } from '@vitrinka/link';
|
|
14
14
|
import { LINK_KEY, readLink } from '../recorder/config';
|
|
15
|
+
import { startInFlight } from '../recorder/lead';
|
|
16
|
+
import { getState } from '../recorder/queue';
|
|
15
17
|
import { subscribe } from '../recorder/state';
|
|
16
18
|
import { getRecorderStorage } from '../recorder/storage';
|
|
17
19
|
/** localStorage key of the face this browser last picked on this origin. */
|
|
@@ -77,6 +79,15 @@ export function startFace(base) {
|
|
|
77
79
|
return picked;
|
|
78
80
|
return store()?.getItem(MODE_KEY) === 'dev' ? 'recorder' : 'report';
|
|
79
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* The pill holds a recording — the session record its ⋯ menu reads, which
|
|
84
|
+
* offers "Report a problem" only while there is none (Menu.tsx) — or a Start
|
|
85
|
+
* still waiting on its session. Leaving the pill then would strand the
|
|
86
|
+
* session, so a host opener never switches away.
|
|
87
|
+
*/
|
|
88
|
+
export function pillRecording() {
|
|
89
|
+
return getState() !== null || startInFlight();
|
|
90
|
+
}
|
|
80
91
|
/**
|
|
81
92
|
* Hear the stored link change: another tab's link or unlink (the storage
|
|
82
93
|
* event), or this document's (`storeLink` / `clearLink` notify). Returns the
|
package/build/report/i18n.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* Marking is taught as "click, hold and move" — never "drag" (D21): a
|
|
8
8
|
* first-time reporter does not know the word.
|
|
9
9
|
*/
|
|
10
|
+
import type { MarkerShape } from './markers';
|
|
10
11
|
export type Locale = 'cs' | 'en';
|
|
11
12
|
export type ReportKind = 'bug' | 'suggestion' | 'question' | 'other';
|
|
12
13
|
export declare const REPORT_KINDS: readonly ReportKind[];
|
|
@@ -58,17 +59,24 @@ export interface Strings {
|
|
|
58
59
|
toolbar: string;
|
|
59
60
|
/** The marking bar's one plain line. */
|
|
60
61
|
barLead: string;
|
|
62
|
+
/** The bar's line while Cover is picked: what covering is for. */
|
|
63
|
+
barLeadHide: string;
|
|
61
64
|
/** Leaves marking and drops the marks of this pass (vt-8020 D12). */
|
|
62
65
|
cancelMarking: string;
|
|
63
66
|
discardMarks: (n: number) => string;
|
|
64
67
|
discard: string;
|
|
65
68
|
keep: string;
|
|
66
|
-
coach
|
|
69
|
+
/** The coach's line for the picked shape. */
|
|
70
|
+
coach: Record<MarkerShape, string>;
|
|
67
71
|
coachMore: string;
|
|
72
|
+
/** Turns the coach off for good on this browser; Settings turns it back on. */
|
|
73
|
+
coachDismiss: string;
|
|
74
|
+
coachSetting: string;
|
|
68
75
|
/** The marking layer's name, for assistive technology. */
|
|
69
76
|
marking: string;
|
|
70
|
-
/** How to mark from the keyboard
|
|
77
|
+
/** How to mark from the keyboard: the layer's description for assistive technology, never painted. */
|
|
71
78
|
keyboardHint: string;
|
|
79
|
+
/** Written on a placed cover. */
|
|
72
80
|
hidden: string;
|
|
73
81
|
notePlaceholder: string;
|
|
74
82
|
mark: (n: number) => string;
|
package/build/report/i18n.js
CHANGED
|
@@ -48,18 +48,26 @@ const en = {
|
|
|
48
48
|
sentBody: 'The team will take a look.',
|
|
49
49
|
sentNotify: 'We’ll email you when it’s fixed.',
|
|
50
50
|
seeReport: 'See your report',
|
|
51
|
-
tools: { circle: 'Circle', box: 'Box', arrow: 'Arrow', hide: '
|
|
51
|
+
tools: { circle: 'Circle', box: 'Box', arrow: 'Arrow', hide: 'Cover' },
|
|
52
52
|
toolbar: 'Marking tools',
|
|
53
53
|
barLead: 'Mark where the problem is',
|
|
54
|
+
barLeadHide: 'Cover what the team shouldn’t see',
|
|
54
55
|
cancelMarking: 'Cancel',
|
|
55
56
|
discardMarks: (n) => (n === 1 ? 'Discard 1 mark?' : `Discard ${n} marks?`),
|
|
56
57
|
discard: 'Discard',
|
|
57
58
|
keep: 'Keep',
|
|
58
|
-
coach:
|
|
59
|
+
coach: {
|
|
60
|
+
box: 'Click, hold and move across the problem.',
|
|
61
|
+
circle: 'Click, hold and move around the problem.',
|
|
62
|
+
arrow: 'Click, hold and move from a clear spot to the problem.',
|
|
63
|
+
hide: 'Click, hold and move across anything private — it stays blank in what you send.',
|
|
64
|
+
},
|
|
59
65
|
coachMore: 'You can mark more than one place.',
|
|
66
|
+
coachDismiss: 'Got it, don’t show again',
|
|
67
|
+
coachSetting: 'Marking tips',
|
|
60
68
|
marking: 'Marking',
|
|
61
69
|
keyboardHint: 'Keyboard: Enter to start, arrows to move, Shift+arrows to resize, Enter to place.',
|
|
62
|
-
hidden: '
|
|
70
|
+
hidden: 'Covered — not sent',
|
|
63
71
|
notePlaceholder: 'Add a note (optional)',
|
|
64
72
|
mark: (n) => `Mark ${n}`,
|
|
65
73
|
removeMark: (n) => `Remove mark ${n}`,
|
|
@@ -169,18 +177,26 @@ const cs = {
|
|
|
169
177
|
sentBody: 'Tým se na to podívá.',
|
|
170
178
|
sentNotify: 'Až to bude opravené, pošleme vám e-mail.',
|
|
171
179
|
seeReport: 'Zobrazit hlášení',
|
|
172
|
-
tools: { circle: 'Kruh', box: 'Obdélník', arrow: 'Šipka', hide: '
|
|
180
|
+
tools: { circle: 'Kruh', box: 'Obdélník', arrow: 'Šipka', hide: 'Zakrýt' },
|
|
173
181
|
toolbar: 'Nástroje pro označení',
|
|
174
182
|
barLead: 'Označte, kde je problém',
|
|
183
|
+
barLeadHide: 'Zakryjte, co tým nemá vidět',
|
|
175
184
|
cancelMarking: 'Zrušit',
|
|
176
185
|
discardMarks: (n) => csPlural(n, 'Zahodit 1 značku?', `Zahodit ${n} značky?`, `Zahodit ${n} značek?`),
|
|
177
186
|
discard: 'Zahodit',
|
|
178
187
|
keep: 'Ponechat',
|
|
179
|
-
coach:
|
|
188
|
+
coach: {
|
|
189
|
+
box: 'Klikněte, podržte a veďte přes problém.',
|
|
190
|
+
circle: 'Klikněte, podržte a veďte kolem problému.',
|
|
191
|
+
arrow: 'Klikněte, podržte a veďte z volného místa k problému.',
|
|
192
|
+
hide: 'Klikněte, podržte a veďte přes vše soukromé — v hlášení zůstane prázdné.',
|
|
193
|
+
},
|
|
180
194
|
coachMore: 'Označit můžete i více míst.',
|
|
195
|
+
coachDismiss: 'Chápu, už nezobrazovat',
|
|
196
|
+
coachSetting: 'Nápověda při označování',
|
|
181
197
|
marking: 'Označování',
|
|
182
198
|
keyboardHint: 'Klávesnice: Enter začne, šipky posouvají, Shift+šipky mění velikost, Enter umístí.',
|
|
183
|
-
hidden: '
|
|
199
|
+
hidden: 'Zakryto — neodešle se',
|
|
184
200
|
notePlaceholder: 'Přidejte poznámku (nepovinné)',
|
|
185
201
|
mark: (n) => `Značka ${n}`,
|
|
186
202
|
removeMark: (n) => `Odebrat značku ${n}`,
|
|
@@ -23,6 +23,14 @@ export declare function matchesKeybind(e: KeyPress, b: Keybind): boolean;
|
|
|
23
23
|
export declare function isMacPlatform(): boolean;
|
|
24
24
|
/** ⌃⌥⇧⌘R on a Mac, Ctrl+Alt+Shift+R elsewhere. */
|
|
25
25
|
export declare function keybindLabel(b: Keybind, mac?: boolean): string;
|
|
26
|
+
/**
|
|
27
|
+
* ⌥⇧A on a Mac, Shift+Alt+A elsewhere (vt-8020): the recorder pill's annotate
|
|
28
|
+
* chord, so "flag it here" is one key in either face — one face is on screen at
|
|
29
|
+
* a time. A Mac's ⌥ turns the A into Å, which is why matching reads `code`.
|
|
30
|
+
*/
|
|
31
|
+
export declare const DEFAULT_KEYBIND: Keybind;
|
|
32
|
+
/** The stored value as the shortcut in force: absent (or unreadable) → the default, `off` → none. */
|
|
33
|
+
export declare function resolveKeybind(raw: string | null | undefined): Keybind | null;
|
|
26
34
|
export declare function loadKeybind(): Keybind | null;
|
|
27
35
|
export declare function saveKeybind(b: Keybind | null): void;
|
|
28
36
|
/** Hear another tab change the shortcut; returns the unsubscribe. */
|
package/build/report/keybind.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The reporter's own shortcut for Report a problem (QA Studio assumptions:
|
|
3
|
-
* the snap HotKeyRecorder rules).
|
|
4
|
-
*
|
|
3
|
+
* the snap HotKeyRecorder rules). It starts as DEFAULT_KEYBIND; the person
|
|
4
|
+
* records another in the widget's settings by pressing it, or removes it. The next key pressed with a
|
|
5
5
|
* modifier becomes the shortcut; Esc on its own cancels; a bare key is
|
|
6
6
|
* refused with the reason — and so is Shift alone, which in a browser types
|
|
7
7
|
* capitals. Matched by physical key (`code`: ⌥ rewrites `key` on a Mac).
|
|
@@ -82,18 +82,28 @@ function parseKeybind(raw) {
|
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* ⌥⇧A on a Mac, Shift+Alt+A elsewhere (vt-8020): the recorder pill's annotate
|
|
87
|
+
* chord, so "flag it here" is one key in either face — one face is on screen at
|
|
88
|
+
* a time. A Mac's ⌥ turns the A into Å, which is why matching reads `code`.
|
|
89
|
+
*/
|
|
90
|
+
export const DEFAULT_KEYBIND = { code: 'KeyA', alt: true, ctrl: false, meta: false, shift: true };
|
|
91
|
+
/** Stored when the person removes the shortcut: an absent key means the default, so "none" needs a value of its own. */
|
|
92
|
+
const KEYBIND_OFF = 'off';
|
|
93
|
+
/** The stored value as the shortcut in force: absent (or unreadable) → the default, `off` → none. */
|
|
94
|
+
export function resolveKeybind(raw) {
|
|
95
|
+
if (raw === KEYBIND_OFF)
|
|
96
|
+
return null;
|
|
97
|
+
return parseKeybind(raw) ?? DEFAULT_KEYBIND;
|
|
98
|
+
}
|
|
85
99
|
export function loadKeybind() {
|
|
86
|
-
return
|
|
100
|
+
return resolveKeybind(getRecorderStorage().getString(KEYBIND_STORAGE_KEY));
|
|
87
101
|
}
|
|
88
102
|
export function saveKeybind(b) {
|
|
89
|
-
|
|
90
|
-
if (b)
|
|
91
|
-
s.set(KEYBIND_STORAGE_KEY, JSON.stringify(b));
|
|
92
|
-
else
|
|
93
|
-
s.remove(KEYBIND_STORAGE_KEY);
|
|
103
|
+
getRecorderStorage().set(KEYBIND_STORAGE_KEY, b ? JSON.stringify(b) : KEYBIND_OFF);
|
|
94
104
|
}
|
|
95
105
|
/** Hear another tab change the shortcut; returns the unsubscribe. */
|
|
96
106
|
export function watchKeybind(on) {
|
|
97
107
|
const s = getRecorderStorage();
|
|
98
|
-
return s.watch ? s.watch(KEYBIND_STORAGE_KEY, (v) => on(
|
|
108
|
+
return s.watch ? s.watch(KEYBIND_STORAGE_KEY, (v) => on(resolveKeybind(v))) : () => undefined;
|
|
99
109
|
}
|
package/build/report/place.d.ts
CHANGED
|
@@ -24,3 +24,14 @@ export interface Frame {
|
|
|
24
24
|
export declare function cornerRect(c: Corner, f: Frame): Rect;
|
|
25
25
|
/** The corner the card should be in: `current` while it covers no mark, else the least-covering one. */
|
|
26
26
|
export declare function pickCorner(current: Corner, marks: readonly Rect[], f: Frame): Corner;
|
|
27
|
+
/** Where the marking coach rides on the card (vt-8020): never over the page it teaches about. */
|
|
28
|
+
export type CoachSide = 'above' | 'below' | 'left' | 'right' | 'over';
|
|
29
|
+
/**
|
|
30
|
+
* The card's edge that faces the open page: above a card in a bottom corner, below one in a top
|
|
31
|
+
* corner; when the viewport has no room there, beside it towards the middle; when there is none
|
|
32
|
+
* either (a phone), over the card's top. `coach` is its painted size, `gap` the space kept to the card.
|
|
33
|
+
*/
|
|
34
|
+
export declare function coachSide(corner: Corner, f: Frame, coach: {
|
|
35
|
+
w: number;
|
|
36
|
+
h: number;
|
|
37
|
+
}, gap: number): CoachSide;
|
package/build/report/place.js
CHANGED
|
@@ -31,3 +31,17 @@ export function pickCorner(current, marks, f) {
|
|
|
31
31
|
}
|
|
32
32
|
return best;
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* The card's edge that faces the open page: above a card in a bottom corner, below one in a top
|
|
36
|
+
* corner; when the viewport has no room there, beside it towards the middle; when there is none
|
|
37
|
+
* either (a phone), over the card's top. `coach` is its painted size, `gap` the space kept to the card.
|
|
38
|
+
*/
|
|
39
|
+
export function coachSide(corner, f, coach, gap) {
|
|
40
|
+
const atBottom = corner === 'br' || corner === 'bl';
|
|
41
|
+
const room = f.vh - f.top - f.h - f.bottom;
|
|
42
|
+
if (room >= coach.h + gap)
|
|
43
|
+
return atBottom ? 'above' : 'below';
|
|
44
|
+
if (f.vw - 2 * f.edge - f.w >= coach.w + gap)
|
|
45
|
+
return corner === 'br' || corner === 'tr' ? 'left' : 'right';
|
|
46
|
+
return 'over';
|
|
47
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The reporter's own settings beyond the shortcut (vt-8020 D9): the widget's
|
|
3
|
-
* size and the technical details a support conversation asks for. Each
|
|
3
|
+
* size, the marking tips and the technical details a support conversation asks for. Each
|
|
4
4
|
* setting is one localStorage key of this origin — the reporter's, on this
|
|
5
5
|
* browser, never sent anywhere.
|
|
6
6
|
*
|
|
@@ -18,6 +18,12 @@ export declare const SIZE_KEY = "vitrinka.report.size";
|
|
|
18
18
|
export declare function readPref(key: string): string | null;
|
|
19
19
|
export declare function writePref(key: string, value: string): void;
|
|
20
20
|
export declare function readSize(): WidgetSize;
|
|
21
|
+
/**
|
|
22
|
+
* The marking tips above the card (vt-8020): on until the person presses
|
|
23
|
+
* "Got it, don't show again", and Settings turns them back on.
|
|
24
|
+
*/
|
|
25
|
+
export declare const COACH_KEY = "vitrinka.report.coach";
|
|
26
|
+
export declare function readCoach(): boolean;
|
|
21
27
|
export interface TechInput {
|
|
22
28
|
/** The package version (recorder/version.ts). */
|
|
23
29
|
version: string;
|
package/build/report/settings.js
CHANGED
|
@@ -26,6 +26,14 @@ export function readSize() {
|
|
|
26
26
|
const v = readPref(SIZE_KEY);
|
|
27
27
|
return SIZES.find((s) => s === v) ?? 'md';
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* The marking tips above the card (vt-8020): on until the person presses
|
|
31
|
+
* "Got it, don't show again", and Settings turns them back on.
|
|
32
|
+
*/
|
|
33
|
+
export const COACH_KEY = 'vitrinka.report.coach';
|
|
34
|
+
export function readCoach() {
|
|
35
|
+
return readPref(COACH_KEY) !== 'off';
|
|
36
|
+
}
|
|
29
37
|
/** The read-only technical details, label → value: version, capture window, capture, buffer, server. */
|
|
30
38
|
export function techDetails(t, s) {
|
|
31
39
|
const c = t.config;
|