feat: use enlarged single PS logo and add line-numbered AI suggestions with highlight/accept/deny/copy-to-note
This commit is contained in:
@@ -318,6 +318,16 @@ export class AIStore {
|
||||
});
|
||||
}
|
||||
|
||||
/** Remove a suggestion from a session (used when denying or dismissing). */
|
||||
async deleteSuggestion(sessionId: string, suggestionId: string): Promise<AISession> {
|
||||
return this.withTransaction(async () => {
|
||||
const session = this.require(sessionId);
|
||||
session.suggestions = session.suggestions.filter((s) => s.id !== suggestionId);
|
||||
session.updatedAt = nowIso();
|
||||
return this.clone(session);
|
||||
});
|
||||
}
|
||||
|
||||
/** Add a note to a session and persist it. */
|
||||
async addNote(sessionId: string, note: Omit<AINote, "id" | "createdAt" | "updatedAt">): Promise<AISession> {
|
||||
return this.withTransaction(async () => {
|
||||
|
||||
@@ -299,14 +299,16 @@ export interface AISuggestion {
|
||||
title: string;
|
||||
text: string;
|
||||
summary: string;
|
||||
originalText?: string;
|
||||
newText?: string;
|
||||
anchorIndex?: number;
|
||||
spanLength?: number;
|
||||
lineNumber?: number | undefined;
|
||||
chapterId?: string | undefined;
|
||||
originalText?: string | undefined;
|
||||
newText?: string | undefined;
|
||||
anchorIndex?: number | undefined;
|
||||
spanLength?: number | undefined;
|
||||
status: AISuggestionStatus;
|
||||
appliedAt?: string;
|
||||
resolvedAt?: string;
|
||||
resolution?: "accepted" | "rejected";
|
||||
appliedAt?: string | undefined;
|
||||
resolvedAt?: string | undefined;
|
||||
resolution?: "accepted" | "rejected" | undefined;
|
||||
}
|
||||
|
||||
/** An AI-backed session with its messages, suggestions, and notes. */
|
||||
|
||||
@@ -143,27 +143,18 @@ body {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.ps-sidebar-brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.ps-sidebar-logo-img {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 6px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.ps-sidebar-logo-lockup {
|
||||
height: 36px;
|
||||
width: auto;
|
||||
object-fit: contain;
|
||||
}
|
||||
.ps-sidebar-logo-icon {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 7px;
|
||||
.ps-sidebar-logo-only {
|
||||
width: 68px;
|
||||
height: 68px;
|
||||
border-radius: 12px;
|
||||
display: block;
|
||||
flex-shrink: 0;
|
||||
transition: width 0.16s ease, height 0.16s ease;
|
||||
}
|
||||
.ps-sidebar.is-collapsed .ps-sidebar-logo-only {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 9px;
|
||||
}
|
||||
|
||||
.ps-sidebar-toggle {
|
||||
@@ -840,6 +831,83 @@ body {
|
||||
border-radius: 8px;
|
||||
padding: 10px 12px;
|
||||
}
|
||||
.ps-ai-suggestion-card {
|
||||
cursor: pointer;
|
||||
transition: border-color 0.15s, box-shadow 0.15s;
|
||||
}
|
||||
.ps-ai-suggestion-card:hover {
|
||||
border-color: color-mix(in srgb, var(--ps-accent) 60%, var(--ps-border));
|
||||
}
|
||||
.ps-ai-suggestion-card.is-focused {
|
||||
border-color: var(--ps-accent);
|
||||
box-shadow: 0 0 0 2px color-mix(in srgb, var(--ps-accent) 28%, transparent);
|
||||
}
|
||||
.ps-ai-stepper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
padding: 8px 12px;
|
||||
border-bottom: 1px solid var(--ps-border);
|
||||
background: var(--ps-surface-2);
|
||||
}
|
||||
.ps-ai-line-pill {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 2px 7px;
|
||||
margin: 0 2px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid color-mix(in srgb, var(--ps-accent) 50%, var(--ps-border));
|
||||
background: color-mix(in srgb, var(--ps-accent) 16%, transparent);
|
||||
color: var(--ps-accent);
|
||||
font-family: var(--ps-font-mono);
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: background 0.12s, color 0.12s;
|
||||
}
|
||||
.ps-ai-line-pill:hover,
|
||||
.ps-ai-line-pill.is-active {
|
||||
background: var(--ps-accent);
|
||||
color: var(--ps-accent-contrast);
|
||||
border-color: var(--ps-accent);
|
||||
}
|
||||
.ps-ai-diff-original {
|
||||
font-size: 12px;
|
||||
padding: 7px 9px;
|
||||
border-radius: 6px;
|
||||
background: color-mix(in srgb, var(--ps-danger) 12%, var(--ps-bg));
|
||||
border-left: 3px solid var(--ps-danger);
|
||||
margin-bottom: 8px;
|
||||
color: var(--ps-text-muted);
|
||||
}
|
||||
.ps-ai-diff-new {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
font-size: 12px;
|
||||
padding: 7px 9px;
|
||||
border-radius: 6px;
|
||||
background: color-mix(in srgb, var(--ps-success) 10%, var(--ps-bg));
|
||||
border-left: 3px solid var(--ps-success);
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.ps-ai-diff-label {
|
||||
display: block;
|
||||
font-size: 10.5px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
color: var(--ps-text-muted);
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
.ps-ai-suggestion-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
/* ---- Projects Page & Template Wizard ---- */
|
||||
.ps-projects-grid {
|
||||
|
||||
Reference in New Issue
Block a user