mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-05-09 08:25:54 +02:00
[PR #963] [MERGED] feat: add embedded GCode viewer #1145
Labels
No labels
A1
automated
automated
bug
bug
Closed due to inactivity
contrib
dependencies
dependencies
duplicate
enhancement
feedback
hold
invalid
Notes
P1S
pull-request
security
ThumbsUp
user-report
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/bambuddy-maziggy-1#1145
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/maziggy/bambuddy/pull/963
Author: @Soopahfly
Created: 4/13/2026
Status: ✅ Merged
Merged: 4/22/2026
Merged by: @maziggy
Base:
dev← Head:feature/gcode-viewer📝 Commits (8)
5b710bcfeat: add embedded GCode viewerae804adfix: address PR review feedback on gcode-viewer7361d85test: add tests for gcode-viewer routes and to_absolute_path guardd58d4a5fix: exempt /gcode-viewer from frame-ancestors 'none' CSPb1e04e5Merge branch 'dev' into feature/gcode-viewerb69fa61Merge branch 'dev' into feature/gcode-viewer0947275Merge branch 'dev' into pr-963943765efix(gcode-viewer): merge-time fixes — i18n parity, auth 401 redirect📊 Changes
38 files changed (+15895 additions, -67 deletions)
View changed files
📝
backend/app/api/routes/library.py(+12 -3)📝
backend/app/main.py(+61 -13)➕
backend/tests/integration/test_gcode_viewer.py(+85 -0)➕
backend/tests/unit/test_library_file_path_guard.py(+115 -0)📝
frontend/src/App.tsx(+2 -0)📝
frontend/src/components/Layout.tsx(+2 -1)📝
frontend/src/i18n/locales/de.ts(+4 -0)📝
frontend/src/i18n/locales/en.ts(+4 -0)📝
frontend/src/i18n/locales/fr.ts(+4 -0)📝
frontend/src/i18n/locales/it.ts(+4 -0)📝
frontend/src/i18n/locales/ja.ts(+4 -0)📝
frontend/src/i18n/locales/pt-BR.ts(+4 -0)📝
frontend/src/i18n/locales/zh-CN.ts(+4 -0)📝
frontend/src/i18n/locales/zh-TW.ts(+4 -0)➕
frontend/src/pages/GCodeViewerPage.tsx(+28 -0)📝
frontend/vite.config.ts(+68 -1)➕
gcode_viewer/VENDORED.md(+60 -0)➕
gcode_viewer/css/prettygcode.css(+417 -0)➕
gcode_viewer/index.html(+264 -0)➕
gcode_viewer/js/Line2.js(+31 -0)...and 18 more files
📄 Description
Summary
Adds PrettyGCode as a built-in GCode visualiser embedded directly in the Bambuddy layout, so users can preview and inspect GCode files without leaving the dashboard.
.gcodefiles across all folders, with live search filtering<iframe>so it does not interfere with React app state or routingTechnical notes
gcode_viewer/— PrettyGCode static assets with a custombambuddy_adapter.jsthat bridges OctoPrint API patterns to Bambuddy's REST/WebSocket API, aslider-shim.jsreplacing the bootstrap-slider dependency, and a CSP meta tagGCodeViewerPage.tsx— iframe wrapper with a recursion guard (prevents infinite nesting if the SPA catch-all serves the React app into the iframe)@app.getroutes for/gcode-viewer/*placed before the SPA catch-all (app.mount()loses to/{full_path:path}in some Starlette versions)gcode_viewer/at/gcode-viewer/without proxying to uvicorn during developmentlibrary.pyto_absolute_path()nav.gcodeVieweri18n key added to all 7 locale filesDocs
This adds a new nav item and feature — a wiki page will be needed. Happy to write it once this PR is reviewed.
Screenshots
Test plan
.gcodefiles from the librarynpm run dev) serves the viewer correctly at/gcode-viewer/🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.