Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/browser/components/ChatInput/CreationControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ export function CreationControls(props: CreationControlsProps) {
const availabilityMap =
runtimeAvailabilityState.status === "loaded" ? runtimeAvailabilityState.data : null;
const showTrunkBranchSelector = props.branches.length > 0 && runtimeMode !== RUNTIME_MODE.LOCAL;
// Show loading skeleton while branches are loading to avoid layout flash
const showBranchLoadingPlaceholder = !props.branchesLoaded && runtimeMode !== RUNTIME_MODE.LOCAL;

// Centralized devcontainer selection logic
const devcontainerSelection = resolveDevcontainerSelection({
Expand Down Expand Up @@ -498,6 +500,13 @@ export function CreationControls(props: CreationControlsProps) {
/>
</div>
)}
{/* Loading placeholder - reserves space while branches load to avoid layout flash */}
{showBranchLoadingPlaceholder && (
<div className="flex items-center gap-2">
<span className="text-muted-foreground text-xs">from</span>
<div className="bg-bg-dark/50 h-7 w-24 animate-pulse rounded-md" />
</div>
)}

{/* SSH Host Input - hidden when Coder is enabled */}
{selectedRuntime.mode === "ssh" && !props.coderProps?.enabled && (
Expand Down
3 changes: 2 additions & 1 deletion src/browser/hooks/useDraftWorkspaceSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,11 @@ export function useDraftWorkspaceSettings(

// When the user switches into SSH/Docker/Devcontainer mode, seed the field with the remembered config.
// This avoids clearing the last values when the UI switches modes with an empty field.
// Skip on initial mount (prevMode === null) since useState initializer handles that case.
const prevSelectedRuntimeModeRef = useRef<RuntimeMode | null>(null);
useEffect(() => {
const prevMode = prevSelectedRuntimeModeRef.current;
if (prevMode !== selectedRuntime.mode) {
if (prevMode !== null && prevMode !== selectedRuntime.mode) {
if (selectedRuntime.mode === RUNTIME_MODE.SSH) {
const needsHostRestore = !selectedRuntime.host.trim() && lastSshHost.trim();
const needsCoderRestore =
Expand Down
Loading