Skip to content

Feature/custom model editor#426

Merged
SciLor merged 10 commits intotoniebox-reverse-engineering:developfrom
ditschi:feature/custom-model-editor
Apr 9, 2026
Merged

Feature/custom model editor#426
SciLor merged 10 commits intotoniebox-reverse-engineering:developfrom
ditschi:feature/custom-model-editor

Conversation

@ditschi
Copy link
Copy Markdown

@ditschi ditschi commented Mar 9, 2026

This Adds

  • tonies.custom.json save API with validation and backups
  • custom_img root support for image workflows
  • image cache improvement - now images are not broken when cache is disabled
  • Dev-Sandbox -- local setup to emulate teddycloud with content

I also removed built web assets from teddycloud_web submodule -- i assume that was added by accident?!)

REQUIRED BY: Web changes from toniebox-reverse-engineering/teddycloud_web#283

Dev Sandbox

Added Dev sandbox that can be used locally to check changes made in the web ui. The Sandbox adds several custom tonies, models, images ad audio files

grafik grafik grafik

Preview -- what will these backend changes make available in web

Custom Tonies Editor: Editor for managing custom tonie models

Settings: Enable/Disable Editor -- (changes menu entry from WIP: Add Model to Manage custom models
grafik

Custom tonies editor Manage custom models
grafik

Image Manager:

Shared UI for selecting and managing images in TeddyStudio and Custom Tonies Editor

Image Editor::Default Images
grafik

Image Editor::Upload and manage Custom Images -- also available in Tonie Studio
grafik

@SciLor
Copy link
Copy Markdown
Contributor

SciLor commented Mar 9, 2026

Please use the web repo for the web stuff.

@ditschi ditschi force-pushed the feature/custom-model-editor branch 2 times, most recently from 4a44e68 to 0127d1e Compare March 9, 2026 22:14
@ditschi
Copy link
Copy Markdown
Author

ditschi commented Mar 9, 2026

Please use the web repo for the web stuff

Sure .. Second PR will be created for submodule changes

…anagement

- Backend: tonies.custom.json save API with validation and backups
- Backend: custom_img root support for image workflows
- Frontend: Full editor for custom models (add, edit, delete)
- Frontend: Image picker and file browser integration
- Remove built web assets (now built from teddycloud_web submodule)
@ditschi ditschi force-pushed the feature/custom-model-editor branch from 0127d1e to 95b2482 Compare March 9, 2026 22:33
@SciLor
Copy link
Copy Markdown
Contributor

SciLor commented Mar 10, 2026

Please also remove the compiled web changes (contrib www)
This will be done later by the pipeline.

@henryk86
Copy link
Copy Markdown
Collaborator

Comment thread src/settings.c Outdated
- Remove custom_editor_preview setting (editor always active)
- Ignore contrib/data/www/ (compiled web assets)
- Update teddycloud_web submodule (v0.7.0, PR feedback)

Made-with: Cursor
@ditschi
Copy link
Copy Markdown
Author

ditschi commented Mar 11, 2026

Please also remove the compiled web changes (contrib www) This will be done later by the pipeline.

removed and added to .gitignore.

@ditschi ditschi force-pushed the feature/custom-model-editor branch from c738c7d to 68eef21 Compare March 11, 2026 00:22
- Added ca-certificates to the list of packages installed in the build environment.
@ditschi ditschi force-pushed the feature/custom-model-editor branch from 68eef21 to d796621 Compare March 11, 2026 00:25
Comment thread .gitignore Outdated
@ditschi ditschi force-pushed the feature/custom-model-editor branch from 46294f0 to 14465ee Compare March 16, 2026 21:45
Comment thread dev-sandbox/README.md
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helped me really much ti develop new features. On the other hand I am not happy about adding binaries to the repo although they are small.

I f not wented ti can werork my history to remove al binary blobs again. However for useabilety during development it might be worth to keep this.

Also this couldbe used to start up a demo instance users can check out?!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helped me really much ti develop new features. On the other hand I am not happy about adding binaries to the repo although they are small.
You mean the TAFs and the images? You can keep them in the repo, if those are free to use. The images look AI-generated. Are the TAFs, too?

Also this couldbe used to start up a demo instance users can check out?!
I don't think this makes sense. This will end up in a mess. People will start to attack this instance, fill it with copyright material etc.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Images are AI, created by me. i assume they are therefore free to use? I at least hereby confirm that everybody can use them ans Attribution-NonCommercial-ShareAlike.

Taf: i struggled to find a really short audio. I ended up using the ICQ message tone that is free to download on a vast amount of pages. All taf are that audio (but wit modified header to have different ID and hashes) -- i guess you have a point there. This probably is a copyright issue.

Ill rework, remove from history and try to find alternative.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already had found https://pixabay.com/sound-effects/musical-comedy-stinger-quick-joke-cue-469097/).

that is now used. sadly somehow the header replacement did not work as expected so i need to investigate my custom models in dev-sandbox tomorrow

@ditschi ditschi marked this pull request as ready for review March 16, 2026 23:13
@SciLor
Copy link
Copy Markdown
Contributor

SciLor commented Mar 17, 2026

Please reset the deletions you did in "contrib/data/www/‎". This means, use the files in the current develop. Also please reset the submodule teddycloud_web to the one in develop.

@ditschi ditschi force-pushed the feature/custom-model-editor branch 4 times, most recently from 681e292 to 689ce65 Compare March 17, 2026 20:14
Comment thread src/settings.c Outdated
Comment thread include/settings.h Outdated
Christian Ditscher added 3 commits March 19, 2026 20:49
- Introduced a new `dev-sandbox` directory for running TeddyCloud with mock data.
- Added Docker support for local development, including setup and teardown scripts.
- Included configuration files and sample data for testing.
- Updated `.gitignore` to exclude sandbox runtime data.
- Enhanced README with instructions for using the development sandbox.
- Use free audio content for audio_*.taf (source: https://pixabay.com/sound-effects/musical-comedy-stinger-quick-joke-cue-469097/).
- Added functions to resolve cached URLs to original URLs when cache is disabled.
- Implemented cache entry creation for redirects based on index lookup.
- Updated cache handling in the server to utilize the persistent index for missing entries.
- Enhanced JSON handling to persist original URLs instead of cached paths for image loading.
…oad timeout

- Restore contrib/data/www/ from develop
- Reset teddycloud_web submodule to develop
- Add core.file_upload_timeout_ms
- Replaced the old `docker-compose.test.yaml` with a new `docker-compose.yaml` for simplified Docker setup.
- Introduced a new `Dockerfile` for building the development environment with necessary dependencies.
- Updated `Makefile` to reflect changes in Docker commands and improve output formatting.
- Modified `setup.sh` to ensure proper directory structure and file copying for the sandbox.
- Updated `README.md` with clearer usage instructions for the development sandbox.
- Adjusted JSON configuration files for tonies to ensure correct audio source references.
- Added new content JSON files for additional tonies models.
@SciLor SciLor marked this pull request as draft March 23, 2026 09:58
@ditschi ditschi force-pushed the feature/custom-model-editor branch from 689ce65 to 039c5a9 Compare March 23, 2026 19:44
@ditschi ditschi marked this pull request as ready for review March 23, 2026 20:08
@SciLor
Copy link
Copy Markdown
Contributor

SciLor commented Mar 24, 2026

Could you give me a brief description, what the caching changes do exactly and which problem you solved?

@ditschi
Copy link
Copy Markdown
Author

ditschi commented Mar 27, 2026

Could you give me a brief description, what the caching changes do exactly and which problem you solved?

From now on we Store mapping from Cached image path to original URL (tab separatd file). When cache is enabled the backend uses that to serve the correct file from cache. When saving a model we always store the url, that way if you lose your cache, the images can't still be ob change (and the cache can be recreated).

In case production environment misses to back up the cache dir (which I did 🤦 ) you should be able to recover.

@henryk86
Copy link
Copy Markdown
Collaborator

Could you give me a brief description, what the caching changes do exactly and which problem you solved?

From now on we Store mapping from Cached image path to original URL (tab separatd file). When cache is enabled the backend uses that to serve the correct file from cache. When saving a model we always store the url, that way if you lose your cache, the images can't still be ob change (and the cache can be recreated).

In case production environment misses to back up the cache dir (which I did 🤦 ) you should be able to recover.

Shouldn’t be the lost images be automatically fetched and cached again? Is that not already implemented?

@SciLor SciLor marked this pull request as draft April 4, 2026 11:45
@SciLor
Copy link
Copy Markdown
Contributor

SciLor commented Apr 4, 2026

Please split the cache changes from the custom model editor changes, as this currently blocks the merge.

@ditschi
Copy link
Copy Markdown
Author

ditschi commented Apr 7, 2026

After looking into this after my vaccation more carefully, I realize my earlier answer was inaccurate -- I had misunderstood how the existing cache works.

The cache is already robust by design: it uses a deterministic SHA256 hash of the original URL as the filename, and the JSON files (tonies.json, tonies.custom.json).

My original issue was caused by my web logic for custom models. Here I did not always store the original URL in the custom.json but sometimes the image selector returned the /cache/... path. This is a bug and I will update the web PR to always use the original URL and to never over cache paths in the image selector.

My cache changes (persistent index, fallback resolution) therefore were essentially an unnecessary safety net based on a wrong assumption that /cache/... paths could end up persisted in the JSON. I'm removing them from this PR entirely and have updated the frontend to not rely on cachePic at all. No separate cache PR needed.

@ditschi ditschi marked this pull request as ready for review April 7, 2026 19:20
@SciLor SciLor merged commit 57b436a into toniebox-reverse-engineering:develop Apr 9, 2026
3 of 27 checks passed
@SciLor
Copy link
Copy Markdown
Contributor

SciLor commented Apr 9, 2026

The build fails, maybe some change in the makefile is problematic

@ditschi
Copy link
Copy Markdown
Author

ditschi commented Apr 10, 2026

The build fails, maybe some change in the makefile is problematic

I will have a look at this later -- on my machine it worked in the Devcontainer 😜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants