@plannotator/ui 0.46.0 → 0.47.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/HANDOFF.md +37 -4
- package/README.md +9 -2
- package/components/AISettingsTab.tsx +6 -0
- package/components/AgentsTab.tsx +11 -1
- package/components/MarkdownEditor.tsx +9 -0
- package/components/ModelSourceHint.tsx +49 -0
- package/components/ai/AIProviderBar.tsx +8 -0
- package/hooks/useAgentSettings.ts +8 -1
- package/hooks/useCodeAnnotationDraft.ts +24 -7
- package/hooks/useModelCatalogs.ts +28 -11
- package/hooks/useVimSelection.ts +28 -7
- package/package.json +4 -4
- package/styles.css +1 -1
- package/utils/aiProvider.ts +4 -0
- package/utils/decisionSpec.ts +36 -2
package/utils/aiProvider.ts
CHANGED
|
@@ -21,6 +21,10 @@ export interface AIProviderOption {
|
|
|
21
21
|
id: string;
|
|
22
22
|
name: string;
|
|
23
23
|
models?: AIProviderModel[];
|
|
24
|
+
/** Where `models` came from, when the server says (`/api/ai/capabilities`). */
|
|
25
|
+
modelsSource?: 'fallback' | 'discovered';
|
|
26
|
+
/** The installed CLI's version, when the server reports it. */
|
|
27
|
+
toolVersion?: string;
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
export interface AIProviderSettings {
|
package/utils/decisionSpec.ts
CHANGED
|
@@ -126,6 +126,15 @@ export interface DecisionPlatformInput {
|
|
|
126
126
|
mrLabel: string;
|
|
127
127
|
/** The viewer authored this PR/MR: approve paths mute, never disappear. */
|
|
128
128
|
selfAuthored: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* #1611: whether the platform has a real request-changes review (GitHub
|
|
131
|
+
* does, GitLab does not). `false` makes the request-changes rows say they
|
|
132
|
+
* post as a comment. Absent keeps the original copy, so a host that never
|
|
133
|
+
* sets it renders exactly what it rendered before. When supported, a
|
|
134
|
+
* self-authored PR mutes Request changes too (GitHub refuses it on your own
|
|
135
|
+
* PR) and adds a live "Comment…" row so the empty state is never a dead end.
|
|
136
|
+
*/
|
|
137
|
+
requestChangesSupported?: boolean;
|
|
129
138
|
}
|
|
130
139
|
|
|
131
140
|
export const DECISION_NOTE_PLACEHOLDER = 'Add a note...';
|
|
@@ -345,6 +354,11 @@ function buildPlatformSpec(input: DecisionSpecInput, platform: DecisionPlatformI
|
|
|
345
354
|
// Frozen copy (maintainer-approved): the self-approval mute reason.
|
|
346
355
|
const selfReason = `You can't approve your own ${noun} on ${platform.label}.`;
|
|
347
356
|
const selfReasonShort = `You can't approve your own ${platform.mrLabel}`;
|
|
357
|
+
const requestChangesUnsupported = platform.requestChangesSupported === false;
|
|
358
|
+
// GitHub refuses REQUEST_CHANGES on your own PR, exactly like APPROVE.
|
|
359
|
+
const requestChangesMuted = selfAuthored && platform.requestChangesSupported === true;
|
|
360
|
+
const selfRequestChangesShort = `You can't request changes on your own ${platform.mrLabel}`;
|
|
361
|
+
const postsAsComment = `Posts as a comment; ${platform.label} has no request-changes review`;
|
|
348
362
|
|
|
349
363
|
if (!input.hasFeedback) {
|
|
350
364
|
return {
|
|
@@ -374,11 +388,27 @@ function buildPlatformSpec(input: DecisionSpecInput, platform: DecisionPlatformI
|
|
|
374
388
|
id: 'request-changes',
|
|
375
389
|
// Frozen copy (maintainer-approved): 'Request changes…'.
|
|
376
390
|
label: 'Request changes…',
|
|
377
|
-
subtitle:
|
|
391
|
+
subtitle: requestChangesMuted
|
|
392
|
+
? selfRequestChangesShort
|
|
393
|
+
: requestChangesUnsupported
|
|
394
|
+
? postsAsComment
|
|
395
|
+
: 'Overall feedback, zero line comments, via the dialog',
|
|
378
396
|
tone: 'primary',
|
|
379
397
|
icon: 'send',
|
|
380
398
|
dividerBefore: true,
|
|
399
|
+
...(requestChangesMuted ? { muted: true } : {}),
|
|
381
400
|
},
|
|
401
|
+
// With Request changes muted on your own PR, a neutral comment is the
|
|
402
|
+
// live path (the empty state is never a dead end).
|
|
403
|
+
...(requestChangesMuted
|
|
404
|
+
? [{
|
|
405
|
+
id: 'note-with-feedback' as const,
|
|
406
|
+
label: 'Comment…',
|
|
407
|
+
subtitle: 'Overall feedback as a neutral comment, via the dialog',
|
|
408
|
+
tone: 'primary' as const,
|
|
409
|
+
icon: 'send' as const,
|
|
410
|
+
}]
|
|
411
|
+
: []),
|
|
382
412
|
],
|
|
383
413
|
};
|
|
384
414
|
}
|
|
@@ -406,7 +436,11 @@ function buildPlatformSpec(input: DecisionSpecInput, platform: DecisionPlatformI
|
|
|
406
436
|
{
|
|
407
437
|
id: 'note-with-feedback',
|
|
408
438
|
label: 'Post comments, then…',
|
|
409
|
-
subtitle:
|
|
439
|
+
subtitle: requestChangesUnsupported
|
|
440
|
+
? postsAsComment
|
|
441
|
+
: requestChangesMuted
|
|
442
|
+
? `Posts as a neutral comment; you can't request changes on your own ${platform.mrLabel}`
|
|
443
|
+
: 'Request changes or stay neutral, chosen in the dialog',
|
|
410
444
|
tone: 'primary',
|
|
411
445
|
icon: 'send',
|
|
412
446
|
dividerBefore: true,
|