Skip to content

feat!: nav list, nav get by bar, and nav set - #9

Merged
kevin1024 merged 3 commits into
mainfrom
feat/nav-list-get-set
Nov 13, 2026
Merged

kevin1024 merged 3 commits into
mainfrom
feat/nav-list-get-set

Conversation

@kevin1024

@kevin1024 kevin1024 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

cincpro/firebird#2068 is deployed to production, so the routes this uses are live.

What changed

The Firebird API's navigation routes are changing. This moves the nav command to the new contract and adds the command for saving a bar.

  • nav list lists the site's navigation bars (GET /navigation): navBarUuid, name, isSiteDefault, pageUuids. No items.
  • nav get [NAV_BAR] reads one bar and its nested items (GET /navigation/{navBarUuid}). NAV_BAR is a navBarUuid or default; with no argument it is default. --page <page> reads the list to find the bar that page is on, then reads that bar, or default when the page is on none.
    • -o json is the API's response unchanged. A table shows the items flattened, with a dropdown's links carrying its label in a parent column and a target column (page slug, standard page path, URL or page section). -q prints every navItemUuid.
  • nav set <NAV_BAR> --data JSON|@file|- replaces every item on a bar (PUT /navigation/{navBarUuid}). It changes the live site at once and asks first on a terminal, like the other live writes (-y skips the question; a script or agent is not asked).
    • --data takes the output of nav get -o json or just {"items": [...]}. Only items is sent, untouched.
    • pageUuid is sent only when asked for: --page <page> (a uuid), --detach (null), or a pageUuid key in --data. The flags win over the key. With none of them the body has no pageUuid, so the bar stays on its page. The pageUuids of a read is never sent.
    • The result is {navBarUuid, revisionUuid}. On a terminal the note after the save names the revision to restore.
  • docs/GUIDE.md, README.md, AGENTS.md and the help text describe the list, get, edit items, set flow, and no longer send people to firebird-cli api PUT /navigation.

Breaking

  • nav get --nav-bar <uuid> is removed. The bar is now a positional argument: nav get <uuid>.
  • nav get prints the new response shape: {navBarUuid, name, isSiteDefault, pageUuids, items} with nested items. The flat item list and navBars are gone; the bars are in nav list.
  • An unknown navBarUuid is now 404 (exit 4) instead of the default bar.

Tests

cargo fmt --check, cargo clippy --all-targets -- -D warnings and cargo test pass. New end-to-end tests in tests/editing.rs cover nav list, nav get (default, default, a uuid, --page with its own bar and with the fallback, table and -q, 404), and nav set (items-only body from a full read, --page, --detach, a pageUuid key, bad input refused before any request, 400, 404 and 409).

🤖 Generated with Claude Code

kevin1024 and others added 3 commits November 12, 2026 14:57
The API's navigation routes changed (cincpro/firebird#2068): the bars are
listed at GET /navigation, one bar is read at GET /navigation/{navBarUuid}
with nested items, and PUT on the same path replaces its items.

- nav list: the bars, without items.
- nav get [NAV_BAR]: one bar, by navBarUuid or `default` (the default).
  --page finds the page's bar in the list, then reads it.
- nav set <NAV_BAR> --data: replaces every item on a bar. It sends the
  `items` of its input and nothing else from a read; `pageUuid` only goes
  out with --page, --detach or a `pageUuid` key in the input, so a bar
  stays on its page otherwise.

BREAKING CHANGE: `nav get --nav-bar` is removed; the bar is a positional
argument. `nav get` prints the new response shape (nested `items`, no
`navBars`), and an unknown bar is exit 4 instead of the default bar.
These routes do not exist before cincpro/firebird#2068 is deployed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… the docs

A save replaces every item, so the output of nav get for one bar is no
longer accepted as the data for a different bar.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@kevin1024
kevin1024 marked this pull request as ready for review November 13, 2026 13:12
@kevin1024
kevin1024 merged commit c9b8b1a into main Nov 13, 2026
11 checks passed
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