Editor: live code view beside the editor; unchanged drafts are not kept #60

Merged
anas merged 1 commits from feature/editor-code-view into main 2026-10-08 23:21:10 +00:00
Owner

Owner requests.

کوڈ (code view)

  • A toolbar button shows the Divan text beside the editor (stacked on phones), updated as you type.
  • It is read-only; the سورس tab still edits the text directly.

Unchanged drafts are not kept

  • Opening a work in the editor is not a change. A draft is listed (my drafts, the work's history, activity) only once its text differs from the text it started from.
  • Saving a draft with no change deletes it, goes back to the moderation page and says "متن میں کوئی تبدیلی نہیں تھی، اس لیے مسودہ نہیں رکھا گیا۔".
  • The comparison is made on normalised Divan text, so the editor's blank line after the header doesn't count as a change.
  • A returned draft (it has review history) is kept, but submitting it unchanged is refused.

Tested

  • npm test: 36 pass. The moderation test covers: an unchanged draft is not listed; a layout-only difference counts as no change and the draft is dropped; a changed draft is listed.
  • Headless Chrome as an admin:
    • کوڈ is off by default; turned on, it shows the text side by side and updates as you type;
    • undo, then save, redirects with the notice and leaves no draft.
  • The temporary account was removed.

Local data: the owner's six local drafts were all identical to the published text and were removed (no content lost).

🤖 Generated with Claude Code

Owner requests. **کوڈ (code view)** - A toolbar button shows the Divan text beside the editor (stacked on phones), updated as you type. - It is read-only; the سورس tab still edits the text directly. **Unchanged drafts are not kept** - Opening a work in the editor is not a change. A draft is listed (my drafts, the work's history, activity) only once its text differs from the text it started from. - Saving a draft with no change deletes it, goes back to the moderation page and says "متن میں کوئی تبدیلی نہیں تھی، اس لیے مسودہ نہیں رکھا گیا۔". - The comparison is made on normalised Divan text, so the editor's blank line after the header doesn't count as a change. - A returned draft (it has review history) is kept, but submitting it unchanged is refused. **Tested** - `npm test`: 36 pass. The moderation test covers: an unchanged draft is not listed; a layout-only difference counts as no change and the draft is dropped; a changed draft is listed. - Headless Chrome as an admin: - کوڈ is off by default; turned on, it shows the text side by side and updates as you type; - undo, then save, redirects with the notice and leaves no draft. - The temporary account was removed. **Local data:** the owner's six local drafts were all identical to the published text and were removed (no content lost). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
anas added 1 commit 2026-10-08 23:20:06 +00:00
- کوڈ in the toolbar: the Divan text next to the editor (stacked on phones), updated as you type; the سورس tab still edits it.
- A draft is only listed (my drafts, history, activity) once its text differs from the text it started from;
  saving it unchanged drops it (compared as Divan text, so layout-only differences don't count) and says so;
  submitting an unchanged returned draft is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anas merged commit 0a4d1f7b0f into main 2026-10-08 23:21:10 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: anas/divan#60
No description provided.