Skip to content

feat(composer): ✨ Add profile quick edit controls#199

Merged
jorben merged 7 commits into
masterfrom
feat/profile-update-support
May 23, 2026
Merged

feat(composer): ✨ Add profile quick edit controls#199
jorben merged 7 commits into
masterfrom
feat/profile-update-support

Conversation

@HayWolf
Copy link
Copy Markdown
Contributor

@HayWolf HayWolf commented May 22, 2026

Summary

  • Add inline profile quick edit controls for thinking level and model tiers in the workbench composer.
  • Wire profile updates through existing settings IPC actions from both dashboard and runtime thread surfaces.
  • Add unit coverage for profile tier patch generation and enabled model option filtering.

Test Plan

  • Run npm run typecheck
  • Run npm run test:unit -- workbench-prompt-composer
  • Manually verify profile thinking level and model tier edits from the composer UI

🤖 Generated with TiyCode

jorben added 2 commits May 23, 2026 02:16
Add `QuickTierModelSelect` and `QuickThinkingLevelControl` components that allow users to change the agent profile's model and thinking level directly from the composer model selector dropdown, without navigating to the settings panel. The `onUpdateAgentProfile` prop is passed through `DashboardWorkbench` and `RuntimeThreadSurface` to persist changes in real time.

This also includes unit tests for the `getProfileTierPatch` and `getAvailableProfileModelOptions` helper functions.
…t UI

Replace the thinking level control with a slider-style dot selector and move model provider name into the header for improved layout.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 22, 2026

AI Code Review Summary

PR: #199 (feat(composer): ✨ Add profile quick edit controls)
Preferred language: English

Overall Assessment

No blocking issue was detected in the reviewed diff; keep focused regression testing before merge.

Major Findings by Severity

No major issues identified from the reviewed diff.

Actionable Suggestions

  • Verify the look-and-feel of the quick-edit dropdown under heavy load or with a high number of active providers to ensure the scroll container triggers properly.
  • Buddy, ensure that the consumer of onUpdateAgentProfile correctly catches any promise rejections from the IPC layer and displays the composer.profileQuickEditFailed localized message as intended.

Potential Risks

  • Potential unhandled promise rejection if the IPC call updateAgentProfile fails and the consuming child component does not wrap the invocation in a try/catch block.

Test Suggestions

  • Verify that the API update calls (updateAgentProfile) triggered by the UI controls successfully sync state back to the Rust/Tauri backend without unexpected latency.
  • Simulate an IPC failure in updateAgentProfile (e.g., disconnected backend/invalid payload) and verify that the UI properly catches the error and renders 'composer.profileQuickEditFailed'.

File-Level Coverage Notes

  • src/modules/workbench-shell/ui/workbench-prompt-composer.tsx: The changes add a high-quality, interactive mechanism for configuring the active agent profile on-the-fly directly within the prompt composer. Race condition handling using a sequence counter (quickEditRequestIdRef) and active profile ID tracking (activeProfileIdRef) is exceptionally robust. The UI styling and calculations for the slider are flawless. (Great work, Buddy!)
  • src/modules/workbench-shell/ui/workbench-prompt-composer.test.ts: The unit test suite has been updated to cover all the new helper functions. Edge cases such as invalid JSON strings, missing fields, disabled providers/models, and empty inputs are carefully validated. (Unit tests are robust and cover all boundaries, Buddy!)
  • src/modules/workbench-shell/ui/dashboard-workbench.tsx: Looks good, Buddy! The updateAgentProfile action is correctly imported from settings IPC actions and passed down to the sub-component via the onUpdateAgentProfile prop.
  • src/modules/workbench-shell/ui/runtime-thread-surface.tsx: No issues, Buddy! The updateAgentProfile action is wired into the RuntimeThreadSurface and passed down properly.
  • src/i18n/locales/en.ts: Perfectly fine, Buddy! Added the English translation key for profile quick edit failure toast/error message.
  • src/i18n/locales/zh-CN.ts: Perfectly fine, Buddy! Added the Chinese translation key matching the English counterpart for error reporting.

Inline Downgraded Items (processed but not inline)

  • None

Coverage Status

  • Target files: 6
  • Covered files: 6
  • Uncovered files: 0
  • No-patch/binary covered as file-level: 0
  • Findings with unknown confidence (N/A): 0

Uncovered list:

  • None

No-patch covered list:

  • None

Runtime/Budget

  • Rounds used: 1/4
  • Planned batches: 2
  • Executed batches: 2
  • Sub-agent runs: 2
  • Planner calls: 1
  • Reviewer calls: 2
  • Model calls: 3/64
  • Structured-output summary-only degradation: NO

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated PR review completed.

  • Findings kept: 4
  • Findings with unknown confidence: 0
  • Inline comments attempted: 4
  • Target files: 4
  • Covered files: 4
  • Uncovered files: 0
    See the summary comment for detailed analysis and coverage details.

{ label: t("composer.profileTier.auxiliary"), tier: "assistant" },
{ label: t("composer.profileTier.lightweight"), tier: "lite" },
];
const runQuickEdit = async (key: string, patch: ProfileQuickEditPatch) => {

This comment was marked as outdated.


const MODEL_SELECT_NONE_VALUE = "__none__";

function getModelSelectValue(providerId: string, modelRecordId: string) {

This comment was marked as outdated.

return MODEL_SELECT_NONE_VALUE;
}

return JSON.stringify([providerId, modelRecordId]);

This comment was marked as outdated.

{ label: t("composer.profileTier.auxiliary"), tier: "assistant" },
{ label: t("composer.profileTier.lightweight"), tier: "lite" },
];
const runQuickEdit = async (key: string, patch: ProfileQuickEditPatch) => {

This comment was marked as outdated.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated PR review completed.

  • Findings kept: 2
  • Findings with unknown confidence: 0
  • Inline comments attempted: 2
  • Target files: 4
  • Covered files: 4
  • Uncovered files: 0
    See the summary comment for detailed analysis and coverage details.

},
]);
});
});

This comment was marked as outdated.

<div className="absolute left-4 right-4 top-2 h-px bg-app-border/70" />
<div
className="absolute left-4 top-2 h-px bg-app-info/70 transition-all"
style={{ width: selectedIndex > 0 ? `calc((100% - 2rem) * ${selectedIndex / (THINKING_LEVEL_OPTIONS.length - 1)})` : 0 }}

This comment was marked as outdated.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated PR review completed.

  • Findings kept: 1
  • Findings with unknown confidence: 0
  • Inline comments attempted: 1
  • Target files: 4
  • Covered files: 4
  • Uncovered files: 0
    See the summary comment for detailed analysis and coverage details.

/>
<div className="sm:col-span-2">
<QuickThinkingLevelControl
disabled={!canQuickEdit}

This comment was marked as outdated.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated PR review completed.

  • Findings kept: 2
  • Findings with unknown confidence: 0
  • Inline comments attempted: 2
  • Target files: 4
  • Covered files: 4
  • Uncovered files: 0
    See the summary comment for detailed analysis and coverage details.

await onUpdateAgentProfile(targetProfileId, patch);
} catch (error) {
if (activeProfileIdRef.current === targetProfileId && quickEditRequestIdRef.current === requestId) {
setQuickEditError(error instanceof Error ? error.message : t("sourceControl.requestFailed"));

This comment was marked as outdated.

<button
aria-label={`${t("composer.profileThinkingLevel")}: ${getThinkingLevelLabel(option, t)}`}
className="group flex min-w-0 flex-col items-center gap-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-60"
disabled={disabled || isPending || isSelected}

This comment was marked as outdated.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated PR review completed.

  • Findings kept: 0
  • Findings with unknown confidence: 0
  • Inline comments attempted: 1
  • Target files: 6
  • Covered files: 6
  • Uncovered files: 0
    See the summary comment for detailed analysis and coverage details.

Comment thread src/i18n/locales/en.ts
@@ -78,6 +78,7 @@ const en: Record<TranslationKey, string> = {
"composer.activeProfileLabel": "Active Profile",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review completed for this PR diff. No concrete inline issue was selected after aggregation.

@jorben jorben merged commit 64c5966 into master May 23, 2026
4 checks passed
@jorben jorben deleted the feat/profile-update-support branch May 23, 2026 04:16
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