fix: always-on annotate tools, draw z-order, and bare image rendering#181
Merged
Conversation
These tools were gated on hasPages, leaving them disabled when the canvas had no pages or none was selected. Remove the gating so they work on an empty canvas. hasPages still gates browser-mode toggles. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The in-progress drawing preview mounted before StackedCanvasItems, so with no explicit z-index it painted under file entities and snapped on top only after commit. Render the preview after StackedCanvasItems so the live stroke sits where a freshly committed drawing lands. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Image file entities now render with no background, shadow, or filename chrome — just the bare image. The selection outline still shows on select, and the selection popover surfaces the filename. Other file types keep their card chrome. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extract isBareImageEntity predicate shared by the body card and chrome overlay, and collapse the bare-vs-carded condition in FileBodyLayer into a single isChromeless local. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The prior refactor commit added entityPresentation.ts but imported a non-existent './types' module and never wired the helper in, leaving dead code that broke typecheck. Import CanvasSceneFileEntity from shared/types, use the helper in FileBodyLayer and FileChrome, and collapse the bare-vs-carded card condition into a single isChromeless local. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The extracted isBareImageEntity helper tripped fallow's unused-export gate (its importer detection missed the new one-symbol module). Inline the `rendererTag === 'image'` check at both sites and delete entityPresentation.ts, keeping the isChromeless collapse. Behavior-identical; typecheck and fallow pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
lklyne
added a commit
that referenced
this pull request
Jun 1, 2026
* fix(toolbar): let draw/comment/inspect activate with no pages PR #181 removed the hasPages-gated `disabled` on the Draw/Comment/Inspect toolbar buttons, but a second, main-side gate remained: sanitizeForPages() in tool-mode silently collapsed annotation/inspect tools back to `select` when the canvas had zero pages. So the buttons looked clickable but the activation died in main — the draw tool never became active and its DrawToolPopup (gated on activeTool.kind === 'draw') never appeared. Remove the page collapse entirely so draw, comment, and inspect activate on an empty canvas, matching the always-enabled buttons. Only the drawing feature flag can veto a tool now. The inspect path is already defensive about zero pages (syncInspectionState loops over an empty pages list; panel data reports available/annotateAvailable = pages.length > 0; inspection enable is forced false with no pages), so no tool crashes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(panel): keep comment toggle available with no pages The right panel's "Add comments" button gated on pages.length > 0, but the toolbar comment tool now activates on an empty canvas. Make annotateAvailable always true so both surfaces agree. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hasPages-gateddisabledstate (and the now-unusedannotateAvailable/inspectAvailablelocals + prop) so these tools work on an empty canvas.DrawingLayerbelowStackedCanvasItemsso the in-progress stroke sits at the z-order a freshly committed drawing lands at — strokes no longer hide behind frames.isBareImageEntitypredicate used by both the body card and chrome overlay.Test plan
pnpm typecheckpasses.🤖 Generated with Claude Code