reviw 0.11.0 → 0.11.3

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.
Files changed (2) hide show
  1. package/cli.cjs +151 -0
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -1180,6 +1180,21 @@ function diffHtmlTemplate(diffData) {
1180
1180
  .modal-actions button:hover { background: var(--border); }
1181
1181
  .modal-actions button.primary { background: var(--accent); color: var(--text-inverse); border-color: var(--accent); }
1182
1182
 
1183
+ .modal-checkboxes { margin: 12px 0; }
1184
+ .modal-checkboxes label {
1185
+ display: flex;
1186
+ align-items: flex-start;
1187
+ gap: 8px;
1188
+ font-size: 12px;
1189
+ color: var(--text);
1190
+ margin-bottom: 8px;
1191
+ cursor: pointer;
1192
+ }
1193
+ .modal-checkboxes input[type="checkbox"] {
1194
+ margin-top: 2px;
1195
+ accent-color: var(--accent);
1196
+ }
1197
+
1183
1198
  .no-diff {
1184
1199
  text-align: center;
1185
1200
  padding: 60px 20px;
@@ -1234,6 +1249,12 @@ function diffHtmlTemplate(diffData) {
1234
1249
  <p class="modal-summary" id="modal-summary"></p>
1235
1250
  <label for="global-comment">Overall comment (optional)</label>
1236
1251
  <textarea id="global-comment" placeholder="Add a summary or overall feedback..."></textarea>
1252
+ <div class="modal-checkboxes">
1253
+ <label><input type="checkbox" id="prompt-subagents" checked /> All implementation, verification, and report creation will be done by the sub-agents.</label>
1254
+ <label><input type="checkbox" id="prompt-reviw" checked /> Open in REVIW next time.</label>
1255
+ <label><input type="checkbox" id="prompt-screenshots" checked /> Update all screenshots and videos.</label>
1256
+ <label><input type="checkbox" id="prompt-user-feedback-todo" checked /> Add the user's feedback to the Todo list, and do not check it off without the user's approval.</label>
1257
+ </div>
1237
1258
  <div class="modal-actions">
1238
1259
  <button id="modal-cancel">Cancel</button>
1239
1260
  <button class="primary" id="modal-submit">Submit</button>
@@ -1602,9 +1623,62 @@ function diffHtmlTemplate(diffData) {
1602
1623
  const modalSummary = document.getElementById('modal-summary');
1603
1624
  const globalCommentInput = document.getElementById('global-comment');
1604
1625
 
1626
+ // Prompt checkboxes
1627
+ const promptCheckboxes = [
1628
+ { id: 'prompt-subagents', text: 'All implementation, verification, and report creation will be done by the sub-agents.' },
1629
+ { id: 'prompt-reviw', text: 'Open in REVIW next time.' },
1630
+ { id: 'prompt-screenshots', text: 'Update all screenshots and videos.' },
1631
+ { id: 'prompt-user-feedback-todo', text: "Add the user's feedback to the Todo list, and do not check it off without the user's approval." }
1632
+ ];
1633
+ const PROMPT_STORAGE_KEY = 'reviw-prompt-prefs';
1634
+
1635
+ // Load saved preferences
1636
+ function loadPromptPrefs() {
1637
+ try {
1638
+ const saved = localStorage.getItem(PROMPT_STORAGE_KEY);
1639
+ if (saved) {
1640
+ const prefs = JSON.parse(saved);
1641
+ promptCheckboxes.forEach(p => {
1642
+ const el = document.getElementById(p.id);
1643
+ if (el && typeof prefs[p.id] === 'boolean') el.checked = prefs[p.id];
1644
+ });
1645
+ }
1646
+ } catch (e) {}
1647
+ }
1648
+
1649
+ // Save preferences
1650
+ function savePromptPrefs() {
1651
+ try {
1652
+ const prefs = {};
1653
+ promptCheckboxes.forEach(p => {
1654
+ const el = document.getElementById(p.id);
1655
+ if (el) prefs[p.id] = el.checked;
1656
+ });
1657
+ localStorage.setItem(PROMPT_STORAGE_KEY, JSON.stringify(prefs));
1658
+ } catch (e) {}
1659
+ }
1660
+
1661
+ // Initialize checkbox listeners
1662
+ promptCheckboxes.forEach(p => {
1663
+ const el = document.getElementById(p.id);
1664
+ if (el) el.addEventListener('change', savePromptPrefs);
1665
+ });
1666
+ loadPromptPrefs();
1667
+
1668
+ function getSelectedPrompts() {
1669
+ const prompts = [];
1670
+ promptCheckboxes.forEach(p => {
1671
+ const el = document.getElementById(p.id);
1672
+ if (el && el.checked) prompts.push(p.text);
1673
+ });
1674
+ return prompts;
1675
+ }
1676
+
1605
1677
  function payload(reason) {
1606
1678
  const data = { file: FILE_NAME, mode: MODE, reason, at: new Date().toISOString(), comments: Object.values(comments) };
1607
1679
  if (globalComment.trim()) data.summary = globalComment.trim();
1680
+ const prompts = getSelectedPrompts();
1681
+ if (prompts.length > 0) data.prompts = prompts;
1608
1682
  return data;
1609
1683
  }
1610
1684
  function sendAndExit(reason = 'button') {
@@ -1625,6 +1699,7 @@ function diffHtmlTemplate(diffData) {
1625
1699
  document.getElementById('modal-cancel').addEventListener('click', hideSubmitModal);
1626
1700
  function doSubmit() {
1627
1701
  globalComment = globalCommentInput.value;
1702
+ savePromptPrefs();
1628
1703
  hideSubmitModal();
1629
1704
  sendAndExit('button');
1630
1705
  // Try to close window; if it fails (browser security), show completion message
@@ -2781,6 +2856,22 @@ function htmlTemplate(dataRows, cols, projectRoot, relativePath, mode, previewHt
2781
2856
  .modal-actions button:hover { background: var(--hover-bg); }
2782
2857
  .modal-actions button.primary { background: var(--accent); color: var(--text-inverse); border-color: var(--accent); }
2783
2858
  .modal-actions button.primary:hover { background: #7dd3fc; }
2859
+
2860
+ .modal-checkboxes { margin: 12px 0; }
2861
+ .modal-checkboxes label {
2862
+ display: flex;
2863
+ align-items: flex-start;
2864
+ gap: 8px;
2865
+ font-size: 12px;
2866
+ color: var(--text);
2867
+ margin-bottom: 8px;
2868
+ cursor: pointer;
2869
+ }
2870
+ .modal-checkboxes input[type="checkbox"] {
2871
+ margin-top: 2px;
2872
+ accent-color: var(--accent);
2873
+ }
2874
+
2784
2875
  body.dragging { user-select: none; cursor: crosshair; }
2785
2876
  body.dragging .diff-line { cursor: crosshair; }
2786
2877
  @media (max-width: 840px) {
@@ -3047,6 +3138,12 @@ function htmlTemplate(dataRows, cols, projectRoot, relativePath, mode, previewHt
3047
3138
  <p class="modal-summary" id="modal-summary"></p>
3048
3139
  <label for="global-comment">Overall comment (optional)</label>
3049
3140
  <textarea id="global-comment" placeholder="Add a summary or overall feedback..."></textarea>
3141
+ <div class="modal-checkboxes">
3142
+ <label><input type="checkbox" id="prompt-subagents" checked /> All implementation, verification, and report creation will be done by the sub-agents.</label>
3143
+ <label><input type="checkbox" id="prompt-reviw" checked /> Open in REVIW next time.</label>
3144
+ <label><input type="checkbox" id="prompt-screenshots" checked /> Update all screenshots and videos.</label>
3145
+ <label><input type="checkbox" id="prompt-user-feedback-todo" checked /> Add the user's feedback to the Todo list, and do not check it off without the user's approval.</label>
3146
+ </div>
3050
3147
  <div class="modal-actions">
3051
3148
  <button id="modal-cancel">Cancel</button>
3052
3149
  <button class="primary" id="modal-submit">Submit</button>
@@ -3979,6 +4076,57 @@ function htmlTemplate(dataRows, cols, projectRoot, relativePath, mode, previewHt
3979
4076
  const modalCancel = document.getElementById('modal-cancel');
3980
4077
  const modalSubmit = document.getElementById('modal-submit');
3981
4078
 
4079
+ // Prompt checkboxes
4080
+ const promptCheckboxes = [
4081
+ { id: 'prompt-subagents', text: 'All implementation, verification, and report creation will be done by the sub-agents.' },
4082
+ { id: 'prompt-reviw', text: 'Open in REVIW next time.' },
4083
+ { id: 'prompt-screenshots', text: 'Update all screenshots and videos.' },
4084
+ { id: 'prompt-user-feedback-todo', text: "Add the user's feedback to the Todo list, and do not check it off without the user's approval." }
4085
+ ];
4086
+ const PROMPT_STORAGE_KEY = 'reviw-prompt-prefs';
4087
+
4088
+ // Load saved preferences
4089
+ function loadPromptPrefs() {
4090
+ try {
4091
+ const saved = localStorage.getItem(PROMPT_STORAGE_KEY);
4092
+ if (saved) {
4093
+ const prefs = JSON.parse(saved);
4094
+ promptCheckboxes.forEach(p => {
4095
+ const el = document.getElementById(p.id);
4096
+ if (el && typeof prefs[p.id] === 'boolean') el.checked = prefs[p.id];
4097
+ });
4098
+ }
4099
+ } catch (e) {}
4100
+ }
4101
+
4102
+ // Save preferences
4103
+ function savePromptPrefs() {
4104
+ try {
4105
+ const prefs = {};
4106
+ promptCheckboxes.forEach(p => {
4107
+ const el = document.getElementById(p.id);
4108
+ if (el) prefs[p.id] = el.checked;
4109
+ });
4110
+ localStorage.setItem(PROMPT_STORAGE_KEY, JSON.stringify(prefs));
4111
+ } catch (e) {}
4112
+ }
4113
+
4114
+ // Initialize checkbox listeners
4115
+ promptCheckboxes.forEach(p => {
4116
+ const el = document.getElementById(p.id);
4117
+ if (el) el.addEventListener('change', savePromptPrefs);
4118
+ });
4119
+ loadPromptPrefs();
4120
+
4121
+ function getSelectedPrompts() {
4122
+ const prompts = [];
4123
+ promptCheckboxes.forEach(p => {
4124
+ const el = document.getElementById(p.id);
4125
+ if (el && el.checked) prompts.push(p.text);
4126
+ });
4127
+ return prompts;
4128
+ }
4129
+
3982
4130
  function payload(reason) {
3983
4131
  const data = {
3984
4132
  file: FILE_NAME,
@@ -3990,6 +4138,8 @@ function htmlTemplate(dataRows, cols, projectRoot, relativePath, mode, previewHt
3990
4138
  if (globalComment.trim()) {
3991
4139
  data.summary = globalComment.trim();
3992
4140
  }
4141
+ const prompts = getSelectedPrompts();
4142
+ if (prompts.length > 0) data.prompts = prompts;
3993
4143
  // Include answered questions
3994
4144
  if (window.REVIW_ANSWERS) {
3995
4145
  const answeredQuestions = [];
@@ -4031,6 +4181,7 @@ function htmlTemplate(dataRows, cols, projectRoot, relativePath, mode, previewHt
4031
4181
  modalCancel.addEventListener('click', hideSubmitModal);
4032
4182
  function doSubmit() {
4033
4183
  globalComment = globalCommentInput.value;
4184
+ savePromptPrefs();
4034
4185
  hideSubmitModal();
4035
4186
  sendAndExit('button');
4036
4187
  // Try to close window; if it fails (browser security), show completion message
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reviw",
3
- "version": "0.11.0",
3
+ "version": "0.11.3",
4
4
  "description": "Lightweight file reviewer with in-browser comments for CSV, TSV, Markdown, and Git diffs.",
5
5
  "type": "module",
6
6
  "bin": {