Skip to content

Add staircase creation functionality#271

Open
Stypox wants to merge 3 commits into
c3nav:mainfrom
Stypox:staircase-editor
Open

Add staircase creation functionality#271
Stypox wants to merge 3 commits into
c3nav:mainfrom
Stypox:staircase-editor

Conversation

@Stypox

@Stypox Stypox commented Sep 21, 2025

Copy link
Copy Markdown

This PR adds a button to the Stairs page that allows adding multiple parallel stairs at once (i.e. a staircase):

output

Even strange staircase shapes are supported (the stairs are created all parallel to the first edge in the polygon):

image

I am not completely sure about some of the changes I made, and I am happy to improve on them if I receive feedback:

  • When saving N stairs, N requests are made to the server using the existing /editor/spaces/{SPACE}/stairs/create endpoint.
  • When I first implemented this feature, when sending N requests all at once, most of them would get lost without giving any error, apparently due to the fact that they all created different changesets concurrently which then disappeared. Now I made it so that a request for a single stair is sent first, so that a changeset is instantiated, and then all other N-1 stair creation requests are sent, which end up in the correct changeset. Is it expected that there are such concurrency issues?
  • I added a new HTML template for the staircase editing page. Since that page needed mostly the same runtime checks and template variables as the stair editing page (i.e. editor/edit.html rendered by edit() with model=apps.get_model('mapdata', 'Stair')), I added a special case in edit() that renders a different HTML page if the staircase endpoint is provided.

Let me know your thoughts.

Note: this code was initially written during a Hackathon together with @dennisorlando @Degra02 @Usioumeo. The hackathon was organized by NOI, which also hosts SFScon, which uses c3nav for navigation during the conference.

Stypox and others added 3 commits September 21, 2025 13:09
Co-authored-by: Degra02 <filippodegrandi02@gmail.com>
Co-authored-by: Alessio Zeni <alessio.zeni01@gmail.com>
Co-authored-by: Dennis Orlando <dennis.orlando2002@gmail.com>
@jennypaxian jennypaxian force-pushed the main branch 7 times, most recently from 7ea2011 to 3366509 Compare December 1, 2025 13:32
@codingcatgirl

Copy link
Copy Markdown
Member

Hi!

It just occured to me that we never reponded to this, so: Thanks, this is extremely cool and something we have wanted to build for a long time!

We haven't overlooked it but are waiting for a good time to merge this with all the other revamps we are currently doing.

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