mirror of
https://github.com/nexu-io/open-design.git
synced 2026-06-01 03:14:35 +07:00
Merge d7b06792aa into af4a62b69a
This commit is contained in:
commit
65da7510ea
4 changed files with 14 additions and 2 deletions
|
|
@ -885,7 +885,7 @@ export function renderCommentAttachmentHint(commentAttachments) {
|
|||
'',
|
||||
'',
|
||||
'<attached-preview-comments>',
|
||||
'Scope: treat each attachment as the default refinement target. For visual marks, inspect the screenshot and modify the marked region first. Preserve unrelated areas.',
|
||||
"Hard scope: change ONLY the elements identified below by selector / position / pod members. Do NOT modify sibling sub-pages, parent layout, global CSS, design tokens, or unrelated rules even if you notice issues there — surface those as a follow-up note in your reply instead of editing them. If the user's request cannot be satisfied without touching outside this scope, ask the user before proceeding. For visual marks, inspect the screenshot and modify the marked region first.",
|
||||
];
|
||||
for (const item of commentAttachments) {
|
||||
const targetKind =
|
||||
|
|
|
|||
|
|
@ -171,6 +171,12 @@ describe('preview comment agent payload', () => {
|
|||
expect(hint).toContain('file: index.html');
|
||||
expect(hint).toContain('selector: [data-od-id="hero-title"]');
|
||||
expect(hint).toContain('comment: Make the headline shorter');
|
||||
// The hard-scope sentence IS the behavior change. Assert its key phrases
|
||||
// so a future edit that softens or drops the directive lights the suite
|
||||
// red instead of silently re-opening the over-broad edit bug.
|
||||
expect(hint).toContain('Hard scope: change ONLY');
|
||||
expect(hint).toContain('Do NOT modify sibling sub-pages, parent layout, global CSS, design tokens, or unrelated rules');
|
||||
expect(hint).toContain('ask the user before proceeding');
|
||||
});
|
||||
|
||||
it('renders pod attachments with grouped member context', () => {
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ function renderCommentAttachmentContext(commentAttachments: ChatCommentAttachmen
|
|||
'',
|
||||
'',
|
||||
'<attached-preview-comments>',
|
||||
'Scope: apply the user request to the attached preview target by default. For visual marks, inspect the screenshot and modify the marked region first. Preserve unrelated elements.',
|
||||
"Hard scope: change ONLY the elements identified below by selector / position / pod members. Do NOT modify sibling sub-pages, parent layout, global CSS, design tokens, or unrelated rules even if you notice issues there — surface those as a follow-up note in your reply instead of editing them. If the user's request cannot be satisfied without touching outside this scope, ask the user before proceeding. For visual marks, inspect the screenshot and modify the marked region first.",
|
||||
];
|
||||
commentAttachments.forEach((item) => {
|
||||
const position = normalizePosition(item.pagePosition);
|
||||
|
|
|
|||
|
|
@ -265,6 +265,12 @@ describe('preview comment attachment helpers', () => {
|
|||
expect(content).toContain('computedStyle: color: rgb(26, 25, 22)');
|
||||
expect(content).toContain('fontSize: 13.5px');
|
||||
expect(content).toContain('comment: Only shorten this title');
|
||||
// The hard-scope sentence IS the behavior change. Assert its key phrases
|
||||
// so a future edit that softens or drops the directive lights the suite
|
||||
// red instead of silently re-opening the over-broad edit bug.
|
||||
expect(content).toContain('Hard scope: change ONLY');
|
||||
expect(content).toContain('Do NOT modify sibling sub-pages, parent layout, global CSS, design tokens, or unrelated rules');
|
||||
expect(content).toContain('ask the user before proceeding');
|
||||
});
|
||||
|
||||
it('adds hidden comment context only to the current user message sent to API providers', () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue