-
-
Notifications
You must be signed in to change notification settings - Fork 4
✨ Set up Copilot instructions for ScanBridge repository #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Copilot
wants to merge
7
commits into
main
Choose a base branch
from
copilot/fix-c5e98c7b-7970-426f-b524-9874e3c04b83
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
daee315
Initial plan
Copilot 48623d8
Initial analysis and plan for Copilot instructions setup
Copilot e3c5771
✨ Add comprehensive Copilot instructions for ScanBridge
Copilot 09b10e7
Update .gitignore
Chrisimx 64f45eb
Apply suggestion from @Copilot
Chrisimx 7eb6b96
Update .github/copilot-instructions.md
Chrisimx c6e6c12
Update .github/copilot-instructions.md
Chrisimx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,145 @@ | ||
| # Copilot Instructions for ScanBridge | ||
|
|
||
| ## Project Overview | ||
|
|
||
| ScanBridge is an Android scanning application written in Kotlin using Jetpack Compose and Material You design. The app enables users to scan documents over the AirScan/eSCL protocol using network scanners. | ||
|
|
||
| ### Key Technologies | ||
| - **Language**: Kotlin | ||
| - **UI Framework**: Jetpack Compose with Material 3 | ||
| - **Build System**: Gradle with Kotlin DSL | ||
| - **Target**: Android (API 35) | ||
| - **Architecture**: Modern Android architecture with ViewModels, Compose UI | ||
| - **Protocol**: eSCL/AirScan for scanner communication | ||
|
|
||
| ## Development Guidelines | ||
|
|
||
| ### Code Style and Formatting | ||
| - Use **ktlint** for Kotlin code formatting (version 1.5.0) | ||
| - Follow the `.editorconfig` configuration | ||
| - Run `./ktlint --editorconfig=./.editorconfig` to check formatting | ||
Chrisimx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - Code should follow Material Design 3 patterns for UI components | ||
|
|
||
| ### Project Structure | ||
| ``` | ||
| app/src/main/java/io/github/chrisimx/scanbridge/ | ||
| ├── data/model/ # Data models (e.g., PaperFormat) | ||
| ├── stores/ # Data stores and repositories | ||
| ├── theme/ # UI theme configuration (Typography, colors) | ||
| ├── uicomponents/ # Reusable UI components | ||
| │ └── dialog/ # Dialog components | ||
| └── util/ # Utility classes | ||
| ``` | ||
|
|
||
| ### Building and Testing | ||
|
|
||
| #### Build Commands | ||
| - `./gradlew assembleDebug` - Build debug APK | ||
| - `./gradlew assembleRelease` - Build release APK | ||
| - `./gradlew test` - Run unit tests | ||
| - `./gradlew connectedAndroidTest` - Run instrumentation tests | ||
|
|
||
| #### CI/CD | ||
| - GitHub Actions run on every push/PR to main branch | ||
| - Build process includes APK creation and signing | ||
| - Formatting is checked automatically with ktlint | ||
| - Tests must pass before merging | ||
|
|
||
| ### Coding Conventions | ||
|
|
||
| #### File Headers | ||
| All Kotlin files should include the GPL-3.0 license header: | ||
| ```kotlin | ||
| /* | ||
| * Copyright (C) 2024-2025 Christian Nagel and contributors | ||
| * | ||
| * This file is part of ScanBridge. | ||
| * | ||
| * ScanBridge is free software: you can redistribute it and/or modify it under the terms of | ||
| * the GNU General Public License as published by the Free Software Foundation, either | ||
| * version 3 of the License, or (at your option) any later version. | ||
| * | ||
| * ScanBridge is distributed in the hope that it will be useful, but WITHOUT ANY | ||
| * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
| * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License along with eSCLKt. | ||
Chrisimx marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * If not, see <https://www.gnu.org/licenses/>. | ||
| * | ||
| * SPDX-License-Identifier: GPL-3.0-or-later | ||
| */ | ||
| ``` | ||
|
|
||
| #### Package Structure | ||
| - Use the base package: `io.github.chrisimx.scanbridge` | ||
| - Follow standard Android package organization | ||
| - Group related functionality in appropriate subpackages | ||
|
|
||
| #### Compose UI Guidelines | ||
| - Use Material 3 components and theming | ||
| - Leverage custom typography defined in `theme/Typography.kt` | ||
| - Use `@OptIn(ExperimentalMaterial3ExpressiveApi::class)` when needed | ||
| - Follow proper state management patterns with `remember` and `mutableStateOf` | ||
|
|
||
| ### Dependencies and Libraries | ||
| - **Compose BOM**: For Jetpack Compose components | ||
| - **Material 3**: For UI components and theming | ||
| - **eSCLKt**: For scanner communication (custom library) | ||
Chrisimx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - **Kotlinx Serialization**: For data serialization | ||
| - **Timber**: For logging | ||
| - **OkHttp**: For HTTP communications | ||
|
|
||
| ### Testing | ||
| - Unit tests in `app/src/test/java/` | ||
| - Instrumentation tests in `app/src/androidTest/java/` | ||
| - Test files follow the pattern: `*Test.kt` | ||
| - Use descriptive test method names | ||
|
|
||
| ### Documentation | ||
| - Update `CHANGELOG.md` for notable changes following [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format | ||
| - Maintain clear commit messages in imperative form | ||
| - Reference issue numbers in commits when applicable | ||
| - Code comments should explain complex business logic, not obvious code | ||
|
|
||
| ### Contributing | ||
| - Fork the repository and create feature branches | ||
| - Ensure GPG-signed commits when possible | ||
| - Follow the guidelines in `CONTRIBUTING.md` | ||
| - Be respectful and considerate in all interactions | ||
| - Submit detailed bug reports and feature requests | ||
Chrisimx marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Security and Licensing | ||
| - This is GPL-3.0-or-later licensed software | ||
| - Do not introduce dependencies with incompatible licenses | ||
| - Be mindful of scanner security when handling network communications | ||
| - Follow Android security best practices | ||
|
|
||
| ### Scanner Support | ||
| - The app supports eSCL/AirScan protocol scanners | ||
| - Focus on broad scanner compatibility | ||
| - Handle various paper formats and scanning capabilities | ||
| - Support features like duplex scanning, resolution settings, and input sources | ||
|
|
||
| ## Common Patterns | ||
|
|
||
| ### UI Components | ||
| ```kotlin | ||
| @Composable | ||
| fun MyComponent(parameter: String, onAction: () -> Unit) { | ||
| // Use Material 3 components | ||
| // Follow established theming patterns | ||
| // Handle state properly with remember/mutableStateOf | ||
| } | ||
| ``` | ||
|
|
||
| ### Error Handling | ||
| - Use proper exception handling for scanner communications | ||
| - Provide user-friendly error messages | ||
| - Log errors appropriately with Timber | ||
|
|
||
| ### State Management | ||
| - Use ViewModels for business logic | ||
| - Compose UI should be stateless when possible | ||
| - Handle configuration changes properly | ||
|
|
||
| When contributing to ScanBridge, focus on maintaining the clean architecture, following Material Design principles, and ensuring broad scanner compatibility. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,4 +14,5 @@ cache | |
| app/src/androidTest/native-libs | ||
| /kls_database.db | ||
| /app/debug | ||
| /app/release | ||
| /app/release | ||
| ktlint | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.