@designfever/web-review-kit 0.3.0 → 0.4.1

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.
@@ -6,7 +6,7 @@ type ReviewMode = 'idle' | 'note' | 'element' | 'area';
6
6
  type ReviewSource = 'local' | 'supabase' | (string & {});
7
7
  type ReviewSubmitStatus = 'idle' | 'submitting' | 'submitted' | 'failed';
8
8
  type ReviewViewportScope = Exclude<ReviewItemScope, 'dom'>;
9
- type DomAnchorStrategy = 'configured-attribute' | 'id' | 'class' | 'dom-path';
9
+ type DomAnchorStrategy = 'configured-attribute' | 'attribute' | 'id' | 'class' | 'dom-path';
10
10
  interface ReviewRulerConfig {
11
11
  enabled?: boolean;
12
12
  unit?: string;
@@ -119,6 +119,8 @@ interface ReviewViewportPreset {
119
119
  width: number;
120
120
  height: number;
121
121
  scope?: Exclude<ReviewItemScope, 'dom'>;
122
+ designWidth?: number;
123
+ designHeight?: number;
122
124
  }
123
125
  interface NumberedReviewItem {
124
126
  item: ReviewItem;
@@ -132,6 +134,7 @@ interface WebReviewKitOptions {
132
134
  userId?: string;
133
135
  adapter?: WebReviewKitAdapter;
134
136
  target?: WebReviewKitTarget | (() => WebReviewKitTarget | undefined);
137
+ adjustmentLabel?: string;
135
138
  viewports?: {
136
139
  presets?: ReviewViewportPreset[];
137
140
  };
@@ -6,7 +6,7 @@ type ReviewMode = 'idle' | 'note' | 'element' | 'area';
6
6
  type ReviewSource = 'local' | 'supabase' | (string & {});
7
7
  type ReviewSubmitStatus = 'idle' | 'submitting' | 'submitted' | 'failed';
8
8
  type ReviewViewportScope = Exclude<ReviewItemScope, 'dom'>;
9
- type DomAnchorStrategy = 'configured-attribute' | 'id' | 'class' | 'dom-path';
9
+ type DomAnchorStrategy = 'configured-attribute' | 'attribute' | 'id' | 'class' | 'dom-path';
10
10
  interface ReviewRulerConfig {
11
11
  enabled?: boolean;
12
12
  unit?: string;
@@ -119,6 +119,8 @@ interface ReviewViewportPreset {
119
119
  width: number;
120
120
  height: number;
121
121
  scope?: Exclude<ReviewItemScope, 'dom'>;
122
+ designWidth?: number;
123
+ designHeight?: number;
122
124
  }
123
125
  interface NumberedReviewItem {
124
126
  item: ReviewItem;
@@ -132,6 +134,7 @@ interface WebReviewKitOptions {
132
134
  userId?: string;
133
135
  adapter?: WebReviewKitAdapter;
134
136
  target?: WebReviewKitTarget | (() => WebReviewKitTarget | undefined);
137
+ adjustmentLabel?: string;
135
138
  viewports?: {
136
139
  presets?: ReviewViewportPreset[];
137
140
  };
@@ -98,6 +98,7 @@ export function createRemoteReviewAdapter(
98
98
  * label becomes the URL source, for example /review?source=remote.
99
99
  * create controls whether the shell can write to this adapter.
100
100
  * canWrite can be true or limited to ['dom', 'note', 'area'].
101
+ * update enables comment edits in the QA panel.
101
102
  * updateStatus drives the status buttons in the QA panel.
102
103
  * remove enables delete actions for this source.
103
104
  */
@@ -111,6 +112,7 @@ export function createRemoteReviewShellAdapter(
111
112
  get: (id) => adapter.get(id),
112
113
  list: (query) => adapter.list(query),
113
114
  create: (item) => adapter.create(item),
115
+ update: (id, patch) => adapter.update(id, patch),
114
116
  canWrite: true,
115
117
  statusOptions: REVIEW_WORKFLOW_STATUS_OPTIONS,
116
118
  updateStatus: ({ id, status }) =>
@@ -61,8 +61,11 @@ Persisted review data uses target-space viewport values plus optional anchor-rel
61
61
  When a user creates a DOM or area item, core tries to capture:
62
62
 
63
63
  - an explicit configured anchor such as `data-qa-id`
64
+ - common test/section attributes such as `data-testid`, `data-cy`, or `data-section-id`
64
65
  - a meaningful `id`
66
+ - semantic attributes such as `aria-label`, `title`, `name`, or `href`
65
67
  - a meaningful class
68
+ - a scoped DOM path from the nearest stable ancestor
66
69
  - a DOM path fallback
67
70
  - a short text fingerprint
68
71
 
@@ -64,6 +64,7 @@ mountReviewShell({
64
64
  get: (id) => local.get(id),
65
65
  list: (query) => local.list(query),
66
66
  create: (item) => local.create(item),
67
+ update: (id, patch) => local.update(id, patch),
67
68
  statusOptions: REVIEW_WORKFLOW_STATUS_OPTIONS,
68
69
  updateStatus: ({ id, status }) => local.update(id, { status }),
69
70
  syncSubmission: ({ id, patch }) => local.update(id, patch),
@@ -74,6 +75,22 @@ mountReviewShell({
74
75
  });
75
76
  ```
76
77
 
78
+ ## Adjustment Label
79
+
80
+ DOM adjust mode appends adjustment metrics to the saved QA comment. Use `adjustmentLabel` when a host project wants that prompt line to match its own responsive CSS workflow.
81
+
82
+ ```tsx
83
+ mountReviewShell({
84
+ projectId: REVIEW_PROJECT_ID,
85
+ pages,
86
+ adapters,
87
+ adjustmentLabel: 'Responsive CSS px adjustments',
88
+ reviewPathPrefix: REVIEW_PATH_PREFIX,
89
+ });
90
+ ```
91
+
92
+ If omitted, the default label is `Responsive CSS px adjustments`. This option only changes the label before the generated `x`, `y`, and `scale` values.
93
+
77
94
  ## Supabase Adapter
78
95
 
79
96
  Host projects that choose Supabase create the client themselves and pass it into the package adapter.
@@ -124,6 +141,7 @@ const adapters = [
124
141
  get: (id) => local.get(id),
125
142
  list: (query) => local.list(query),
126
143
  create: (item) => local.create(item),
144
+ update: (id, patch) => local.update(id, patch),
127
145
  statusOptions: REVIEW_WORKFLOW_STATUS_OPTIONS,
128
146
  updateStatus: ({ id, status }) => local.update(id, { status }),
129
147
  syncSubmission: ({ id, patch }) => local.update(id, patch),
@@ -136,6 +154,7 @@ const adapters = [
136
154
  get: (id) => remote.get(id),
137
155
  list: (query) => remote.list(query),
138
156
  create: (item) => remote.create(item),
157
+ update: (id, patch) => remote.update(id, patch),
139
158
  statusOptions: REVIEW_WORKFLOW_STATUS_OPTIONS,
140
159
  updateStatus: ({ id, status }) => remote.update(id, { status }),
141
160
  remove: (id) => remote.remove(id),
@@ -189,7 +208,7 @@ export default defineConfig({
189
208
  });
190
209
  ```
191
210
 
192
- Captured DOM nodes will include `data-wrk-source-file`, `data-wrk-source-line`, and `data-wrk-source-column`. In the review shell, `Option` + click inside the target iframe opens that source in VS Code. If the file path is absolute, it opens directly. If the plugin stores relative paths, pass `sourceRoot` when mounting the shell.
211
+ Captured DOM nodes will include `data-wrk-source-file`, `data-wrk-source-line`, and `data-wrk-source-column`. In the review shell, hold `Option` over the target iframe to show source candidates from the DOM ancestry. Click the target to pin the candidate list, then choose which file to open. If the file path is absolute, it opens directly. If the plugin stores relative paths, pass `sourceRoot` when mounting the shell.
193
212
 
194
213
  ```tsx
195
214
  mountReviewShell({
@@ -198,9 +217,15 @@ mountReviewShell({
198
217
  adapters,
199
218
  reviewPathPrefix: REVIEW_PATH_PREFIX,
200
219
  sourceRoot: import.meta.env.VITE_REVIEW_SOURCE_ROOT,
220
+ sourceInspector: {
221
+ editor: 'vscode', // 'vscode' | 'cursor' | 'webstorm' | 'custom'
222
+ // urlTemplate: 'my-editor://open?file={encodedPath}&line={line}&column={column}',
223
+ },
201
224
  });
202
225
  ```
203
226
 
227
+ Set `sourceInspector.enabled` to `false` when source code opening should be unavailable. The `data-font` overlay still belongs to the target project markup and is not required for source opening.
228
+
204
229
  Use this only in dev/review builds. Source paths are written into the browser DOM and can be persisted with QA items.
205
230
 
206
231
  ## Custom Adapter
@@ -0,0 +1,94 @@
1
+ # 릴리즈 노트: 0.3.0
2
+
3
+ 0.2.0 mainline merge 이후 변경 사항 정리.
4
+
5
+ 비교 기준: `49f2665` (`Merge pull request #7 ... feat: release web review kit 0.2.0`)
6
+ 검토 기준 HEAD: `a82b204` (`release: 0.3.0`)
7
+
8
+ ## 주요 변경
9
+
10
+ - 개발용 Vite source locator export `@designfever/web-review-kit/vite`를 추가했다.
11
+ - DOM 리뷰 대상에 source file hint를 주입하고, 리뷰 shell에서 VS Code로 바로 여는 동작을 추가했다.
12
+ - QA item card에서 comment를 수정할 수 있게 했다.
13
+ - ruler 가독성, 측정 label, light theme 대비를 개선했다.
14
+ - `data-font`를 가진 요소에 source-select font hint overlay를 표시한다.
15
+ - 입력 필드에서 글을 쓰는 중 review hotkey가 실행되지 않도록 수정했다.
16
+
17
+ ## 추가
18
+
19
+ ### 리뷰 대상 Source Locator
20
+
21
+ Host project가 Vite에서 `reviewSourceLocator()`를 선택적으로 사용할 수 있다. 이 plugin은 React dev JSX runtime을 감싸서 렌더링된 DOM node에 source attribute를 주입한다.
22
+
23
+ - `data-wrk-source-file`
24
+ - `data-wrk-source-line`
25
+ - `data-wrk-source-column`
26
+
27
+ Source hint가 있으면 review shell에서 해당 source 위치를 VS Code로 열 수 있다. 절대 경로 source path와 `sourceRoot` 기준 상대 경로를 모두 지원한다.
28
+
29
+ Public package 변경:
30
+
31
+ - `./vite` package export 추가
32
+ - `src/vite.ts` 추가
33
+ - `ReviewShellProps`에 optional `sourceRoot` 추가
34
+ - `DomSourceHint`에 `line`, `column` 추가
35
+
36
+ ### Review Shell Source Action
37
+
38
+ Review shell에서 다음 동작을 지원한다.
39
+
40
+ - Target iframe 안에서 `Option` + click으로 클릭한 source hint 열기
41
+ - Option key 활성화 중 source hover 표시
42
+ - `data-font` metadata가 있는 요소의 source-select font hint overlay 표시
43
+ - 저장된 source hint가 있는 QA card에 source open action 표시
44
+ - Source hint가 없거나 source root가 필요한 경우 toast feedback 표시
45
+
46
+ ### QA Comment 수정
47
+
48
+ Active adapter가 update를 지원하면 QA item card에 edit action을 표시한다. Edit modal은 빈 comment를 막고, active adapter로 저장한 뒤 review data를 새로고침하고 toast feedback을 보여준다.
49
+
50
+ Adapter normalization에 `canUpdate`를 추가해서 read-only source에서는 edit action을 숨길 수 있게 했다.
51
+
52
+ ## 변경
53
+
54
+ ### Ruler UI
55
+
56
+ - 측정 label을 Figma 전용 문구가 아니라 중립적인 `width x height unit` 형식으로 바꿨다.
57
+ - Dark/light theme 모두에서 ruler label, coordinate chip, guide line, popover 가독성을 개선했다.
58
+ - 후속 fix에서 light theme ruler 대비를 한 번 더 개선했다.
59
+
60
+ ### Review Shell Workflow
61
+
62
+ - QA item list 정렬 기준을 `updatedAt`에서 `createdAt`으로 바꿨다. 이제 기존 item을 수정해도 목록 최상단으로 튀지 않는다.
63
+ - Supabase list ordering도 remote source에서 같은 동작을 하도록 `created_at` 기준으로 바꿨다.
64
+ - Quick add toolbar는 DOM element capture와 area capture 중심으로 정리했다.
65
+ - Edit comment modal은 settings modal의 visual system을 재사용한다.
66
+
67
+ ### Prompt Context
68
+
69
+ DOM source hint가 있으면 review item prompt에 source line context를 포함한다.
70
+
71
+ ## 수정
72
+
73
+ - Focus가 `input`, `textarea`, `select`, `contenteditable` 안에 있을 때 review hotkey를 무시한다.
74
+ - DOM source 추출이 새 `data-wrk-source-*` attribute와 기존 `data-file` / `data-component` 계열 attribute를 모두 읽도록 했다.
75
+
76
+ ## 문서
77
+
78
+ - README에 public import `@designfever/web-review-kit/vite`를 문서화했다.
79
+ - Installation docs에 source locator 설정, `sourceRoot`, source path가 DOM에 기록되는 dev/review build 주의사항을 추가했다.
80
+
81
+ ## 검증
82
+
83
+ 검토한 main branch 기준으로 아래 명령을 확인했다.
84
+
85
+ - `pnpm typecheck`
86
+ - `pnpm typecheck:dev`
87
+ - `pnpm build`
88
+ - `pnpm build:dev`
89
+
90
+ ## 메모
91
+
92
+ - `package.json` version은 `0.3.0`이다.
93
+ - `0.3.0` release commit은 `a82b204`다.
94
+ - 이 노트를 작성한 시점에는 local/remote 모두 `0.3.0` git tag가 없었다.
@@ -0,0 +1,144 @@
1
+ # 릴리즈 노트: 0.4.0
2
+
3
+ 0.3.0 release 이후 변경 사항 정리.
4
+
5
+ 비교 기준: `a82b204` (`release: 0.3.0`)
6
+ 검토 기준: `0.4.0` release commit
7
+
8
+ ## 주요 변경
9
+
10
+ - Source inspector를 단일 source open에서 후보 선택형 inspector로 확장했다.
11
+ - DOM anchor 후보를 더 많이 수집하고, 클릭한 실제 DOM element를 우선 anchor로 사용하도록 개선했다.
12
+ - Sitemap을 QA 현황판처럼 쓸 수 있게 remaining, review, hold, online 기준 집계와 정렬을 추가했다.
13
+ - 전체 QA 보기와 review link restore 흐름을 정리했다.
14
+ - DOM/area draft composer를 draggable workflow로 바꾸고, DOM 위치 보정 모드를 추가했다.
15
+ - QA panel에 status filter를 추가하고, status select chevron과 spacing을 정리했다.
16
+ - Presence 표시를 QA list에서 분리해 상단 toolbar 아래 별도 row로 옮겼다.
17
+
18
+ ## 추가
19
+
20
+ ### Source Inspector
21
+
22
+ Review target에서 `Option`을 누른 상태로 hover하면 DOM ancestry에서 source 후보를 수집해 outline으로 표시한다. 클릭하면 후보 list가 고정되고, 사용자가 열 source를 직접 고를 수 있다.
23
+
24
+ Source open 옵션을 확장했다.
25
+
26
+ - `sourceInspector.editor`: `vscode`, `cursor`, `webstorm`, `custom`
27
+ - `sourceInspector.urlTemplate`: custom editor URL template
28
+ - 후보별 line/column confidence에 따라 위치 포함 여부 결정
29
+ - `sourceRoot` 기준 relative path resolve 유지
30
+
31
+ 문서도 `Option + click` 단일 동작 설명에서 후보 선택형 flow로 갱신했다.
32
+
33
+ ### Figma Frame Link
34
+
35
+ Target iframe이 `window.__figma`에 frame config를 제공하면 review frame 옆에 Figma frame link를 표시한다.
36
+
37
+ - `desktopNodeId`
38
+ - `mobileNodeId`
39
+ - viewport preset 종류에 맞는 frame URL 선택
40
+
41
+ Target page 새 창 열기 action도 같은 link stack에 배치했다.
42
+
43
+ ### Sitemap QA Overview
44
+
45
+ Sitemap modal에 페이지별 QA 현황 집계를 추가했다.
46
+
47
+ - remaining total
48
+ - review count
49
+ - hold count
50
+ - online users
51
+ - All QA summary row
52
+ - page, total, review, hold, online 기준 정렬
53
+
54
+ Folder/group row는 하위 page의 QA count와 online user를 합산해서 보여준다.
55
+
56
+ ### 전체 QA 보기
57
+
58
+ Sitemap에서 All QA row를 선택하면 현재 page에 묶이지 않은 전체 QA list를 볼 수 있다. QA panel title도 All pages 상태를 구분해서 표시한다.
59
+
60
+ ### QA Item Link Copy
61
+
62
+ QA item card에서 개별 review item link를 복사할 수 있게 했다. 복사한 link를 target input에 붙여넣으면 source, viewport, item id를 해석해 해당 item으로 복원한다.
63
+
64
+ ## 변경
65
+
66
+ ### DOM Anchor
67
+
68
+ Anchor 후보 수집 우선순위를 개선했다.
69
+
70
+ - 클릭한 실제 target element 우선
71
+ - `data-testid`, `data-cy`, `data-section-id`, `data-component` 계열 attribute 지원
72
+ - `aria-label`, `title`, `name`, `href` 같은 semantic attribute 지원
73
+ - 안정적인 ancestor 기준 scoped DOM path 추가
74
+ - full DOM path는 fallback confidence로 낮춤
75
+
76
+ 이 변경으로 nested component나 반복 section 안에서 DOM item 복원 안정성이 좋아졌다.
77
+
78
+ ### Draft Composer
79
+
80
+ DOM/area draft composer workflow를 조정했다.
81
+
82
+ - composer drag handle 추가
83
+ - composer를 shell 밖 클릭으로 cancel 가능
84
+ - 선택 영역 옆에 composer 배치
85
+ - composer drag 중 shell z-index와 pointer handling 정리
86
+ - composer metric, spacing, action layout 통일
87
+
88
+ ### DOM 위치 보정 모드
89
+
90
+ DOM review composer에 위치 보정 mode를 추가했다.
91
+
92
+ - DOM nudge adjustment
93
+ - scale key 조정
94
+ - adjustment HUD 표시
95
+ - toggle icon을 SVG 기반으로 정리
96
+
97
+ ### QA Panel
98
+
99
+ QA list header에 status filter를 추가했다.
100
+
101
+ - All status / Todo / Doing / Review / Hold / Done 필터
102
+ - status별 count 표시
103
+ - remaining count와 active item count를 함께 표시
104
+ - QA source select와 status select chevron spacing 통일
105
+
106
+ ### Presence
107
+
108
+ Page presence 표시를 QA list header에서 제거했다. 대신 상단 toolbar 아래 별도 row에 chip으로 표시한다.
109
+
110
+ - 기본은 첫 사용자 + `+N` 접힘 표시
111
+ - `+N` 클릭 시 전체 사용자 펼침
112
+ - iframe/device 내부에 겹치지 않도록 review shell row에 배치
113
+
114
+ ## 수정
115
+
116
+ - 초기 review link restore timing을 안정화했다.
117
+ - 붙여넣은 review link에서 target, source, viewport, item id를 해석하도록 수정했다.
118
+ - QA card action layout과 restore timing을 정리했다.
119
+ - Status select chevron이 status별 background style에 덮이는 문제를 수정했다.
120
+ - MO preset design width ratio를 390 기준으로 조정했다.
121
+ - Sitemap count column 구조와 typography를 정리했다.
122
+
123
+ ## 문서
124
+
125
+ - README에 `sourceInspector` mount option 예시를 추가했다.
126
+ - Installation docs에 source inspector 후보 선택 flow와 editor option을 추가했다.
127
+ - Architecture docs에 anchor 후보 수집 전략을 보강했다.
128
+
129
+ ## 검증
130
+
131
+ 검토한 main branch 기준으로 아래 명령을 확인했다.
132
+
133
+ - `pnpm typecheck`
134
+ - `pnpm typecheck:dev`
135
+ - `pnpm build`
136
+ - `pnpm build:dev`
137
+ - `git diff --check`
138
+ - Puppeteer smoke checks for QA status select, presence row, and expand/collapse behavior
139
+
140
+ ## 메모
141
+
142
+ - 이 노트는 0.4.0 publishing 전 검토용이다.
143
+ - `package.json` version은 `0.4.0`이다.
144
+ - npm publish 전에는 registry login 상태를 확인해야 한다.
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@designfever/web-review-kit",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "description": "Designfever web page review overlay toolkit.",
6
- "license": "UNLICENSED",
6
+ "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/Designfever/df-web-review-kit.git"