-
Notifications
You must be signed in to change notification settings - Fork 0
Development Guide
Klein Panic edited this page Apr 3, 2026
·
1 revision
CS3704-Canvas-Project/
├── src/canvas_tui/ # Application source
│ ├── api.py # Canvas API client
│ ├── app.py # Textual app orchestration
│ ├── cache.py # SQLite persistence
│ ├── cli.py # Command-line interface
│ ├── config.py # Configuration management
│ ├── models.py # Data models
│ ├── state.py # Application state
│ ├── screens/ # TUI screens
│ │ ├── dashboard.py
│ │ ├── courses.py
│ │ ├── grades.py
│ │ └── ...
│ └── widgets/ # Reusable components
│ ├── charts.py
│ ├── command_bar.py
│ └── ...
├── tests/ # Test suite
├── docs/ # Architecture docs
├── docs-site/ # MkDocs source
└── .github/ # Workflows and templates
- Formatter: Ruff (Black-compatible)
- Line length: 88 characters
-
Imports: sorted with
isort - Type hints: encouraged (checked by mypy)
ruff check src tests
ruff format src testsmypy src/canvas_tuipytest -q
pytest --cov=canvas_tui-
main— protected, production code -
feature/*— new features -
fix/*— bug fixes -
chore/*— maintenance
All commits to protected branches must be GPG signed.
git config commit.gpgsign true- Create feature branch from
main - Make changes and commit
- Push to origin
- Open PR
- Ensure CI passes
- Request review
- Merge when approved
- Create file in
src/canvas_tui/screens/ - Inherit from
Screen - Define
compose()method - Add navigation in
app.py - Add tests in
tests/
Example:
from textual.app import ComposeResult
from textual.widgets import Static
from textual.screen import Screen
class MyScreen(Screen):
def compose(self) -> ComposeResult:
yield Static("My Screen")- Add method to
api.py - Add corresponding model in
models.py - Add cache support in
cache.py - Add unit tests
- Place in
tests/directory - Use
pytestfixtures - Mock external API calls
- Aim for >80% coverage
- Use Canvas sandbox if available
- Test offline cache behavior
- Verify error handling
- Merge PRs to
main - CI automatically:
- Runs tests
- Builds package
- Creates snapshot release
- For stable releases, create a tag
- Update
README.mdfor user-facing changes - Update
docs-site/for architecture changes - Update wiki for workflow changes