fix: move hidden input off-screen and fix branch loading

- Move terminal hidden input to off-screen position (-9999px) to prevent
  text selection/caret visibility on mobile
- Add user-select: none to prevent any selection UI
- Fix create-session-form to use new listRepositoryBranches API signature
  (projectId, repoId) and access response.branches/default_branch
This commit is contained in:
Fusion
2026-05-24 12:11:53 +02:00
parent f2fed518f0
commit 06fe8623bc
2 changed files with 13 additions and 11 deletions
@@ -73,19 +73,19 @@ export const CreateSessionForm = ({
// Load branches when selected repo changes
useEffect(() => {
if (!selectedRepo || !showCloneMode) {
const projectId = fixedProjectId || selectedProject;
if (!selectedRepo || !projectId || !showCloneMode) {
setBranches([]);
return;
}
const loadBranches = async () => {
setIsLoadingBranches(true);
try {
const branchList = await listRepositoryBranches(selectedRepo);
setBranches(branchList);
const defaultBranch = branchList.find((b) => b.is_default);
if (defaultBranch) {
setBranch(defaultBranch.name);
setBaseBranch(defaultBranch.name);
const response = await listRepositoryBranches(projectId, selectedRepo);
setBranches(response.branches);
if (response.default_branch) {
setBranch(response.default_branch);
setBaseBranch(response.default_branch);
}
} catch {
// ignore
@@ -94,7 +94,7 @@ export const CreateSessionForm = ({
}
};
void loadBranches();
}, [selectedRepo, showCloneMode]);
}, [selectedRepo, selectedProject, fixedProjectId, showCloneMode]);
// Filter repositories by selected project
const availableRepos = selectedProject
+5 -3
View File
@@ -3152,13 +3152,15 @@ a.nav-item,
}
.terminal-hidden-input {
position: absolute;
bottom: 0;
left: 0;
position: fixed;
left: -9999px;
top: -9999px;
width: 1px;
height: 1px;
opacity: 0;
pointer-events: none;
user-select: none;
-webkit-user-select: none;
}
/* Disable zoom on mobile terminal */