mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-05 21:43:07 +00:00
fix: enhance commit messages and sidebar scroll visibility
Fix #689: Improve auto-generated commit message quality - Add generateCommitMessage() method that includes description summary - Include first 5 lines of feature description (up to 300 chars) - Add git diff stats to provide file change context - Commit messages now reflect the actual scope of work performed - Maintains backward compatibility with fallback for missing features Fix #601: Improve scroll indicator visibility on small screens - Enhanced scroll indicator with gradient fade effect - Show indicator on both expanded and collapsed sidebar states - Added "Scroll" text label for better discoverability - More prominent brand-colored chevron with animation - Prevents Project Settings from being hidden on smaller laptop screens Both fixes improve user experience without breaking existing functionality. Test results: All 1,421 server tests pass
This commit is contained in:
@@ -2657,10 +2657,8 @@ Address the follow-up instructions above. Review the previous work and make the
|
|||||||
// Load feature for commit message
|
// Load feature for commit message
|
||||||
const feature = await this.loadFeature(projectPath, featureId);
|
const feature = await this.loadFeature(projectPath, featureId);
|
||||||
const commitMessage = feature
|
const commitMessage = feature
|
||||||
? `feat: ${this.extractTitleFromDescription(
|
? await this.generateCommitMessage(feature, workDir)
|
||||||
feature.description
|
: `feat: Feature ${featureId}\n\nImplemented by Automaker auto-mode`;
|
||||||
)}\n\nImplemented by Automaker auto-mode`
|
|
||||||
: `feat: Feature ${featureId}`;
|
|
||||||
|
|
||||||
// Determine which files to stage
|
// Determine which files to stage
|
||||||
// For feature branches, only stage files changed on this branch to avoid committing unrelated changes
|
// For feature branches, only stage files changed on this branch to avoid committing unrelated changes
|
||||||
@@ -3896,6 +3894,58 @@ Format your response as a structured markdown document.`;
|
|||||||
return firstLine.substring(0, 57) + '...';
|
return firstLine.substring(0, 57) + '...';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate a comprehensive commit message for a feature
|
||||||
|
* Includes title, description summary, and file statistics
|
||||||
|
*/
|
||||||
|
private async generateCommitMessage(feature: Feature, workDir: string): Promise<string> {
|
||||||
|
const title = this.extractTitleFromDescription(feature.description);
|
||||||
|
|
||||||
|
// Extract description summary (first 3-5 lines, up to 300 chars)
|
||||||
|
let descriptionSummary = '';
|
||||||
|
if (feature.description && feature.description.trim()) {
|
||||||
|
const lines = feature.description.split('\n').filter((l) => l.trim());
|
||||||
|
const summaryLines = lines.slice(0, 5); // First 5 non-empty lines
|
||||||
|
descriptionSummary = summaryLines.join('\n');
|
||||||
|
|
||||||
|
// Limit to 300 characters
|
||||||
|
if (descriptionSummary.length > 300) {
|
||||||
|
descriptionSummary = descriptionSummary.substring(0, 297) + '...';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get file statistics to add context
|
||||||
|
let fileStats = '';
|
||||||
|
try {
|
||||||
|
const { stdout: diffStat } = await execAsync('git diff --cached --stat', { cwd: workDir });
|
||||||
|
if (diffStat.trim()) {
|
||||||
|
// Extract just the summary line (last line with file count)
|
||||||
|
const statLines = diffStat.trim().split('\n');
|
||||||
|
const summaryLine = statLines[statLines.length - 1];
|
||||||
|
if (summaryLine && summaryLine.includes('file')) {
|
||||||
|
fileStats = `\n${summaryLine.trim()}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// Ignore errors getting stats
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build commit message
|
||||||
|
let message = `feat: ${title}`;
|
||||||
|
|
||||||
|
if (descriptionSummary && descriptionSummary !== title) {
|
||||||
|
message += `\n\n${descriptionSummary}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fileStats) {
|
||||||
|
message += fileStats;
|
||||||
|
}
|
||||||
|
|
||||||
|
message += '\n\nImplemented by Automaker auto-mode';
|
||||||
|
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the planning prompt prefix based on feature's planning mode
|
* Get the planning prompt prefix based on feature's planning mode
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -405,9 +405,28 @@ export function Sidebar() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Scroll indicator - shows there's more content below */}
|
{/* Scroll indicator - shows there's more content below */}
|
||||||
{canScrollDown && sidebarOpen && (
|
{canScrollDown && (
|
||||||
<div className="flex justify-center py-1 border-t border-border/30">
|
<div
|
||||||
<ChevronDown className="w-4 h-4 text-muted-foreground/50 animate-bounce" />
|
className={cn(
|
||||||
|
'relative flex justify-center py-2 border-t border-border/30',
|
||||||
|
'bg-gradient-to-t from-background via-background/95 to-transparent',
|
||||||
|
'-mt-8 pt-8',
|
||||||
|
'pointer-events-none'
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<div className="pointer-events-auto flex flex-col items-center gap-0.5">
|
||||||
|
<ChevronDown
|
||||||
|
className={cn(
|
||||||
|
'w-4 h-4 text-brand-500/70 animate-bounce',
|
||||||
|
sidebarOpen ? 'block' : 'w-3 h-3'
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
{sidebarOpen && (
|
||||||
|
<span className="text-[10px] font-medium text-muted-foreground/70 uppercase tracking-wide">
|
||||||
|
Scroll
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user