Editor optimization: IA/efficiency rework, collab WS authz fix, structural editing + /inspections consolidation - #203
Merged
important-new merged 19 commits intoJun 25, 2026
Conversation
…tion Property tab (D3)
…ible photo rail (D4)
…broadcasts restore (D8)
…via snapshot PATCH + DO restructure (D8) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AG7v84fofi49dqZS7he9f2
…t hook + AddSectionPromptModal (D8) Behavior-preserving: moves the section structural-edit wiring (snapshot ref, applyStructure fetcher, add/duplicate/delete/move handlers, delete-impact + add-section-prompt modal state) out of inspection-edit.tsx (2053->1937 lines) into a reusable hook + component. Addresses the Important review finding on task 10.3 and gives item-level (10.4) a hook to extend instead of inlining more. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AG7v84fofi49dqZS7he9f2
…ve + type picker (D8) Extends useStructureEdit with item handlers (over the addItem/duplicateItem/ deleteItem/moveItem ops) and a generalized delete-impact modal (section OR item). ItemList gains a per-item ⋯ menu (duplicate/delete/move) + "+ Add item"; new AddItemTypeModal offers the 9 item types. StructureDeleteModal is now noun-aware. Routes through the same restructure action + DO convergence as section edits. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AG7v84fofi49dqZS7he9f2
Adds a save-structure-template action intent (PUT source template / POST new,
reusing the existing template service), useStructureEdit save-template state,
a SaveTemplateModal (back = overwrite-source warning; new = name input), and
two SectionRail footer actions ("Save structure → template" gated on a source
template, "Save as new template…"). Completes P10 structural editing.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AG7v84fofi49dqZS7he9f2
Addresses the whole-branch review of feat/editor-optimization (no Critical): - useStructureEdit: advance snapshotRef optimistically in applyStructure so two rapid structural ops compose instead of the second recomputing from the pre-first snapshot and silently dropping the first (wholesale PATCH is LWW). - restructure action: stop reporting clean convergence over a drifted doc. When collab is on, a non-501 failure from the collab/restructure ping (e.g. 403) now surfaces an error instead of being swallowed; documents the PATCH(tenant-role) vs ping(assignment-scoped) authorization surfaces. - save-structure-template 'back': fail the save if the source template name can't be resolved, rather than PUTting a "Template" placeholder that would silently rename the source. - Delete the dead toggleBatchSelect(shiftKey) range branch + now-unused lastBatchClickedRef (canonical range path is batchSelectRange/batch-range). - StructureDeleteModal: Escape cancels the destructive action. - onExitFullscreen: guard the state write so a bare Escape is a true no-op. type-check 0/0, test:web 590/590, eslint clean, lint:ds/migrefs OK, file-size ratchet tightened (useInspectionBatch shrank). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AG7v84fofi49dqZS7he9f2
…l list) The sidebar "Inspections" link pointed at a thin, feature-poor status-grouped list (routes/inspections.tsx) while the full workspace — stats, + New Inspection, filters, tabs, search, batch — lived at /dashboard. Two pages, same backend endpoint (api.inspections.dashboard), confusing IA. - Move the rich routes/dashboard.tsx → routes/inspections.tsx; serve it at /inspections. Delete the thin list. Drop the /dashboard route entirely (pre-launch: no back-compat redirect). - Repoint every /dashboard page link: post-login/setup/join redirects, home "/" index + server root redirect, SSO/TOTP/identity-switch redirects, Google-calendar OAuth callback, concierge review email, editor exit, inspection-hub / form-renderer / feature-disabled back-links, calendar new-inspection link, reports-redirect (→ /inspections?workflow=published), CommandPalette, BackButton, NewInspectionWizard action, PWA manifest. - Left untouched: the /api/inspections/dashboard data endpoint, the separate /agent-dashboard route, /dashboard-columns, dashboard-* libs/components, and the Cloudflare-dashboard doc mention. - Updated unit tests (route-metadata, identity-service, concierge-emails, dashboard-tabs/-workflow imports) + e2e specs + docs. type-check 0/0, test:web 590/590, test:unit 2162 passed, DS/migrefs OK. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AG7v84fofi49dqZS7he9f2
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.
Reworks the inspection editor for information architecture, tool efficiency, and parity with the pre-flatten feature set, fixes a latent collab-WS authorization gap, and consolidates the two inspection-list pages into one.
Editor optimization (decisions D1–D10)
canAccessInspectionCollabpredicate; both WS auth sites (collab + presence) now allow tenant admin/manager, not only the assigned inspector (the latent 403 → stuck "Connecting…"). Quicker first-connect retry to mask DO cold start.restructure()seeds adds + removes deleted keys, then broadcastsMSG_RESTOREto converge live clients) — the DO remains the sole writer ofinspection_results.data.Final whole-branch review fixes
A senior-reviewer pass (no Critical) surfaced and we fixed: an optimistic-snapshot lost-edit race on rapid structural ops; silent swallowing of a non-501 collab-restructure failure (now surfaced rather than reporting clean convergence over a drifted doc); a dead
toggleBatchSelect(shiftKey)range path; plus Escape-to-cancel on the destructive structural-delete modal and a guarded fullscreen-exit./dashboard → /inspections consolidation
The sidebar "Inspections" link pointed at a thin, feature-poor list while the full workspace (stats, New Inspection, filters, tabs, search, batch) lived at
/dashboard— two pages, same backend endpoint. This moves the rich page to/inspections, retires the thin list, drops/dashboard, and repoints every page link (post-login/SSO/OAuth redirects, root, command palette, PWA manifest, editor exit, etc.). The/api/inspections/dashboarddata endpoint and the separate/agent-dashboardroute are untouched.Tests
type-check 0/0 ·
test:unit2162 passed (8 pre-existing skips) ·test:web590 passed ·test:workers66 passed · DS-token / migration-ref / file-size / bundle gates green.🤖 Generated with Claude Code