Skip to content

Add custom projects with LDraw part search and per-project part management#36

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-custom-projects-feature
Draft

Add custom projects with LDraw part search and per-project part management#36
Copilot wants to merge 3 commits intomainfrom
copilot/add-custom-projects-feature

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

Adds support for custom projects not tied to a LEGO set number, with a searchable LDraw library index and full add/remove/quantity management for project parts.

Database

  • New ldraw_part_index table indexes local LDraw .dat files (part_num + description from file header)
  • New project_parts table stores parts belonging to custom projects (part_num, quantity, color)
  • is_custom boolean column added to projects
  • Alembic migration 002_custom_projects handles all schema changes idempotently

Backend

  • build_ldraw_part_index() / search_ldraw_part_index() in ldraw.py — scan parts/*.dat, parse description from line-type-0 header, upsert into index
  • New router ldraw_parts.py exposes:
    • GET /api/ldraw-parts/search?q= — full-text search on part_num and description
    • POST /api/ldraw-parts/index — (re)build index by scanning local library
    • GET /api/ldraw-parts/index/status — indexed count
  • POST /api/projects now accepts is_custom: true with no set_num
  • New CRUD routes under /api/projects/{id}/parts — list, add (merges quantity if part already present), PATCH quantity, DELETE
  • process_generation_custom() mirrors the existing generation pipeline but reads parts from project_parts instead of calling Rebrickable

Frontend

  • ProjectsPage: + Custom Project button opens a modal to name and create a custom project
  • ProjectDetailPage: custom projects show a parts management panel with:
    • LDraw index status + one-click rebuild
    • Search input → results dropdown with + Add per result
    • Parts list with inline /+ quantity controls and Remove button
    • Job wizard loads custom project parts for per-part rotation (bypasses Rebrickable call)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • rebrickable.com
    • Triggering command: /usr/bin/python3 python3 -m pytest backend/tests/ -x -q (dns block)
    • Triggering command: /usr/bin/python3 python3 -m pytest backend/tests/ -q (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Create a new branch called task/custom-projects.

Give users the option of creating a custom project with self selected parts (create a search mechanism for the ldraw cache, it should probably just be a database table that indexes the ldraw cache)

Also allow users to add/remove parts from a Project.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 23, 2026 03:09
…ts management

Co-authored-by: scubar <9043529+scubar@users.noreply.github.com>
…in LDraw parser

Co-authored-by: scubar <9043529+scubar@users.noreply.github.com>
Copilot AI changed the title [WIP] Add option to create custom projects with selected parts Add custom projects with LDraw part search and per-project part management Feb 23, 2026
Copilot AI requested a review from scubar February 23, 2026 03:15
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.

2 participants