Skip to content

List the periods to hide and show them - #3

Open
alex-andreyev wants to merge 2 commits into
MarketKernel:mainfrom
alex-andreyev:hide-periods
Open

alex-andreyev wants to merge 2 commits into
MarketKernel:mainfrom
alex-andreyev:hide-periods

Conversation

@alex-andreyev

Copy link
Copy Markdown

Builds on #2 and includes its commit. Merge #2 first, or merge this one alone to take both. This PR's own changes are in its last commit, List the periods to hide and show them.

A list of periods, where a period is hidden with one click and shown again from a section of its own.

What changes

  • The list. It opens from the toolbar's new bars button or with P. It stands beside the strip on a desktop and is a bottom sheet on a phone.
    • Each period shows its colour, name, dates and number of events, and an eye that hides it.
    • Hidden periods wait in a "Hidden" section.
    • A click on a name goes to the period; a hidden one is shown first.
  • Hide all / Show all, and a filter by name once there are seven periods or more.
  • Hiding is an edit. The file keeps it as "hidden": true on the period, and it is one command on the undo stack.
  • Events follow their periods. An event goes out of sight once all its periods (Attach events to the periods they are about #2) are hidden. A reader's setting at the foot of the list, "Keep the events of hidden periods", keeps them.
  • Out of sight everywhere. Hidden periods and the events hidden with them are left out of search and of previous and next in the details. The details of an item that gets hidden close.
  • One row for the hidden periods. While any period is hidden, a row under the bars says how many ("2 hidden periods"), with no names or dates. A click on it opens the list at the hidden ones and keeps the selection.
  • Exported read-only pages can hide periods too; there it lasts while the page is open.

Also: a selected period stays in view

reveal() zoomed out to fit a whole period whenever the period started left of the screen's edge or was longer than 80% of the screen. A click on a long bar therefore shrank the view under the pointer.

Now a period stays where it is while it shows over at least 120 px of the free part of the strip, or all of it if it is shorter. reveal() also centres in the part the list on the left and the details on the right leave free.

File format

hidden on a period; see docs/format.md. It is true or left out. Any other value on a period, or the field on an event or an era, is dropped with a warning.

Tests

  • tests/model.mjs: reading hidden, the round trip, hiddenPeriods.
  • tests/app.mjs:
    • P and the toolbar button;
    • the eye;
    • an event in two periods staying until both are hidden;
    • "Keep the events of hidden periods";
    • undo and redo;
    • showing a period by its name;
    • Hide all and Show all;
    • the filter;
    • search;
    • save and reopen;
    • the row of hidden periods;
    • a click on a long bar keeping the view;
    • Esc.

npm run check passes: all unit tests, 238 browser checks and 22 PWA checks (run with TZ=UTC).

🤖 Generated with Claude Code

alex-andreyev and others added 2 commits November 17, 2026 18:00
An event can now name the periods it is about: a life, a reign, a war, as
many as it takes. The first flight is in both brothers' lives and in the age
of powered flight. The file keeps them as `periods`, a list of period ids on
the event.

- The event's window ticks any of the periods its date falls within. The
  list follows the date as it is typed, and a tick is kept while the date
  moves out of a period and back.
- An event's details link to its periods. A period's details list its
  events and, in edit mode, offer to add one already attached.
- New dates that leave an event out of a period, or deleting the period,
  detach the event from that period alone, in the same command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A list of periods opens from the toolbar's bars button or with P. It shows
every period in time order, with its dates, its number of events and an
eye that hides it. Hidden periods move to a section of their own, where
they are shown again. Hiding is an edit like any other: the file keeps it
as `"hidden": true` on the period, and it is one command on the undo stack.

- An event goes out of sight once all its periods are hidden, unless the
  reader ticks "Keep the events of hidden periods", a reader's setting.
- Hide all and Show all. A filter by name appears from seven periods on.
- Hidden periods, and the events hidden with them, are left out of search
  and of previous and next in the details.
- While any period is hidden, one row under the bars says how many. A
  click on it opens the list at the hidden ones.
- The list stands beside the strip on a desktop and is a bottom sheet on a
  phone.

Selecting a period that is already in view no longer zooms out to fit all
of it. The strip stays put while the period shows over at least 120 px of
the part the panels leave free.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant