reviw 0.11.0 → 0.11.2
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/cli.cjs +147 -0
- 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,11 @@ 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
|
+
</div>
|
|
1237
1257
|
<div class="modal-actions">
|
|
1238
1258
|
<button id="modal-cancel">Cancel</button>
|
|
1239
1259
|
<button class="primary" id="modal-submit">Submit</button>
|
|
@@ -1602,9 +1622,61 @@ function diffHtmlTemplate(diffData) {
|
|
|
1602
1622
|
const modalSummary = document.getElementById('modal-summary');
|
|
1603
1623
|
const globalCommentInput = document.getElementById('global-comment');
|
|
1604
1624
|
|
|
1625
|
+
// Prompt checkboxes
|
|
1626
|
+
const promptCheckboxes = [
|
|
1627
|
+
{ id: 'prompt-subagents', text: 'All implementation, verification, and report creation will be done by the sub-agents.' },
|
|
1628
|
+
{ id: 'prompt-reviw', text: 'Open in REVIW next time.' },
|
|
1629
|
+
{ id: 'prompt-screenshots', text: 'Update all screenshots and videos.' }
|
|
1630
|
+
];
|
|
1631
|
+
const PROMPT_STORAGE_KEY = 'reviw-prompt-prefs';
|
|
1632
|
+
|
|
1633
|
+
// Load saved preferences
|
|
1634
|
+
function loadPromptPrefs() {
|
|
1635
|
+
try {
|
|
1636
|
+
const saved = localStorage.getItem(PROMPT_STORAGE_KEY);
|
|
1637
|
+
if (saved) {
|
|
1638
|
+
const prefs = JSON.parse(saved);
|
|
1639
|
+
promptCheckboxes.forEach(p => {
|
|
1640
|
+
const el = document.getElementById(p.id);
|
|
1641
|
+
if (el && typeof prefs[p.id] === 'boolean') el.checked = prefs[p.id];
|
|
1642
|
+
});
|
|
1643
|
+
}
|
|
1644
|
+
} catch (e) {}
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
// Save preferences
|
|
1648
|
+
function savePromptPrefs() {
|
|
1649
|
+
try {
|
|
1650
|
+
const prefs = {};
|
|
1651
|
+
promptCheckboxes.forEach(p => {
|
|
1652
|
+
const el = document.getElementById(p.id);
|
|
1653
|
+
if (el) prefs[p.id] = el.checked;
|
|
1654
|
+
});
|
|
1655
|
+
localStorage.setItem(PROMPT_STORAGE_KEY, JSON.stringify(prefs));
|
|
1656
|
+
} catch (e) {}
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
// Initialize checkbox listeners
|
|
1660
|
+
promptCheckboxes.forEach(p => {
|
|
1661
|
+
const el = document.getElementById(p.id);
|
|
1662
|
+
if (el) el.addEventListener('change', savePromptPrefs);
|
|
1663
|
+
});
|
|
1664
|
+
loadPromptPrefs();
|
|
1665
|
+
|
|
1666
|
+
function getSelectedPrompts() {
|
|
1667
|
+
const prompts = [];
|
|
1668
|
+
promptCheckboxes.forEach(p => {
|
|
1669
|
+
const el = document.getElementById(p.id);
|
|
1670
|
+
if (el && el.checked) prompts.push(p.text);
|
|
1671
|
+
});
|
|
1672
|
+
return prompts;
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1605
1675
|
function payload(reason) {
|
|
1606
1676
|
const data = { file: FILE_NAME, mode: MODE, reason, at: new Date().toISOString(), comments: Object.values(comments) };
|
|
1607
1677
|
if (globalComment.trim()) data.summary = globalComment.trim();
|
|
1678
|
+
const prompts = getSelectedPrompts();
|
|
1679
|
+
if (prompts.length > 0) data.prompts = prompts;
|
|
1608
1680
|
return data;
|
|
1609
1681
|
}
|
|
1610
1682
|
function sendAndExit(reason = 'button') {
|
|
@@ -1625,6 +1697,7 @@ function diffHtmlTemplate(diffData) {
|
|
|
1625
1697
|
document.getElementById('modal-cancel').addEventListener('click', hideSubmitModal);
|
|
1626
1698
|
function doSubmit() {
|
|
1627
1699
|
globalComment = globalCommentInput.value;
|
|
1700
|
+
savePromptPrefs();
|
|
1628
1701
|
hideSubmitModal();
|
|
1629
1702
|
sendAndExit('button');
|
|
1630
1703
|
// Try to close window; if it fails (browser security), show completion message
|
|
@@ -2781,6 +2854,22 @@ function htmlTemplate(dataRows, cols, projectRoot, relativePath, mode, previewHt
|
|
|
2781
2854
|
.modal-actions button:hover { background: var(--hover-bg); }
|
|
2782
2855
|
.modal-actions button.primary { background: var(--accent); color: var(--text-inverse); border-color: var(--accent); }
|
|
2783
2856
|
.modal-actions button.primary:hover { background: #7dd3fc; }
|
|
2857
|
+
|
|
2858
|
+
.modal-checkboxes { margin: 12px 0; }
|
|
2859
|
+
.modal-checkboxes label {
|
|
2860
|
+
display: flex;
|
|
2861
|
+
align-items: flex-start;
|
|
2862
|
+
gap: 8px;
|
|
2863
|
+
font-size: 12px;
|
|
2864
|
+
color: var(--text);
|
|
2865
|
+
margin-bottom: 8px;
|
|
2866
|
+
cursor: pointer;
|
|
2867
|
+
}
|
|
2868
|
+
.modal-checkboxes input[type="checkbox"] {
|
|
2869
|
+
margin-top: 2px;
|
|
2870
|
+
accent-color: var(--accent);
|
|
2871
|
+
}
|
|
2872
|
+
|
|
2784
2873
|
body.dragging { user-select: none; cursor: crosshair; }
|
|
2785
2874
|
body.dragging .diff-line { cursor: crosshair; }
|
|
2786
2875
|
@media (max-width: 840px) {
|
|
@@ -3047,6 +3136,11 @@ function htmlTemplate(dataRows, cols, projectRoot, relativePath, mode, previewHt
|
|
|
3047
3136
|
<p class="modal-summary" id="modal-summary"></p>
|
|
3048
3137
|
<label for="global-comment">Overall comment (optional)</label>
|
|
3049
3138
|
<textarea id="global-comment" placeholder="Add a summary or overall feedback..."></textarea>
|
|
3139
|
+
<div class="modal-checkboxes">
|
|
3140
|
+
<label><input type="checkbox" id="prompt-subagents" checked /> All implementation, verification, and report creation will be done by the sub-agents.</label>
|
|
3141
|
+
<label><input type="checkbox" id="prompt-reviw" checked /> Open in REVIW next time.</label>
|
|
3142
|
+
<label><input type="checkbox" id="prompt-screenshots" checked /> Update all screenshots and videos.</label>
|
|
3143
|
+
</div>
|
|
3050
3144
|
<div class="modal-actions">
|
|
3051
3145
|
<button id="modal-cancel">Cancel</button>
|
|
3052
3146
|
<button class="primary" id="modal-submit">Submit</button>
|
|
@@ -3979,6 +4073,56 @@ function htmlTemplate(dataRows, cols, projectRoot, relativePath, mode, previewHt
|
|
|
3979
4073
|
const modalCancel = document.getElementById('modal-cancel');
|
|
3980
4074
|
const modalSubmit = document.getElementById('modal-submit');
|
|
3981
4075
|
|
|
4076
|
+
// Prompt checkboxes
|
|
4077
|
+
const promptCheckboxes = [
|
|
4078
|
+
{ id: 'prompt-subagents', text: 'All implementation, verification, and report creation will be done by the sub-agents.' },
|
|
4079
|
+
{ id: 'prompt-reviw', text: 'Open in REVIW next time.' },
|
|
4080
|
+
{ id: 'prompt-screenshots', text: 'Update all screenshots and videos.' }
|
|
4081
|
+
];
|
|
4082
|
+
const PROMPT_STORAGE_KEY = 'reviw-prompt-prefs';
|
|
4083
|
+
|
|
4084
|
+
// Load saved preferences
|
|
4085
|
+
function loadPromptPrefs() {
|
|
4086
|
+
try {
|
|
4087
|
+
const saved = localStorage.getItem(PROMPT_STORAGE_KEY);
|
|
4088
|
+
if (saved) {
|
|
4089
|
+
const prefs = JSON.parse(saved);
|
|
4090
|
+
promptCheckboxes.forEach(p => {
|
|
4091
|
+
const el = document.getElementById(p.id);
|
|
4092
|
+
if (el && typeof prefs[p.id] === 'boolean') el.checked = prefs[p.id];
|
|
4093
|
+
});
|
|
4094
|
+
}
|
|
4095
|
+
} catch (e) {}
|
|
4096
|
+
}
|
|
4097
|
+
|
|
4098
|
+
// Save preferences
|
|
4099
|
+
function savePromptPrefs() {
|
|
4100
|
+
try {
|
|
4101
|
+
const prefs = {};
|
|
4102
|
+
promptCheckboxes.forEach(p => {
|
|
4103
|
+
const el = document.getElementById(p.id);
|
|
4104
|
+
if (el) prefs[p.id] = el.checked;
|
|
4105
|
+
});
|
|
4106
|
+
localStorage.setItem(PROMPT_STORAGE_KEY, JSON.stringify(prefs));
|
|
4107
|
+
} catch (e) {}
|
|
4108
|
+
}
|
|
4109
|
+
|
|
4110
|
+
// Initialize checkbox listeners
|
|
4111
|
+
promptCheckboxes.forEach(p => {
|
|
4112
|
+
const el = document.getElementById(p.id);
|
|
4113
|
+
if (el) el.addEventListener('change', savePromptPrefs);
|
|
4114
|
+
});
|
|
4115
|
+
loadPromptPrefs();
|
|
4116
|
+
|
|
4117
|
+
function getSelectedPrompts() {
|
|
4118
|
+
const prompts = [];
|
|
4119
|
+
promptCheckboxes.forEach(p => {
|
|
4120
|
+
const el = document.getElementById(p.id);
|
|
4121
|
+
if (el && el.checked) prompts.push(p.text);
|
|
4122
|
+
});
|
|
4123
|
+
return prompts;
|
|
4124
|
+
}
|
|
4125
|
+
|
|
3982
4126
|
function payload(reason) {
|
|
3983
4127
|
const data = {
|
|
3984
4128
|
file: FILE_NAME,
|
|
@@ -3990,6 +4134,8 @@ function htmlTemplate(dataRows, cols, projectRoot, relativePath, mode, previewHt
|
|
|
3990
4134
|
if (globalComment.trim()) {
|
|
3991
4135
|
data.summary = globalComment.trim();
|
|
3992
4136
|
}
|
|
4137
|
+
const prompts = getSelectedPrompts();
|
|
4138
|
+
if (prompts.length > 0) data.prompts = prompts;
|
|
3993
4139
|
// Include answered questions
|
|
3994
4140
|
if (window.REVIW_ANSWERS) {
|
|
3995
4141
|
const answeredQuestions = [];
|
|
@@ -4031,6 +4177,7 @@ function htmlTemplate(dataRows, cols, projectRoot, relativePath, mode, previewHt
|
|
|
4031
4177
|
modalCancel.addEventListener('click', hideSubmitModal);
|
|
4032
4178
|
function doSubmit() {
|
|
4033
4179
|
globalComment = globalCommentInput.value;
|
|
4180
|
+
savePromptPrefs();
|
|
4034
4181
|
hideSubmitModal();
|
|
4035
4182
|
sendAndExit('button');
|
|
4036
4183
|
// Try to close window; if it fails (browser security), show completion message
|