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:
@@ -73,19 +73,19 @@ export const CreateSessionForm = ({
|
|||||||
|
|
||||||
// Load branches when selected repo changes
|
// Load branches when selected repo changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!selectedRepo || !showCloneMode) {
|
const projectId = fixedProjectId || selectedProject;
|
||||||
|
if (!selectedRepo || !projectId || !showCloneMode) {
|
||||||
setBranches([]);
|
setBranches([]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const loadBranches = async () => {
|
const loadBranches = async () => {
|
||||||
setIsLoadingBranches(true);
|
setIsLoadingBranches(true);
|
||||||
try {
|
try {
|
||||||
const branchList = await listRepositoryBranches(selectedRepo);
|
const response = await listRepositoryBranches(projectId, selectedRepo);
|
||||||
setBranches(branchList);
|
setBranches(response.branches);
|
||||||
const defaultBranch = branchList.find((b) => b.is_default);
|
if (response.default_branch) {
|
||||||
if (defaultBranch) {
|
setBranch(response.default_branch);
|
||||||
setBranch(defaultBranch.name);
|
setBaseBranch(response.default_branch);
|
||||||
setBaseBranch(defaultBranch.name);
|
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
// ignore
|
// ignore
|
||||||
@@ -94,7 +94,7 @@ export const CreateSessionForm = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
void loadBranches();
|
void loadBranches();
|
||||||
}, [selectedRepo, showCloneMode]);
|
}, [selectedRepo, selectedProject, fixedProjectId, showCloneMode]);
|
||||||
|
|
||||||
// Filter repositories by selected project
|
// Filter repositories by selected project
|
||||||
const availableRepos = selectedProject
|
const availableRepos = selectedProject
|
||||||
|
|||||||
@@ -3152,13 +3152,15 @@ a.nav-item,
|
|||||||
}
|
}
|
||||||
|
|
||||||
.terminal-hidden-input {
|
.terminal-hidden-input {
|
||||||
position: absolute;
|
position: fixed;
|
||||||
bottom: 0;
|
left: -9999px;
|
||||||
left: 0;
|
top: -9999px;
|
||||||
width: 1px;
|
width: 1px;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
user-select: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Disable zoom on mobile terminal */
|
/* Disable zoom on mobile terminal */
|
||||||
|
|||||||
Reference in New Issue
Block a user