Skip to content

feat: add tab management commands#108

Merged
angeloashmore merged 2 commits intoaa/remote-modelingfrom
aa/type-tab-commands
Apr 10, 2026
Merged

feat: add tab management commands#108
angeloashmore merged 2 commits intoaa/remote-modelingfrom
aa/type-tab-commands

Conversation

@angeloashmore
Copy link
Copy Markdown
Member

@angeloashmore angeloashmore commented Apr 10, 2026

Resolves: #94

Description

Add type add-tab, type edit-tab, and type remove-tab commands for managing tabs on content types.

Checklist

  • A comprehensive Linear ticket, providing sufficient context and details to facilitate the review of the PR, is linked to the PR.
  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

How to QA 1

prismic type add-tab "Content" --to "My Type" --with-slice-zone
prismic type edit-tab "Content" --in "My Type" --name "Body"
prismic type edit-tab "Body" --in "My Type" --without-slice-zone
prismic type remove-tab "Body" --from "My Type"

Note

Medium Risk
Adds new CLI commands that mutate content type JSON (including slice zone fields) and push updates to Prismic plus local adapter generation, so mistakes could directly affect schemas in a repo. Scope is contained to new commands with coverage via integration tests.

Overview
Adds three new prismic type subcommands: add-tab, edit-tab, and remove-tab to manage tabs within a content type’s json, including optional slice zone creation/removal and tab renaming.

Wires the new handlers into the type command router, ensures remote updates via updateCustomType with friendlier UnknownRequestError messaging, and updates local files/types via the adapter. Includes new tests covering --help, tab add/remove, renaming, and slice-zone toggling.

Reviewed by Cursor Bugbot for commit ed9e012. Bugbot is set up for automated code reviews on this repo. Configure here.

Footnotes

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment.

…ands

Adds tab management commands for content types:
- `add-tab` creates a new tab, optionally with a slice zone
- `edit-tab` renames a tab and/or adds/removes a slice zone
- `remove-tab` deletes a tab (guards against removing the last one)

Closes #94

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e-zone flags

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ed9e012. Configure here.

if ("name" in values) {
if (values.name! in type.json) {
throw new CommandError(`Tab "${values.name}" already exists in "${typeName}".`);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tab rename to same name incorrectly throws error

Medium Severity

When --name is the same as currentName (the positional argument), the check values.name! in type.json evaluates to true because the current tab already exists under that key. This causes a spurious "Tab already exists" error instead of treating it as a no-op. It also prevents combining --name with --with-slice-zone or --without-slice-zone in that scenario — the slice-zone mutation happens first (in memory), then gets discarded when the rename check throws.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ed9e012. Configure here.

@angeloashmore angeloashmore merged commit 98ed067 into aa/remote-modeling Apr 10, 2026
13 checks passed
@angeloashmore angeloashmore deleted the aa/type-tab-commands branch April 10, 2026 03:54
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