Repository navigation
Beta version - #3
Conversation
feat: enforce valid project IDs and improve project file handling test: add HTTP-level regression tests for API endpoints feat: implement dynamic default emission for certain fields fix: ensure YAML generation with Jinja is valid fix: enhance error handling in API requests style: improve accessibility with aria-labels and visual feedback style: add warning display for code generation issues fix: prevent nesting of repeat groups in layer management chore: update development dependencies and Docker configurations
- Introduced `rotate`, `dither`, and `ttl` fields in the Project model to allow customization of display options. - Updated the HA push endpoint to include these new fields in the payload. - Enhanced the frontend to support user input for these options in the push modal. - Implemented validation for the new fields in both the backend and frontend. - Added corresponding tests to ensure the correct functionality of the new features. - Improved the rendering logic to accommodate the new properties in the canvas and inspector.
- Implemented `render_template` method in `HomeAssistantClient` to render Jinja templates via Home Assistant API. - Added `/api/validate` endpoint to validate generated templates against live entity state or fallback to local sandbox. - Created `templating.py` module for rendering and validating templates, including error handling and reporting. - Updated `ha_push` endpoint to render templates before sending to Home Assistant, ensuring payload is a valid list. - Added tests for validation and rendering functionalities, ensuring proper error handling and response formats. - Enhanced frontend with a validation button and status display for template validation results. - Updated CSS for new status display elements.
- Introduced `test_render.py` for testing the pixel preview renderer. - Implemented `fetch_assets.py` script to download required font assets. - Added pixel preview functionality in the frontend, including a new button and modal for rendering previews. - Updated CSS styles for the preview interface. - Enhanced color resolution logic in `theme.js` for consistent color handling. - Updated dependencies in `requirements.txt` and `requirements-dev.txt` for testing and linting tools. - Added `ruff.toml` for consistent linting configuration. - Refactored geometry calculations to utilize shared constants for text sizing. - Improved error handling and reporting for rendering issues.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea3f9bb233
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| domain, service_name = service.split(".", 1) | ||
| if domain.lower() not in ALLOWED_SERVICE_DOMAINS: |
There was a problem hiding this comment.
Reject path separators in the service name
When a caller supplies service="open_epaper_link.drawcustom/../../homeassistant/stop", the allowlist accepts the open_epaper_link domain because only the first dot is split, but service_name retains the dot segments and is interpolated into the REST path. HTTP URL normalization then targets /api/services/homeassistant/stop, allowing an unauthenticated editor client to invoke arbitrary Home Assistant services with the stored token despite ALLOWED_SERVICE_DOMAINS. Validate both domain and service name as path-segment identifiers (and reject /, ?, and #) before calling the client.
Useful? React with 👍 / 👎.
| x_start = int(element["x_start"]) | ||
| y_start = int(element["y_start"]) |
There was a problem hiding this comment.
Resolve pattern coordinates before converting them
A rectangle pattern with a supported percentage position such as x_start: "50%" reaches this handler after template rendering, but int("50%") raises ValueError, so /api/preview reports the valid element as broken instead of rendering it. Use ctx.coords.x() / ctx.coords.y() for these position fields (and the appropriate dimension resolver for size/offset fields) as the other shape handlers do.
Useful? React with 👍 / 👎.
No description provided.