Skip to content

feat(plans): remove the Preview schedule dialog now that the preview is inline - #1179

Merged
cristim merged 7 commits into
mainfrom
feat/remove-schedule-preview-dialog
Oct 20, 2026
Merged

cristim merged 7 commits into
mainfrom
feat/remove-schedule-preview-dialog

Conversation

@cristim

@cristim cristim commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #1153 (PR3 of 3). After #1177 and #1178 the plan modal shows a live, read-only schedule preview inline, in both Create and Edit. This PR removes the separate Preview schedule button and dialog, which the inline preview now replaces.

  1. afdb78de test(plans): keeps the dialog test's non-interactive renderSchedulePlot cases and the schedulePlotFrame width check in plan-schedule-plot.test.ts before that test file goes.

  2. a054b41a test(plans): ports the date-gesture cases only the dialog test exercised into plan-editor-panel.test.ts:

    • rollback on pointercancel, lostpointercapture and Escape;
    • endpoint redistribute;
    • collision and outside release, with other pointers ignored;
    • pointer-capture failure;
    • the midnight recheck on release.

    Mutation probe: making binding.restore(...) a no-op fails 4 of them.

  3. a76e221f, c3b9f1d6 test(e2e): drop the dialog walkthrough and replace the dense/overlap block with 100-point checks that scroll inside the inline preview.

  4. 938f98aa test(plans): deletes plan-schedule-preview.test.ts.

  5. a2f702be feat(plans): removes the button (index.html), its handler and the now-unused readPlanScheduleInput import (plans.ts), plan-schedule-preview.ts, its plans.test.ts case and the dialog-only CSS. New e2e toHaveCount(0) assertions for the button and dialog failed at all 6 viewports before the deletion.

Kept on purpose (deferred to #1057, as stated on #1153): the panel's dormant editable path (editableDates), plan-date-interaction.ts, lib/plan-editor-draft.ts, lib/plan-draft-dates.ts and the plot's interactive branches.

Coverage of the shared modules

File Before (stmts / branches / funcs / lines) After
plan-date-interaction.ts 96.87 / 85.43 / 100 / 100 96.25 / 85.43 / 100 / 100
plan-schedule-plot.ts 100 / 100 / 100 / 100 100 / 97.5 / 100 / 100

The plot's one dropped branch is the if (tick) guard in updateSchedulePlot, which only the dialog's drag path reached.

Bundle

app.js goes from 501 KiB to 495 KiB, so webpack's 500 KiB asset warning is gone. The combined entrypoint warning (767 KiB) remains, as before.

Size

Counted as added + deleted from git diff --numstat origin/main...HEAD, tests and e2e included: +138/-704 in 6 commits, each under 400.

Verification

Evidence is posted as PR comments.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Changes
    • Removed the separate “Preview schedule” action and standalone preview modal from plan creation and editing.
    • Schedule previews are now displayed directly within the plan editor.
    • Plan editors continue to support dense schedules, scrolling, keyboard focus, responsive layouts, and mobile touch scrolling.
    • Preview interactions remain read-only and do not submit changes to the server.

cristim and others added 6 commits October 20, 2026 05:15
…st goes

The preview dialog test is the only place that covers the logical-ordinal
plot (no bridging of missing dates, retained step nodes) and the
schedulePlotFrame width rule. The inline panel still renders the plot, so
move those cases to their own file ahead of deleting the dialog test.

Part of #1153

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
plan-date-interaction.ts stays for the deferred editable path (#1057),
and the dialog test is the only coverage of rollback on cancel, endpoint
redistribution, collision and outside-release rejection, and capture
failure. Port those cases to the panel test before the dialog test is
deleted. Making the rollback a no-op now fails four tests.

Part of #1153

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The inline panel is now the only preview in Create and Edit, so the
dialog gesture, keyboard and date-field sections of the spec are dead
weight. The gestures they covered are ported to plan-editor-panel.test.ts.
The dense and overlap block still opens the dialog and is replaced in the
next commit.

Part of #1153

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dense and overlap block drove the dialog. Replace it with the same
guarantees on the inline panel: 100 points at a 4896px plot, only the
preview scroll region scrolls horizontally (page, modal and form do not),
and on phones a touch pan over the plot scrolls it without changing any
point.

Part of #1153

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its cases now live elsewhere: intent building in plan-schedule-intent
.test.ts, the non-interactive plot in plan-schedule-plot.test.ts and the
date gestures in plan-editor-panel.test.ts. Also port the click and arrow
selection case and the release-time midnight recheck, so
plan-date-interaction.ts keeps 100% line coverage without the dialog test
(stmts 96.87 -> 96.25, branches 85.43 -> 85.43; the plot keeps 100% lines,
one branch of updateSchedulePlot's tick guard is no longer taken).

Part of #1153

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The inline preview in the Create and Edit modal replaces the dialog, so
the footer button, its handler, the dialog module and its CSS go. The
e2e spec now asserts the button and dialog are absent. The dormant
editable-dates path stays for #1057.

Closes #1153

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cristim cristim added effort/m Days impact/many Affects most users priority/p2 Backlog-worthy severity/low Minor harm type/feat New capability urgency/this-sprint Within the current sprint labels Oct 20, 2026
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 51 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 86 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: LeanerCloud/cloud-commitments-platform/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: e598822f-0344-4851-b642-fe533d59ec1d
📥 Commits

Reviewing files that changed from the base of the PR and between a2f702b and 34bf36e.

📒 Files selected for processing: 2
  • frontend/src/__tests__/plan-editor-panel.test.ts
  • frontend/src/__tests__/plan-schedule-plot.test.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: LeanerCloud/cloud-commitments-platform/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 0cc49bb2-0136-4e9c-a155-0658b5a2589d
📥 Commits

Reviewing files that changed from the base of the PR and between d875abc and a2f702b.

📒 Files selected for processing: 9
  • frontend/src/__tests__/plan-editor-panel.test.ts
  • frontend/src/__tests__/plan-schedule-plot.test.ts
  • frontend/src/__tests__/plan-schedule-preview.test.ts
  • frontend/src/__tests__/plans.test.ts
  • frontend/src/index.html
  • frontend/src/plan-schedule-preview.ts
  • frontend/src/plans.ts
  • frontend/src/styles/plans.css
  • frontend/tests-e2e/plan-schedule-preview.spec.ts
💤 Files with no reviewable changes: 4
  • frontend/src/index.html
  • frontend/src/tests/plans.test.ts
  • frontend/src/tests/plan-schedule-preview.test.ts
  • frontend/src/plan-schedule-preview.ts

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

📝 Walkthrough

The plan modal no longer has a separate schedule-preview button or dialog. The preview module and its wiring were removed. Tests now cover schedule rendering and date gestures in the editor, plus inline preview behavior in end-to-end checks.

Changes: Plan modal schedule preview

Layer / File(s) Summary
Remove the standalone preview
frontend/src/index.html, frontend/src/plans.ts, frontend/src/plan-schedule-preview.ts, frontend/src/styles/plans.css, frontend/src/__tests__/plan-schedule-preview.test.ts, frontend/src/__tests__/plans.test.ts
Removed the preview button, dialog implementation, click handler, standalone preview styles, and tests for the dialog and its form-value preview.
Cover editor gestures and plot rendering
frontend/src/__tests__/plan-editor-panel.test.ts, frontend/src/__tests__/plan-schedule-plot.test.ts, frontend/src/styles/plans.css
Added tests for date-editing gestures, sparse schedule rendering, plot sizing, and selection updates. Scoped focus styling to the plan editor.
Validate inline preview in end-to-end tests
frontend/tests-e2e/plan-schedule-preview.spec.ts
Updated end-to-end coverage to check that the standalone preview is absent and exercise dense inline schedules, scrolling, keyboard navigation, and mobile containment.

Priority: ⬇️ Low

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

Change: Other

Merge Risk: ⚪ Minimal · up to a2f70

The standalone preview has been replaced by the inline preview, with no identified issue requiring a fix before merge. Normal checks still apply.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the primary change: removing the Preview schedule dialog because the schedule preview is now inline.
Linked Issues check Passed Issue #1153 requires the inline read-only preview, removal of the separate button and dialog, narrow-screen horizontal scrolling, and automated coverage. The reviewed head retains the inline preview i…
Out of Scope Changes check Passed The changes stay within issue #1153. Deleted dialog code and tests, replacement editor and plot tests, CSS cleanup, and E2E coverage all support replacing the dialog with the inline preview. The added…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 4 files. (1 skipped: 1 …
Full details: Linked Issues check

Explanation

Issue #1153 requires the inline read-only preview, removal of the separate button and dialog, narrow-screen horizontal scrolling, and automated coverage. The reviewed head retains the inline preview in Create and Edit, removes the button wiring and plan-schedule-preview.ts, and adds E2E checks for absent controls, 100-step rendering, internal scrolling, and no page or modal overflow. The PR retains the deferred editable-date implementation and does not add API writes or Save behavior.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #1153. Deleted dialog code and tests, replacement editor and plot tests, CSS cleanup, and E2E coverage all support replacing the dialog with the inline preview. The added date-gesture tests preserve coverage for the explicitly deferred path; they do not implement or expose that path as new product behavior.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 4 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • 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.

The deleted dialog test was the only check of the leading zero segment
the plot emits when points start at step 1 (the inline preview always
does), and of Escape not reaching the parent modal during a drag.

Part of #1153

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cristim

cristim commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

Merge gate at 34bf36ef6b81a7981651bce7d43be68d2b897b4a

Two independent reviewers (cold brief, non-author) both approve 34bf36ef.

Review 1 (test coverage and deletion completeness): pass 1 requested changes at a2f702be because two checks were lost with the deleted dialog test:

  • The step-1 staircase M 48 prefix (plan-schedule-plot.ts:16). Every inline preview draws it, and removing it left all 238 tests green.
  • The editable Escape stopPropagation (plan-date-interaction.ts:114).

34bf36ef (tests only, +10/-1) restores both. Re-run on a fresh export: removing the prefix (M9) fails "starts the staircase at zero for contiguous steps from step 1", and dropping stopPropagation (M7) fails "rolls back a captured draft on Escape".

The reviewer also mapped every deleted test case. The remaining gaps (M1, M2, M4, M5, M8, M10-M12, M18) survive on main with the old test too, so they are not regressions. Other probes (isPrimary, rounding, pointerId filter, pointer-capture release, geometry change, off-plot guard, plan-draft-dates checks) are killed. The coverage table in the PR body matches. git grep finds no reference to the removed module, button, ids or classes outside the two intentional e2e toHaveCount(0) assertions.

Review 2 (production and UX): approved at a2f702be and again at 34bf36ef. What users lose is only what #1153 accepted: local draft-date editing, which Save never applied, and the dialog's copy of the advanced settings, whose real fields stay in the form. Preview errors now show inline instead of as a toast. No removed CSS selector is still used. Initial focus is asserted for Create and Edit at every width. Footer: Cancel and Save Plan only. closingIssuesReferences is exactly #1153, and #1177 + #1178 + this PR deliver the scope stated on the issue. Nits:

  • Edit has no 100-point e2e check (same panel as Create);
  • Tab from Cancel to Save and Escape to close are not asserted (both are DOM order and generic modal code).

Local verification (macOS):

  • At a2f702be: npm ci, npm run build (1 warning, the existing entrypoint size; the app.js asset warning is gone at 495 KiB), npm run lint (0 errors) and npx jest (109 suites, 3462 passed) pass.
  • tests-e2e/plan-schedule-preview.spec.ts passes 6/6 at 1440x900, 1280x900, 1280x768, 1024x900, 390x900 and 320x900.
  • I and both reviewers looked at the Create screenshots at 1440 and 320: footer with Cancel and Save Plan, form left and preview right at 1440, single column at 320.
  • At 34bf36ef: the full local run passes again (build, lint, jest 109 suites, 3463 passed, 1 skipped).

Threads: none open. CodeRabbit is waived as a merge gate.

@cristim
cristim merged commit 5a95420 into main Oct 20, 2026
28 checks passed
@cristim
cristim deleted the feat/remove-schedule-preview-dialog branch October 20, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/m Days impact/many Affects most users priority/p2 Backlog-worthy severity/low Minor harm type/feat New capability urgency/this-sprint Within the current sprint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(plans): show the schedule preview inline in the plan modal

1 participant