Skip to content

Commit c3201cc

Browse files
committed
feat(ai-chat): onboarding iframe styles + strings
Companion to the phoenix-pro onboarding iframe wiring. * Extn-AIChatPanel.less: - .ai-tab-container gains `position: relative` so the prompt overlay (re-parented there at runtime) can use absolute inset:0 to cover tabs + panel body. - .ai-onboarding-wrap claims the same flex slot as .ai-chat-messages when shown. - .ai-history-open also hides the wrap so opening the history dropdown takes the panel body cleanly. - .ai-onboarding-prompt-overlay (top-level rule, not nested under the wrap, so the styles apply after the runtime reparent) matches Phoenix Code's panel chrome — neutral grey card on @bc-ai-sidebar-bg / @bc-ai-input-border, header strip with title + × close, full-bleed flush textarea, action row with quiet text Cancel and an icon-only send button mirroring .ai-send-btn. Explicit focus reset (border/outline/box-shadow: none) so the global textarea:focus rule can't shift the dialog when the user clicks in. - Light entrance animations (overlay fade, card pop). * strings.js: AI_CHAT_ONBOARDING_REVIEW_PROMPT ("Ready to build") and AI_CHAT_ONBOARDING_SEND.
1 parent 2b0d423 commit c3201cc

2 files changed

Lines changed: 199 additions & 1 deletion

File tree

src/nls/root/strings.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2226,6 +2226,8 @@ define({
22262226
"AI_CHAT_FULL_AUTO_WARNING_TITLE": "Switch to Full Auto Mode?",
22272227
"AI_CHAT_FULL_AUTO_WARNING_BODY": "Full Auto mode lets the AI run any tool — Bash commands, file edits, file deletions, web fetches — without asking you first.<br><br>This is convenient for trusted scratch projects, but can be risky: a misjudged step could overwrite or delete files, run a destructive shell command, or push unintended changes. Use version control (Git) so you can recover if something goes wrong.<br><br>Only enable Full Auto in projects you trust. You can switch back to Edit Mode at any time using <kbd>Shift+Tab</kbd> or by clicking the mode bar.",
22282228
"AI_CHAT_FULL_AUTO_WARNING_PROCEED": "Enable Full Auto",
2229+
"AI_CHAT_ONBOARDING_REVIEW_PROMPT": "Ready to build",
2230+
"AI_CHAT_ONBOARDING_SEND": "Send",
22292231
"AI_CHAT_SHOW_DIFF": "Show diff",
22302232
"AI_CHAT_HIDE_DIFF": "Hide diff",
22312233
"AI_CHAT_DIFF_MORE_TITLE": "Diff options",

src/styles/Extn-AIChatPanel.less

Lines changed: 197 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
flex: 1;
4141
min-height: 0;
4242
overflow: hidden;
43+
// Positioning context for the onboarding prompt overlay, which is
44+
// detached from its template position and re-parented here so it
45+
// covers the Files/AI tab strip as well as the panel body.
46+
position: relative;
4347
}
4448

4549
.ai-chat-panel {
@@ -145,7 +149,8 @@
145149
.ai-chat-panel.ai-history-open {
146150
> .ai-chat-messages,
147151
> .ai-chat-status,
148-
> .ai-chat-input-area {
152+
> .ai-chat-input-area,
153+
> .ai-onboarding-wrap {
149154
display: none !important;
150155
}
151156
}
@@ -265,6 +270,179 @@
265270
}
266271
}
267272

273+
/* ── Onboarding iframe (guided AI starter) ──────────────────────────── */
274+
/* The wrap sits where .ai-chat-messages would. When visible it claims
275+
the same flex slot — when hidden the chat takes that slot back. */
276+
.ai-onboarding-wrap {
277+
flex: 1;
278+
min-height: 0;
279+
min-width: 0;
280+
position: relative;
281+
background-color: @bc-ai-sidebar-bg;
282+
283+
.ai-onboarding-frame {
284+
width: 100%;
285+
height: 100%;
286+
border: 0;
287+
display: block;
288+
}
289+
}
290+
291+
/* Prompt confirm overlay — top-level rule (NOT nested under
292+
.ai-onboarding-wrap) because at runtime _initOnboarding detaches
293+
the overlay element and re-parents it to .ai-tab-container so it
294+
covers the Files/AI tab strip in addition to the panel body.
295+
Neutral dark-panel chrome — no blue accent. Title strip + full-
296+
bleed textarea + bottom action row with Cancel and an icon-only
297+
send button that mirrors .ai-send-btn's transparent quiet style. */
298+
.ai-onboarding-prompt-overlay {
299+
position: absolute;
300+
inset: 0;
301+
z-index: 10;
302+
background: rgba(0, 0, 0, 0.45);
303+
display: flex;
304+
align-items: center;
305+
justify-content: center;
306+
padding: 16px;
307+
animation: ai-onboarding-overlay-fade 0.15s ease-out;
308+
309+
.ai-onboarding-prompt-card {
310+
width: 100%;
311+
max-width: 440px;
312+
border: 1px solid @bc-ai-input-border;
313+
border-radius: 8px;
314+
background: @bc-ai-sidebar-bg;
315+
overflow: hidden;
316+
display: flex;
317+
flex-direction: column;
318+
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
319+
animation: ai-onboarding-card-pop 0.18s ease-out;
320+
}
321+
322+
.ai-onboarding-prompt-header {
323+
display: flex;
324+
align-items: center;
325+
gap: 8px;
326+
padding: 8px 8px 8px 14px;
327+
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
328+
}
329+
330+
.ai-onboarding-prompt-title {
331+
flex: 1;
332+
min-width: 0;
333+
font-size: @ai-text-body;
334+
font-weight: 600;
335+
color: @project-panel-text-1;
336+
line-height: 1.3;
337+
}
338+
339+
.ai-onboarding-prompt-close {
340+
background: none;
341+
border: 0;
342+
color: @project-panel-text-2;
343+
width: 26px;
344+
height: 26px;
345+
border-radius: 4px;
346+
cursor: pointer;
347+
display: flex;
348+
align-items: center;
349+
justify-content: center;
350+
opacity: 0.55;
351+
flex-shrink: 0;
352+
transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
353+
354+
i { font-size: 0.95em; }
355+
356+
&:hover {
357+
opacity: 1;
358+
color: @project-panel-text-1;
359+
background: rgba(255, 255, 255, 0.05);
360+
}
361+
}
362+
363+
.ai-onboarding-prompt-text {
364+
// display: block + width: 100% + box-sizing makes the textarea
365+
// span the card's full inner width regardless of the rows attr
366+
// or the browser's textarea default width.
367+
display: block;
368+
width: 100%;
369+
box-sizing: border-box;
370+
background: @bc-ai-input-bg;
371+
border: 0;
372+
border-radius: 0;
373+
color: @project-panel-text-1;
374+
font-size: @ai-text-body;
375+
line-height: @ai-line-prose;
376+
padding: 12px 14px;
377+
resize: vertical;
378+
min-height: 110px;
379+
max-height: 260px;
380+
outline: none;
381+
box-shadow: none;
382+
383+
// Phoenix's global textarea focus rule paints a border + shadow
384+
// that shifts the dialog by ~2px and reads as a flicker. Force
385+
// the no-chrome focus state so only the bg darkening signals
386+
// focus.
387+
&:focus,
388+
&:focus-visible {
389+
background: @bc-ai-input-bg-focused;
390+
border: 0;
391+
outline: none;
392+
box-shadow: none;
393+
}
394+
}
395+
396+
.ai-onboarding-prompt-actions {
397+
display: flex;
398+
justify-content: flex-end;
399+
align-items: center;
400+
gap: 4px;
401+
padding: 6px 8px 6px 12px;
402+
border-top: 1px solid rgba(255, 255, 255, 0.06);
403+
}
404+
405+
.ai-onboarding-prompt-cancel {
406+
background: transparent;
407+
border: 0;
408+
color: @project-panel-text-2;
409+
font-size: @ai-text-secondary;
410+
line-height: @ai-line-compact;
411+
padding: 6px 10px;
412+
border-radius: 4px;
413+
cursor: pointer;
414+
transition: background-color 0.15s ease, color 0.15s ease;
415+
416+
&:hover {
417+
background: rgba(255, 255, 255, 0.05);
418+
color: @project-panel-text-1;
419+
}
420+
}
421+
422+
.ai-onboarding-prompt-send {
423+
background: none;
424+
border: 0;
425+
color: @project-panel-text-2;
426+
width: 32px;
427+
height: 28px;
428+
border-radius: 4px;
429+
cursor: pointer;
430+
display: flex;
431+
align-items: center;
432+
justify-content: center;
433+
opacity: 0.6;
434+
transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
435+
436+
i { font-size: 0.95em; }
437+
438+
&:hover {
439+
opacity: 1;
440+
color: @project-panel-text-1;
441+
background: rgba(255, 255, 255, 0.05);
442+
}
443+
}
444+
}
445+
268446
/* ── Message list ───────────────────────────────────────────────────── */
269447
.ai-chat-messages {
270448
flex: 1;
@@ -2892,3 +3070,21 @@
28923070
}
28933071
}
28943072

3073+
/* Onboarding prompt overlay entrance animations. Kept at file scope so
3074+
the keyframes resolve regardless of nesting context. */
3075+
@keyframes ai-onboarding-overlay-fade {
3076+
from { opacity: 0; }
3077+
to { opacity: 1; }
3078+
}
3079+
3080+
@keyframes ai-onboarding-card-pop {
3081+
from {
3082+
opacity: 0;
3083+
transform: scale(0.96) translateY(6px);
3084+
}
3085+
to {
3086+
opacity: 1;
3087+
transform: scale(1) translateY(0);
3088+
}
3089+
}
3090+

0 commit comments

Comments
 (0)