mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-29 22:02:02 +00:00
feat: update branch handling and UI components for worktree management
- Enhanced branch name determination logic in useBoardActions to ensure features created on non-main worktrees are correctly associated with their respective branches. - Improved DevServerLogsPanel styling for better responsiveness and user experience. - Added event hooks support in settings migration and sync processes to maintain consistency across application state. These changes improve the overall functionality and usability of worktree management within the application.
This commit is contained in:
@@ -118,13 +118,14 @@ export function useBoardActions({
|
||||
const workMode = featureData.workMode || 'current';
|
||||
|
||||
// Determine final branch name based on work mode:
|
||||
// - 'current': Use selected worktree branch if available, otherwise undefined (work on main)
|
||||
// - 'current': Use current worktree's branch (or undefined if on main)
|
||||
// - 'auto': Auto-generate branch name based on current branch
|
||||
// - 'custom': Use the provided branch name
|
||||
let finalBranchName: string | undefined;
|
||||
|
||||
if (workMode === 'current') {
|
||||
// If a worktree is selected, use its branch; otherwise work on main (undefined = no branch assignment)
|
||||
// Work directly on current branch - use the current worktree's branch if not on main
|
||||
// This ensures features created on a non-main worktree are associated with that worktree
|
||||
finalBranchName = currentWorktreeBranch || undefined;
|
||||
} else if (workMode === 'auto') {
|
||||
// Auto-generate a branch name based on primary branch (main/master) and timestamp
|
||||
@@ -284,7 +285,8 @@ export function useBoardActions({
|
||||
let finalBranchName: string | undefined;
|
||||
|
||||
if (workMode === 'current') {
|
||||
// If a worktree is selected, use its branch; otherwise work on main (undefined = no branch assignment)
|
||||
// Work directly on current branch - use the current worktree's branch if not on main
|
||||
// This ensures features updated on a non-main worktree are associated with that worktree
|
||||
finalBranchName = currentWorktreeBranch || undefined;
|
||||
} else if (workMode === 'auto') {
|
||||
// Auto-generate a branch name based on primary branch (main/master) and timestamp
|
||||
|
||||
@@ -132,12 +132,12 @@ export function DevServerLogsPanel({
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={(isOpen) => !isOpen && onClose()}>
|
||||
<DialogContent
|
||||
className="w-[70vw] max-w-[900px] max-h-[85vh] flex flex-col gap-0 p-0 overflow-hidden"
|
||||
className="w-full h-full max-w-full max-h-full sm:w-[70vw] sm:max-w-[900px] sm:max-h-[85vh] sm:h-auto sm:rounded-xl rounded-none flex flex-col gap-0 p-0 overflow-hidden"
|
||||
data-testid="dev-server-logs-panel"
|
||||
compact
|
||||
>
|
||||
{/* Compact Header */}
|
||||
<DialogHeader className="shrink-0 px-4 py-2.5 pr-10 border-b border-border/50">
|
||||
<DialogHeader className="shrink-0 px-4 py-3 border-b border-border/50 pr-12">
|
||||
<div className="flex items-center justify-between">
|
||||
<DialogTitle className="flex items-center gap-2 text-base">
|
||||
<Terminal className="w-4 h-4 text-primary" />
|
||||
|
||||
@@ -730,6 +730,8 @@ export function hydrateStoreFromSettings(settings: GlobalSettings): void {
|
||||
worktreePanelCollapsed: settings.worktreePanelCollapsed ?? false,
|
||||
lastProjectDir: settings.lastProjectDir ?? '',
|
||||
recentFolders: settings.recentFolders ?? [],
|
||||
// Event hooks
|
||||
eventHooks: settings.eventHooks ?? [],
|
||||
// Terminal font (nested in terminalState)
|
||||
...(settings.terminalFontFamily && {
|
||||
terminalState: {
|
||||
@@ -808,6 +810,7 @@ function buildSettingsUpdateFromStore(): Record<string, unknown> {
|
||||
lastProjectDir: state.lastProjectDir,
|
||||
recentFolders: state.recentFolders,
|
||||
terminalFontFamily: state.terminalState.fontFamily,
|
||||
eventHooks: state.eventHooks,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -682,6 +682,8 @@ export async function refreshSettingsFromServer(): Promise<boolean> {
|
||||
worktreePanelCollapsed: serverSettings.worktreePanelCollapsed ?? false,
|
||||
lastProjectDir: serverSettings.lastProjectDir ?? '',
|
||||
recentFolders: serverSettings.recentFolders ?? [],
|
||||
// Event hooks
|
||||
eventHooks: serverSettings.eventHooks ?? [],
|
||||
// Terminal settings (nested in terminalState)
|
||||
...((serverSettings.terminalFontFamily || serverSettings.openTerminalMode) && {
|
||||
terminalState: {
|
||||
|
||||
Reference in New Issue
Block a user