Skip to content
Merged
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
93 changes: 93 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# GitHub Copilot Instructions for SpeechDictation-iOS

## Project Context
This is a Swift iOS application for speech recognition and dictation with camera-based object detection and scene description capabilities.

## PR Summary Guidelines

When generating PR summaries, please follow these guidelines:

### 1. Focus Areas
- **Speech Recognition**: Changes to transcription, audio processing, or speech-to-text functionality
- **Camera Integration**: Updates to live camera feed, object detection, or scene description
- **UI/UX**: SwiftUI view changes, accessibility improvements, or user interface updates
- **ML Models**: CoreML model integration, object detection, or scene classification changes
- **Services**: Background services, managers, or data processing components
- **Testing**: Unit tests, UI tests, or build automation improvements

### 2. Summary Structure
```markdown
## Summary
Brief overview of what this PR accomplishes

## Key Changes
- List specific changes made
- Focus on user-facing improvements
- Mention any breaking changes

## Technical Details
- Implementation specifics
- Architecture changes
- Performance impacts

## Testing
- What was tested
- How to verify the changes
```

### 3. Code Pattern Recognition
- **Swift Files**: Identify if changes are to ViewModels, Views, Services, or Models
- **Camera Code**: Recognize AVFoundation, Vision framework, or CoreML changes
- **Speech Code**: Identify Speech framework or audio processing updates
- **UI Code**: SwiftUI view modifications or accessibility improvements

### 4. Impact Assessment
- **Breaking Changes**: Flag any API changes or deprecations
- **Performance**: Note any performance improvements or concerns
- **Accessibility**: Highlight accessibility enhancements
- **User Experience**: Describe user-facing improvements

### 5. Related Issues
- Always link to related GitHub issues
- Reference any bug fixes or feature implementations
- Mention any dependencies or prerequisites

## Example PR Summary Format

```markdown
## 🎯 Summary
Fixed redundant logging and enhanced tap-to-focus functionality in camera module.

## 🔧 Key Changes
- **Logging Optimization**: Implemented state-based logging to reduce console noise by 90%
- **Focus Enhancement**: Added comprehensive debugging for tap-to-focus issues
- **Performance**: Eliminated unnecessary string formatting overhead

## 📱 User Impact
- Cleaner development logs for better debugging experience
- Improved camera focus reliability (debugging added)
- No user-facing changes in this PR

## 🧪 Testing
- ✅ All builds pass
- ✅ Camera focus debugging logs added
- ✅ Logging reduction verified

## 📋 Files Changed
- `Models/YOLOv3Model.swift` - State-based object detection logging
- `Services/CameraSceneDescriptionViewModel.swift` - Frame processing optimization
- `Views/LiveCameraView.swift` - Enhanced focus debugging
```

## Automatic Tagging
Based on file patterns, suggest these labels:
- `swift` - Any .swift file changes
- `ui` - SwiftUI view or UI-related changes
- `camera` - Camera, Vision, or ML model changes
- `speech` - Speech recognition or audio processing
- `testing` - Test file modifications
- `documentation` - README or .md file updates
- `ci/cd` - GitHub Actions or build script changes
- `size/small` - < 50 lines changed
- `size/medium` - 50-200 lines changed
- `size/large` - > 200 lines changed
47 changes: 47 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Pull Request

## Summary
<!-- Copilot: Summarize the changes in this PR -->


## Type of Change
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] 📚 Documentation update
- [ ] 🔧 Configuration change
- [ ] 🎨 UI/UX improvement
- [ ] ⚡ Performance improvement
- [ ] 🧹 Code cleanup/refactoring

## Changes Made
<!-- Copilot: List the key changes made in this PR -->


## Testing
- [ ] Unit tests pass
- [ ] Build succeeds
- [ ] Manual testing completed
- [ ] UI/UX testing completed (if applicable)

## Related Issues
Closes #<!-- issue number -->

## Screenshots/Videos
<!-- If applicable, add screenshots or videos demonstrating the changes -->

## Checklist
- [ ] My code follows the project's coding standards
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published

## Additional Notes
<!-- Any additional information, context, or notes for reviewers -->

---
*This PR template is designed to work with GitHub Copilot for automatic summaries*
123 changes: 123 additions & 0 deletions .github/workflows/pr-summary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: PR Summary with Copilot

on:
pull_request:
types: [opened, synchronize]

jobs:
generate-summary:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate PR Summary
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { context } = require('@actions/github');

// Get PR details
const pr = context.payload.pull_request;
const prNumber = pr.number;
const baseSha = pr.base.sha;
const headSha = pr.head.sha;

// Get the diff
const diff = await github.rest.repos.compareCommits({
owner: context.repo.owner,
repo: context.repo.repo,
base: baseSha,
head: headSha
});

// Get files changed
const files = diff.data.files || [];
const filesList = files.map(file => `- ${file.filename} (+${file.additions}/-${file.deletions})`).join('\n');

// Generate summary comment
const summaryComment = `## 🤖 AI-Generated PR Summary

### Files Changed (${files.length} files)
${filesList}

### Statistics
- **Additions:** ${diff.data.ahead_by} commits ahead
- **Files modified:** ${files.length}
- **Total changes:** +${files.reduce((acc, f) => acc + f.additions, 0)} / -${files.reduce((acc, f) => acc + f.deletions, 0)}

### Key Changes
${files.map(file => {
const ext = file.filename.split('.').pop();
let category = '📄 Other';
if (['swift', 'kt', 'java', 'js', 'ts', 'py'].includes(ext)) category = '💻 Code';
if (['md', 'txt', 'rst'].includes(ext)) category = '📚 Documentation';
if (['yml', 'yaml', 'json', 'xml'].includes(ext)) category = '⚙️ Configuration';
if (['png', 'jpg', 'svg', 'gif'].includes(ext)) category = '🎨 Assets';
return \`\${category} \${file.filename}\`;
}).join('\\n')}

### Impact Analysis
${files.some(f => f.filename.includes('test')) ? '✅ Includes test changes' : '⚠️ No test files modified'}
${files.some(f => f.filename.includes('.md')) ? '📖 Documentation updated' : ''}
${files.some(f => f.filename.includes('package.json') || f.filename.includes('.xcodeproj')) ? '📦 Dependencies or project configuration changed' : ''}

---
*Generated automatically by GitHub Actions*`;

// Post comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: summaryComment
});

- name: Add PR Labels
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { context } = require('@actions/github');
const pr = context.payload.pull_request;

// Get files changed
const diff = await github.rest.repos.compareCommits({
owner: context.repo.owner,
repo: context.repo.repo,
base: pr.base.sha,
head: pr.head.sha
});

const files = diff.data.files || [];
const labels = [];

// Auto-assign labels based on files changed
if (files.some(f => f.filename.includes('test'))) labels.push('testing');
if (files.some(f => f.filename.includes('.md'))) labels.push('documentation');
if (files.some(f => f.filename.includes('.swift'))) labels.push('swift');
if (files.some(f => f.filename.includes('UI') || f.filename.includes('View'))) labels.push('ui');
if (files.some(f => f.filename.includes('Service') || f.filename.includes('Manager'))) labels.push('backend');
if (files.some(f => f.filename.includes('.yml') || f.filename.includes('.yaml'))) labels.push('ci/cd');

// Add size label
const totalChanges = files.reduce((acc, f) => acc + f.additions + f.deletions, 0);
if (totalChanges < 50) labels.push('size/small');
else if (totalChanges < 200) labels.push('size/medium');
else labels.push('size/large');

if (labels.length > 0) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
labels: labels
});
}
Loading
Loading