Skip to content

M14: hide tools from All tools, the palette and Home (view.customize-quick-tools) - #2849

Open
dimtrii wants to merge 5 commits into
storytold:mainfrom
dimtrii:feat/tool-visibility
Open

dimtrii wants to merge 5 commits into
storytold:mainfrom
dimtrii:feat/tool-visibility

Conversation

@dimtrii

@dimtrii dimtrii commented Oct 16, 2026 •

Copy link
Copy Markdown

What this changes

A new Preferences section, Tools shown in All tools, chooses which tools PdfCraft lists. Many people use PdfCraft for a few tools only (say reading, commenting and signing) and do the rest elsewhere; for them All tools, the ⌘K palette and Home are full of tools they never open.

  • One checkbox per tool (the 23 entries of All tools, with their existing translated names). No per-command switches, which would mean over a hundred checkboxes.
  • Three presets that set the checkboxes: All tools (default, today's behaviour), Read and comment (Add comments, Fill & Sign, Add a stamp, Compare files) and Forms and signing (Fill & Sign, Prepare a form, Use a certificate, Add a stamp, Add comments). Changing a checkbox afterwards shows Custom selection.

A hidden tool is left out of three lists:

  1. All tools in the left panel. View more counts shown tools only and disappears when 14 or fewer are shown. With every tool hidden, the panel says where to bring them back.
  2. The ⌘K palette: the tool, its items, and registered commands that only hidden tools list. A command listed by two tools (Rotate pages is in Edit a PDF and Organize pages) stays while either is shown; commands no tool lists (Open, Zoom, …) always stay.
  3. Recommended tools on Home (the Open file card stays).

Nothing is switched off. The mode tabs, the menu bar, keyboard shortcuts, ui.set tool, the CLI and MCP keep every tool, and Preferences says so in one line. Default behaviour is unchanged.

Details:

  • The settings store the hidden tool ids (hidden_tools), so a tool a later version adds shows up instead of missing. The preset is derived from that list, not stored, so there is one source of truth.
  • The settings file is untrusted: unknown ids are dropped, repeats removed, and a value that isn't a list hides nothing. Reading the list allocates nothing per entry, so the result is bounded by the catalogue.
  • Presets are plain data next to TOOL_GROUPS in pdfcraft_engine::catalog (no egui below L7). Their names are tl! literals in the UI, so the catalogue-coverage tests enforce their translations.
  • Headless, like default-mode: ui.set with tool-preset (all, read-comment, forms-sign) and hidden-tools (comma-separated ids or none; an unknown id is an error and changes nothing). ui.state reports hidden_tools and tool_preset (a preset id or custom). Documented in the control.rs module docs.
  • The logic lives in a new module, crates/ui-egui/src/tool_visibility.rs; the existing files get one short call site each, to keep this easy to rebase.
  • Seven new UI strings, in all 22 catalogues, with the ATTRIBUTION.toml checksums updated. They were written from the meaning of the English labels, following each catalogue's existing terms (All tools, Preferences, …). No native-speaker review, so corrections are very welcome.

How you verified it

  • cargo fmt --check
  • clippy with -D warnings on the crates I changed
  • tests pass on the crates I changed
  • cargo xtask layers and cargo xtask assets (if you touched crate boundaries or any asset)

Also ran the whole of cargo xtask ci locally on stable 1.99.1 (fmt, clippy --workspace --all-targets, test --workspace, layers, wasm, assets, deny, parity: all 8 steps passed) plus cargo check -p pdfcraft-cli --no-default-features, with CRAFT_FONTS_DIR at the pinned craft-fonts commit, CRAFT_FONTS_REQUIRED=1 and PDFCRAFT_ORACLES_REQUIRED=1. macOS only; no Windows or Linux run, but the change has no platform branches, paths or fonts.

Tests at three scales, each seen failing with the code it pins reverted:

  • engine (catalog.rs): presets name real tools; a hidden list maps to its preset whatever the order or repeats, and a near miss is no preset.
  • ui-egui unit (tool_visibility.rs): saved lists keep known ids once in catalogue order and drop anything else; a 200,000-entry list stays bounded; the control value rejects unknown ids; the preset follows single toggles; a command hides only with every tool that lists it; persist → restore round trip, and a malformed value hides nothing.
  • end to end (tests/tool_visibility.rs, kittest over the control channel): a preset tidies All tools and the palette while ui.set tool compress still opens the hidden tool; unknown tools and presets are refused without changing anything; Home recommends only shown tools and keeps Open file; All tools points to Preferences when everything is hidden; the Preferences checkboxes and preset change the list.

Reverted one at a time, each of these made a test fail: the All tools filter, the View more condition, the palette's tool filter, the palette's command filter, the Home filter, restore, and the checkbox handler.

Unrelated to this change: comments::a_released_pen_stroke_stays_drawn_until_the_page_raster_has_it failed once on an unchanged main here and passed on the rerun (timing; possibly what #2812 addresses).

Never-crash

  • No new unwrap/expect/panic!/unreachable!/todo! outside tests, unless it is provably infallible with a comment saying why
  • No indexing or slicing with input-derived positions (get, and strings only at char boundaries); checked or saturating arithmetic; allocations sized by input are capped; recursion is bounded
  • No unsafe

Provenance

  • No asset from an Adobe product, and no Adobe icon recreated, traced or imitated
  • No font files committed here
  • No GPL/AGPL code copied in
  • Behaviour comes from the specification or black-box observation, not from reading another implementation's source
  • Every new asset has an ATTRIBUTION.toml entry and cargo xtask assets passes (no new assets; only the changed catalogues' checksums)

Security

  • --root confinement still holds on every path (no paths involved)
  • MCP and the UI control channel stay opt-in, loopback-only and token-authenticated (two keys added to the existing ui.set)
  • No new outbound network access

Parity and reach

  • parity/acrobat-features.toml updated: view.customize-quick-tools is now partial, with tests as evidence and a note on what is still missing (customising the quick-action toolbar, pinning, reordering)
  • Reachable headlessly through ui.set / ui.state, like default-mode; no automation tool, since it is a UI preference only
  • Docs updated: docs/ui-parity.md (rows and revision history), control-channel docs in control.rs

Anything a reviewer should look at first

  1. Does this fit your plans for M14? It covers the "which tools appear" part of view.customize-quick-tools. If you would rather have a separate parity entry, or prefer pinning only, I'm happy to adapt.
  2. The presets: are these three the right ones, and are the names good?
  3. Mode tabs stay as they are when their tool is hidden (Edit opens edit, Convert export, E-Sign fill_sign). Hiding is meant to tidy lists, not remove features, so I left them. Should they hide too?
  4. Pinned tools ([Feature Request] [PdfCraft] I would like a pin tool feature. (QOL) #2435, feat: Acrobat UI parity for image editing, text formatting, and UI stabilization and Bug Fixes #2155): this is independent of pinning and complements it (pinning picks favourites, hiding removes the rest). If feat: Acrobat UI parity for image editing, text formatting, and UI stabilization and Bug Fixes #2155 lands first, I'll rebase; I'd suggest a pinned tool stays on Home even when hidden from All tools.

I can add screenshots of the Preferences section (light and dark, English and German) if useful.

Summary by CodeRabbit

  • New Features
    • Choose which tools appear in All tools, the command palette, and Home recommendations using presets or individual preferences. Your selection is saved between sessions.
    • Hidden tools remain available through menus, mode tabs, and shortcuts. The quick-action toolbar itself remains fixed.
  • Documentation
    • Updated feature and interface documentation to reflect tool visibility settings and their scope.

Three presets for which tools All tools lists: every tool, Read and
comment, and Forms and signing. Data and pure lookups only; the UI that
uses them follows.
…quick-tools)

Preferences gets a Tools shown in All tools section: a preset (All tools,
Read and comment, Forms and signing) and one checkbox per tool. A hidden
tool leaves All tools, the ⌘K palette (with the commands only it lists)
and Home's recommended tools. The menus, the mode tabs, shortcuts,
ui.set tool and automation keep every tool, so hiding never switches a
feature off.

The setting saves the hidden tool ids, so tools a later version adds show
up. The settings file is untrusted: unknown ids are dropped and a value
that isn't a list hides nothing. The control channel sets it with
ui.set tool-preset / hidden-tools and reports hidden_tools and
tool_preset in ui.state.

New strings are in all 22 catalogues (translated from the English
meaning, not reviewed by native speakers), with their checksums.
…tomize-quick-tools)

view.customize-quick-tools is partial: Preferences chooses the tools All
tools, the palette and Home list. Customising the quick-action toolbar,
pinning and reordering are still missing.
Copilot AI balanced review requested due to automatic review settings October 16, 2026 12:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Only ATTRIBUTION.toml conflicted: the 22 catalogue checksums, recomputed
from the merged catalogues. cargo fmt, clippy and tests for engine and
ui-egui, xtask layers, assets and parity pass.
Only ATTRIBUTION.toml conflicted: the 22 catalogue checksums, recomputed
from the merged catalogues. cargo fmt, clippy and tests for engine and
ui-egui, xtask layers, assets and parity pass.
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cf39bc17-c821-4567-9aa9-273791b63f9c
📥 Commits

Reviewing files that changed from the base of the PR and between 1952a88 and b851c81.

⛔ Files ignored due to path filters: 22
  • crates/ui-egui/src/i18n/ar.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/bg.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/cs.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/de.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/el.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/es.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/fr.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/hu.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/it.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/ja.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/kk.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/lt.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/pl.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/pt-br.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/ru.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/sl.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/te.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/tr.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/uk.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/vi.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/zh-hans.tsv is excluded by !**/*.tsv
  • crates/ui-egui/src/i18n/zh-hant.tsv is excluded by !**/*.tsv
📒 Files selected for processing: 12
  • ATTRIBUTION.toml
  • crates/engine/src/catalog.rs
  • crates/ui-egui/src/control.rs
  • crates/ui-egui/src/home.rs
  • crates/ui-egui/src/js_ui.rs
  • crates/ui-egui/src/lib.rs
  • crates/ui-egui/src/palette.rs
  • crates/ui-egui/src/panels.rs
  • crates/ui-egui/src/tool_visibility.rs
  • crates/ui-egui/tests/tool_visibility.rs
  • docs/ui-parity.md
  • parity/acrobat-features.toml

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

Added presets and per-tool preferences for hiding tools from All tools, the command palette, and Home. The app persists these settings and reports them through ui.set state. Hidden tools remain available through menus, mode tabs, and shortcuts.

Changes: Tool visibility preferences

Layer / File(s) Summary
Preset and hidden-tool model
crates/engine/src/catalog.rs, crates/ui-egui/src/tool_visibility.rs, ATTRIBUTION.toml
Added three presets and HiddenTools APIs for parsing, persistence, preset matching, and visibility. Updated recorded checksums for 22 translation catalogs.
Preferences and setting interfaces
crates/ui-egui/src/tool_visibility.rs, crates/ui-egui/src/lib.rs, crates/ui-egui/src/js_ui.rs, crates/ui-egui/src/control.rs
Added preset selection and per-tool checkboxes in Preferences. The app saves and restores hidden-tool settings. ui.set accepts preset and hidden-tool options and reports both values in state.
Filtered tool surfaces and validation
crates/ui-egui/src/panels.rs, crates/ui-egui/src/palette.rs, crates/ui-egui/src/home.rs, crates/ui-egui/tests/tool_visibility.rs, docs/ui-parity.md, parity/acrobat-features.toml
All tools, palette results, and Home recommendations now filter hidden tools. Added UI tests for these surfaces, preferences, and setting validation. Updated parity records to describe tool visibility and remaining toolbar customization gaps.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Preferences
  participant PdfCraftApp
  participant AllTools
  participant CommandPalette
  participant Home
  Preferences->>PdfCraftApp: update hidden_tools
  PdfCraftApp->>AllTools: filter tool groups
  PdfCraftApp->>CommandPalette: filter commands and tool groups
  PdfCraftApp->>Home: filter recommended tools
Loading

Suggested reviewers: echelon

Merge Risk: ⚪ Minimal · up to b851c

The visibility preferences and filtered tool listings have no established issue that should delay merging after normal checks.

Security architecture risk: 🔵 Low · up to b851c

The change controls which tools are displayed, not which tools may run. The reviewed updates validate tool identifiers and preserve direct tool access. No new security concern was demonstrated, although coverage is insufficient for a comprehensive security assurance.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The reviewed new state affects tool discovery within the owning application and its saved preferences. Its consumers do not establish new authority over document execution, other users or downstream services.

Trust Boundaries and Controls

  • observed — Saved settings are treated as untrusted input: unknown and non-string entries are dropped, duplicates collapse, and the resulting identifier collection cannot exceed the catalog. Control input instead rejects unknown or empty identifiers. These identifiers feed listing predicates rather than file paths or executable commands.
  • observed — The control.rs base-to-head change adds documentation and two read-only visibility fields to the existing state response. It does not add a new request method or authentication path; preference writes use the existing set_option path.

Resilience and Maintainability Implications

  • inferred — Loss of an unsaved visibility update before the existing save callback would revert a display preference, not strand an access-control configuration. The save lifecycle predates this change, and direct tool access remains independent of the restored visibility value.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 72.34% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 47 functions across 9 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the main change: hiding tools from All tools, the command palette, and Home, while identifying the related parity objective.
Description check Passed The description follows the repository template and covers behavior, verification, tests, safety, provenance, security, parity, documentation, and reviewer focus areas. It also records platform limita…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description follows the repository template and covers behavior, verification, tests, safety, provenance, security, parity, documentation, and reviewer focus areas. It also records platform limitations and an unrelated flaky test.

Full details: Docstring Coverage

Explanation

Docstring coverage is 72.34% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 47 functions across 9 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

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.

2 participants