Skip to content

Commit c34e753

Browse files
committed
Complete PR consolidation: Unified codebase from all open PRs
This commit consolidates all open PRs into a single, cohesive codebase: Consolidated PRs: - PR #1: Refactor, clean up, and improve app functionality - PR #7: PyScript and dependency refactoring - PR #8: ESLint fixes and comprehensive modernization (BASE) - PR #10: Reverse merge resolution - PR #12, #14, #15: Snyk security updates (element-plus upgrade) - PR #18: Current copilot improvements Key features integrated: ✅ PyScript 2025.5.1 with Pyodide 0.26.1 ✅ ESLint 9.x flat config migration ✅ Element Plus v2.10.4+ (latest security updates) ✅ Comprehensive CI/CD pipeline ✅ Modern Vue 3 + TypeScript structure ✅ JavaScript-Python interop improvements ✅ Security vulnerability fixes ✅ Build system optimization ✅ Comprehensive documentation (copilot-instructions.md, TODO.md) All branches ready for deletion after master update.
1 parent eb5692c commit c34e753

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+4916
-4433
lines changed
Lines changed: 52 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,52 @@
1-
name: Azure Static Web Apps CI/CD
2-
3-
on:
4-
push:
5-
branches:
6-
- master
7-
pull_request:
8-
types: [opened, synchronize, reopened, closed]
9-
branches:
10-
- master
11-
12-
jobs:
13-
build_and_deploy_job:
14-
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
15-
runs-on: ubuntu-latest
16-
name: Build and Deploy Job
17-
steps:
18-
- uses: actions/checkout@v4
19-
with:
20-
submodules: true
21-
lfs: false
22-
23-
- name: Build And Deploy
24-
id: builddeploy
25-
uses: Azure/static-web-apps-deploy@v1
26-
with:
27-
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_THANKFUL_MUSHROOM_08ECC5D1E }}
28-
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
29-
action: "upload"
30-
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
31-
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
32-
app_location: "/" # App source code path
33-
api_location: "" # Api source code path - optional
34-
output_location: "dist" # Built app content directory - optional
35-
###### End of Repository/Build Configurations ######
36-
37-
close_pull_request_job:
38-
if: github.event_name == 'pull_request' && github.event.action == 'closed'
39-
runs-on: ubuntu-latest
40-
name: Close Pull Request Job
41-
steps:
42-
- name: Close Pull Request
43-
id: closepullrequest
44-
uses: Azure/static-web-apps-deploy@v1
45-
with:
46-
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_THANKFUL_MUSHROOM_08ECC5D1E }}
47-
action: "close"
1+
name: Azure Static Web Apps CI/CD
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [opened, synchronize, reopened, closed]
9+
branches:
10+
- master
11+
12+
jobs:
13+
build_and_deploy_job:
14+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
15+
runs-on: ubuntu-latest
16+
name: Build and Deploy Job
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: true
21+
lfs: false
22+
23+
- name: Fix git config permissions
24+
run: |
25+
sudo chown -R $(whoami) .git
26+
sudo chmod -R u+w .git
27+
28+
- name: Build And Deploy
29+
id: builddeploy
30+
uses: Azure/static-web-apps-deploy@v1
31+
with:
32+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_THANKFUL_MUSHROOM_08ECC5D1E }}
33+
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
34+
action: 'upload'
35+
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
36+
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
37+
app_location: '/' # App source code path
38+
api_location: '' # Api source code path - optional
39+
output_location: 'dist' # Built app content directory - optional
40+
###### End of Repository/Build Configurations ######
41+
42+
close_pull_request_job:
43+
if: github.event_name == 'pull_request' && github.event.action == 'closed'
44+
runs-on: ubuntu-latest
45+
name: Close Pull Request Job
46+
steps:
47+
- name: Close Pull Request
48+
id: closepullrequest
49+
uses: Azure/static-web-apps-deploy@v1
50+
with:
51+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_THANKFUL_MUSHROOM_08ECC5D1E }}
52+
action: 'close'

.github/workflows/build.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI Checks and Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
jobs:
11+
validate-and-build:
12+
name: Validate and Build
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20.x' # Matches @tsconfig/node20
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Check formatting
27+
run: npm run format:check
28+
29+
- name: Lint code
30+
run: npm run lint -- --no-fix # Ensure lint fails on error, not trying to fix in CI
31+
32+
- name: Type check
33+
run: npm run type-check
34+
35+
- name: Build project
36+
run: npm run build

.github/workflows/sonarcloud.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ name: SonarCloud analysis
3030

3131
on:
3232
push:
33-
branches: [ "master" ]
33+
branches: ['master']
3434
pull_request:
35-
branches: [ "master" ]
35+
branches: ['master']
3636
workflow_dispatch:
3737

3838
permissions:
@@ -49,7 +49,7 @@ jobs:
4949
# uses: SonarSource/sonarcloud-github-action@v2.2.0
5050
uses: SonarSource/sonarcloud-github-action@4006f663ecaf1f8093e8e4abb9227f6041f52216
5151
env:
52-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret)
52+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret)
5353
with:
5454
# Additional arguments for the SonarScanner CLI
5555
args:

.prettierrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"trailingComma": "none",
88
"htmlWhitespaceSensitivity": "ignore",
99
"bracketSameLine": true,
10-
"no-bracket-spacing": true
11-
}
10+
"bracketSpacing": false
11+
}

.stylelintrc.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
2-
"extends": [
3-
"stylelint-config-recommended",
4-
"stylelint-config-standard-scss"
5-
],
2+
"extends": ["stylelint-config-recommended", "stylelint-config-standard-scss"],
63
"rules": {
74
"scss/no-global-function-names": {
85
"ignoreFunctions": ["darken"]

.vscode/extensions.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
{
2-
"recommendations": [
3-
"Vue.volar",
4-
"dbaeumer.vscode-eslint",
5-
"esbenp.prettier-vscode"
6-
]
2+
"recommendations": ["Vue.volar", "dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
73
}

FUTURE_WORK.md

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Future Work & Roadmap for Bleedy.py
2+
3+
This document outlines planned enhancements, refactoring tasks, and feature ideas for the Bleedy.py application. It consolidates items from previous analysis, `TODO.md`, and user requests.
4+
5+
## Phase 1 Completion Notes
6+
7+
Phase 1 focused on initial stabilization:
8+
9+
- PyScript modernized to `2025.5.1`, Pyodide pinned to `0.26.1`.
10+
- PyScript loading splashscreen added.
11+
- Placeholder for PyScript version check hook created.
12+
- JS-PyScript communication refactored (event-based, no DOM polling for results).
13+
- Basic code cleanup (default bleed, removed dead components/deps).
14+
- Initial plan for sketchy UI library overhaul documented in `TODO.md`.
15+
- CI pipeline now runs lint, format check, type check, and build.
16+
- Local ESLint config updated to flat config, Prettier config corrected.
17+
18+
## I. Core Infrastructure & Stability
19+
20+
### 1. Sketchy UI Libraries Overhaul (High Priority)
21+
22+
- **Objective:** Stabilize or replace the aging sketchy UI libraries to ensure long-term maintainability and remove current patching needs.
23+
- **Tasks (details in `TODO.md`):**
24+
- **Fork `wired-elements`:** Create an internal, maintained fork (`bleedy-wired-elements`).
25+
- Apply existing patch: `patches/wired-elements@3.0.0-rc.6.patch`.
26+
- Audit and refactor components to use `Rough.js 4.6.6+` API correctly.
27+
- Goal: Eliminate the need for `patches/roughjs@4.6.6.patch`.
28+
- Review and update Lit/LitElement dependencies if outdated.
29+
- **Address `DoodleCSS` and `paper-css`:**
30+
- Manually verify current maintenance status.
31+
- If unmaintained/problematic: Absorb styles into project, find alternatives, or replicate effects.
32+
- **Ultimate Goal:** Remove all files from `patches/` and the `npm.patchedDependencies` section in `package.json`.
33+
34+
### 2. PyScript Enhancements
35+
36+
- **Full Pre-commit Hook:** Implement and test `scripts/check-pyscript-version.sh` with Husky for robust PyScript version management.
37+
- **Zipping in Python:** Research and potentially implement image zipping using Python within PyScript (`zipfile` module) if it offers significant advantages over client-side JS `jszip` (e.g., performance, bundle size reduction).
38+
39+
### 3. Comprehensive Testing Strategy (Very High Priority)
40+
41+
- **Objective:** Achieve robust test coverage to ensure code quality and prevent regressions.
42+
- **Tasks:**
43+
- **Unit Testing (Vitest):**
44+
- Write comprehensive unit tests for all Vue components (props, events, slots, logic).
45+
- Test all composables (`useImageDownload`, any new ones).
46+
- Test utility functions and configurations.
47+
- Configure and enforce code coverage reporting in CI.
48+
- **Integration Testing (Vitest):** Test interactions between key components (e.g., `ImageProcessor` and its steps, JS-PyScript interop mocks).
49+
- **E2E Testing (Playwright or Cypress - select one):**
50+
- Set up the chosen framework.
51+
- Create E2E tests for all critical user flows.
52+
- **Python Code Testing:**
53+
- Research and implement best practices for testing PyScript's Python code (e.g., `add_bleed` function). This might involve extracting logic or using Pyodide's testing utilities if available.
54+
- **Visual Regression Testing:** Implement tools (e.g., Percy, Applitools, or Playwright-based) to catch unintended UI changes, especially important for the sketchy aesthetic.
55+
- **CI Integration:** Ensure all test suites run in CI (`ci.yml`) and fail the build on test failures.
56+
57+
## II. Documentation & Developer Experience
58+
59+
### 1. Enhanced Project Documentation
60+
61+
- **Themed README.md:**
62+
- Rebuild `README.md` using `othneildrew/Best-README-Template` as a structural base.
63+
- Apply hand-drawn/sketchy styling using embedded HTML/CSS (if feasible and renders well on GitHub).
64+
- Content: Detailed project description, features, full tech stack overview, File System Access API usage (privacy benefits), PyScript interaction model, clear setup/build/run/test instructions, license.
65+
- **`ARCHITECTURE.md`:** Create a detailed document (or merge into README) covering:
66+
- Vue component hierarchy and data flow.
67+
- PyScript integration details (event system, `bleedy_interop.js`).
68+
- Strategy and current status of sketchy UI libraries.
69+
- **`LICENSE`:** Ensure MIT license file is present and correctly referenced.
70+
- **`CONTRIBUTING.md`:** Generate and customize guidelines for contributions.
71+
- **Inline Comments:** Continue to enhance comments for complex logic, public APIs of components/modules.
72+
73+
## III. UI/UX Refinements & Features
74+
75+
### 1. UI Consistency & Bug Fixing
76+
77+
- Address any identified UI bugs, quirks, or inconsistencies (e.g., stepper button states, visual harmony between Element Plus and sketchy elements after sketchy library overhaul).
78+
- Ensure all interactive elements are highly responsive and provide clear feedback.
79+
80+
### 2. Accessibility (A11y)
81+
82+
- Conduct a full A11y audit against WCAG guidelines.
83+
- Remediate all identified issues: keyboard navigation, focus states, ARIA attributes, color contrast, screen reader compatibility for all components, including custom/sketchy ones.
84+
85+
### 3. PWA (Progressive Web App)
86+
87+
- Investigate feasibility and implement basic PWA features:
88+
- Web App Manifest.
89+
- Service Worker for caching assets and basic offline capabilities (app shell).
90+
- Refer to PyScript documentation on offline usage.
91+
92+
### 4. User-Facing Error Handling
93+
94+
- Implement a system for clear, user-friendly, and thematically styled error messages for:
95+
- PyScript initialization failures.
96+
- Python processing errors.
97+
- File validation issues.
98+
- Network issues (if any parts become network-dependent).
99+
100+
### 5. File Handling Enhancements
101+
102+
- **Image Previews:** Verify and enhance image previews in the `ImageSelection.vue` step.
103+
- **Advanced File Validation:**
104+
- Client-side: Prevent selection of non-image files more robustly.
105+
- Client-side: Detect and warn about animated GIFs (which might process unexpectedly).
106+
- Client-side: Warn about excessively large file sizes or too many files, suggesting potential performance issues.
107+
- **Session Persistence:**
108+
- Use File System Access API and IndexedDB to store `FileSystemFileHandle` objects of selected files.
109+
- Allow users to resume previous sessions or quickly re-select files.
110+
111+
### 6. Processing Enhancements
112+
113+
- **Cancel Processing:** Implement a robust cancellation mechanism for ongoing image processing.
114+
- Define behavior: Cancel current image and continue? Cancel all remaining?
115+
- Ensure progress is correctly updated and potentially allow retry for skipped/failed images.
116+
117+
## IV. Future Feature Exploration (Longer Term)
118+
119+
These items require more research and design before implementation.
120+
121+
- **Advanced Bleed Options:**
122+
- Different bleed generation techniques (e.g., pixel stretch, content-aware fill via AI APIs, solid color).
123+
- Per-edge bleed amounts.
124+
- Intuitive unit conversions for bleed (mm, inches, pixels) based on target DPI.
125+
- **Image Transformations:** Pre-bleed options like resize, crop.
126+
- **Image Management:**
127+
- Deduplication of selected images.
128+
- OCR on filenames or image content for pattern recognition and auto-sorting/batching.
129+
- **Technology Watch:**
130+
- Keep updated on new PyScript versions and features.
131+
- Monitor for new/better sketchy UI libraries or techniques.
132+
- Explore potential for AI-assisted image manipulation (e.g., generative fill for bleed).
133+
- Investigate further uses of the File System Access API (e.g., saving back to original file handle with permissions).
134+
135+
This list will be reviewed and prioritized as the project evolves.

0 commit comments

Comments
 (0)