DovieW / DovieW/microbook-maker

Reorder Contents with drag and drop or a position number, including Extras

Closed
#59 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Problem

The Contents panel currently lets users include sections and navigate to them, but not change their printed order. Users should be able to arrange the book, including optional extra content, directly in this panel.

## Requested behavior

- Reorder Contents entries with drag and drop, with a clear handle and insertion indicator.
- Provide a numeric **Move to position** control as an alternative: entering a 1-based position moves the entry there. This changes order, rather than jumping the PDF to a printed side.
- Support touch and keyboard operation; dragging must not be the only way to reorder.
- When an item is enabled in the proposed **Extras** tab, it appears in Contents and can be arranged alongside the book's original sections.
- Keep inclusion, reordering, expanding controls, and jumping to a printed location separate. Reordering must not navigate the preview.

## Draft and rendering behavior

Use the existing shared draft and Apply workflow. Changes to order remain pending until Apply; Revert restores the displayed layout's applied order. Preserve the displayed PDF and its current locations if rendering fails or is cancelled.

Persist order per document using stable entry IDs, including IDs for extras. Moving a section moves its associated content and images together. Rebuild generated contents, bookmarks, and internal destinations against the resulting printed order. Preserve original chapter titles/numbers unless a separate explicit feature changes them.

Offer **Restore original order** for original book sections. Define what happens to extras when resetting; do not silently delete their content.

## Acceptance checks

- Dragging or entering a position changes the list order and marks a pending edit.
- Apply renders that order; Revert, cancellation, failure, and reload preserve the correct applied/draft states.
- Invalid/out-of-range positions are handled clearly; moving first/last entries works.
- A newly enabled extra appears in Contents and can move between original sections.
- Disabling or excluding an entry does not erase its saved content or unnecessarily lose its position.
- Touch, keyboard, focus handling, and narrow-screen layouts work without accidental PDF navigation.
- Documents remain isolated, and legacy preferences without saved ordering retain source order.
- PDF links, bookmarks, image locations, section jumps, and source-position retention remain correct after reordering.
- Current Basic/Rich caching and kept versions remain compatible; opening an older PDF does not reinterpret its order using a newer draft.

## Design details to resolve

- Part/chapter hierarchy: how whole-part moves and individual chapter moves appear in the UI.
- Search and excluded entries: clearly define whether position numbers refer to the full ordered list, and avoid ambiguous dragging while the list is filtered.
- Initial insertion position and reset behavior for extra content.

Related: #60 — Extras ideas and integration with Contents.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the Contents panel, shared draft and Apply workflow, PDF rendering path, and per-document preference handling. Trace how entries, extras, positions, bookmarks, and destinations are represented before resolving the listed hierarchy, filtering, insertion, and reset behaviors. Done means the acceptance checks pass without breaking draft/applied state, PDF navigation, persistence, or legacy documents.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.