Skip to content

Optimize Playground rendering and sync system instruction presets - #88

Merged
Mag1cFall merged 1 commit into
Mag1cFall:mainfrom
paralax034:playground-perf-and-instructions
Oct 29, 2026
Merged

Mag1cFall merged 1 commit into
Mag1cFall:mainfrom
paralax034:playground-perf-and-instructions

Conversation

@paralax034

@paralax034 paralax034 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

改动 / Changes

  • Incrementally highlight streaming code blocks in CodeBlock.vue by splitting stable highlighted prefixes from the active tail and skipping grid collapse transitions/unmounting collapsed DOM nodes on large code blocks.
  • Mark parsed Markdown AST blocks/nodes with markRaw in markdown.ts and memoize rendered VNodes in MarkdownBlock.ts.
  • Scope ChatTurn.vue :has() selectors to direct .actions-container children, replace full-subtree :has(.ms-code-block .code-header.sticky) matching with a reactive has-code class, read the latest batch entry (entries.at(-1)) in IntersectionObserver and ResizeObserver, and apply contain: layout style to prevent UI freezes on menu/action clicks and fast scrolling.
  • Preserve systemInstruction when resetting to /prompts/new_chat, allow saving prompts with system instructions before the first turn, and persist system instruction presets in promptdb (GET/PUT /api/prompts/system-instructions) so presets stay synced across the desktop window and browsers.

验证 / Verification

  • cd web && npm run lint && npm run format:check && npm run build
  • go vet ./...
  • go test -mod=readonly ./cmd/... ./internal/...

@paralax034

paralax034 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

While working on this, I also noticed that many models (like Gemini 3.x Flash with thinking enabled) hide sampling parameters (Temperature, Top P, Top K) in the Run Settings panel.

In a follow-up PR, would you be interested in adding:

  1. Sliders for Top P (0.0–1.0) and Top K (1–128) under Advanced settings (matching existing M3 UI slider styles).
  2. An optional sampling presets selector (e.g. Deterministic Code, Balanced, Creative, etc.) that calibrates Temp/TopP/TopK together?

Like

3_advanced 1_presets

@paralax034 paralax034 closed this Oct 29, 2026
@paralax034
paralax034 force-pushed the playground-perf-and-instructions branch from f036c5e to bd6c40f Compare October 29, 2026 16:40
@paralax034

Copy link
Copy Markdown
Contributor Author

Update

@paralax034 paralax034 reopened this Oct 29, 2026
@paralax034 paralax034 closed this Oct 29, 2026
@paralax034
paralax034 force-pushed the playground-perf-and-instructions branch from 410ecc5 to bd6c40f Compare October 29, 2026 16:59
@paralax034

Copy link
Copy Markdown
Contributor Author

Fix formatting

@paralax034 paralax034 reopened this Oct 29, 2026
@Mag1cFall
Mag1cFall merged commit e896894 into Mag1cFall:main Oct 29, 2026
8 of 12 checks passed
@paralax034

Copy link
Copy Markdown
Contributor Author

While working on this, I also noticed that many models (like Gemini 3.x Flash with thinking enabled) hide sampling parameters (Temperature, Top P, Top K) in the Run Settings panel.

In a follow-up PR, would you be interested in adding:

  1. Sliders for Top P (0.0–1.0) and Top K (1–128) under Advanced settings (matching existing M3 UI slider styles).
  2. An optional sampling presets selector (e.g. Deterministic Code, Balanced, Creative, etc.) that calibrates Temp/TopP/TopK together?

@Mag1cFall , do you think this aligns with the project's design and architectural style? If so, I’d be happy to create a separate PR for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants