fix(core): should use sonnet 4 for make it real (#13106)
#### PR Dependency Tree * **PR #13106** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Improved code highlighting performance and resource management for AI-generated code artifacts, resulting in smoother user experience and more efficient updates. * **Chores** * Updated underlying AI model for "Make it real" features, which may affect AI-generated outputs. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1286,7 +1286,7 @@ If there are items in the content that can be used as to-do tasks, please refer
|
|||||||
{
|
{
|
||||||
name: 'Make it real',
|
name: 'Make it real',
|
||||||
action: 'Make it real',
|
action: 'Make it real',
|
||||||
model: 'gpt-4.1-2025-04-14',
|
model: 'claude-sonnet-4@20250514',
|
||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
role: 'system',
|
role: 'system',
|
||||||
@@ -1327,7 +1327,7 @@ When sent new wireframes, respond ONLY with the contents of the html file.`,
|
|||||||
{
|
{
|
||||||
name: 'Make it real with text',
|
name: 'Make it real with text',
|
||||||
action: 'Make it real with text',
|
action: 'Make it real with text',
|
||||||
model: 'gpt-4.1-2025-04-14',
|
model: 'claude-sonnet-4@20250514',
|
||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
role: 'system',
|
role: 'system',
|
||||||
|
|||||||
@@ -103,6 +103,8 @@ export class CodeHighlighter extends SignalWatcher(WithDisposable(LitElement)) {
|
|||||||
override connectedCallback() {
|
override connectedCallback() {
|
||||||
super.connectedCallback();
|
super.connectedCallback();
|
||||||
|
|
||||||
|
this.highlighter.mounted();
|
||||||
|
|
||||||
// recompute highlight when code / language changes
|
// recompute highlight when code / language changes
|
||||||
this.disposables.add(
|
this.disposables.add(
|
||||||
effect(() => {
|
effect(() => {
|
||||||
@@ -111,18 +113,26 @@ export class CodeHighlighter extends SignalWatcher(WithDisposable(LitElement)) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override disconnectedCallback() {
|
||||||
|
super.disconnectedCallback();
|
||||||
|
this.highlighter.unmounted();
|
||||||
|
}
|
||||||
|
|
||||||
private _updateHighlightTokens() {
|
private _updateHighlightTokens() {
|
||||||
let cancelled = false;
|
let cancelled = false;
|
||||||
const language = this.language;
|
const language = this.language;
|
||||||
const highlighter = this.highlighter.highlighter$.value;
|
const highlighter = this.highlighter.highlighter$.value;
|
||||||
|
|
||||||
if (!highlighter) return;
|
if (!highlighter) return;
|
||||||
|
|
||||||
const updateTokens = () => {
|
const updateTokens = () => {
|
||||||
if (cancelled) return;
|
if (cancelled) return;
|
||||||
|
requestIdleCallback(() => {
|
||||||
this.highlightTokens.value = highlighter.codeToTokensBase(this.code, {
|
this.highlightTokens.value = highlighter.codeToTokensBase(this.code, {
|
||||||
lang: language,
|
lang: language,
|
||||||
theme: this.highlighter.themeKey,
|
theme: this.highlighter.themeKey,
|
||||||
});
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadedLanguages = highlighter.getLoadedLanguages();
|
const loadedLanguages = highlighter.getLoadedLanguages();
|
||||||
|
|||||||
Reference in New Issue
Block a user