Skip to content

Add MyDocument page editing, import/export, and page creation#3692

Merged
tuomas2 merged 13 commits intocurrent-stablefrom
tuomas/my-docs-editing
Mar 18, 2026
Merged

Add MyDocument page editing, import/export, and page creation#3692
tuomas2 merged 13 commits intocurrent-stablefrom
tuomas/my-docs-editing

Conversation

@tuomas2
Copy link
Contributor

@tuomas2 tuomas2 commented Mar 14, 2026

Summary

  • Inline editing of MyDocument pages in WebView using existing MarkdownEditor/HtmlEditor
  • MyDocFooter component (replaces AiFooter): edit link for all pages, regenerate/delete for AI pages
  • MyDocumentPagesActivity: new page creation, Markdown/HTML file import, page export
  • Targeted reload: only windows showing the edited document refresh after save

Test plan

  • Open a MyDocument page → edit link visible in footer
  • Click edit → editor opens with raw content, border visible
  • Edit and close → content reloads with changes
  • AI document pages show edit + regenerate + delete links
  • Non-AI document pages show only edit link
  • MyDocumentPagesActivity: create new page with title + content type
  • Import .md file → new MARKDOWN page created
  • Import .html file → new HTML page created
  • Export page → save/share dialog with correct content
  • Other windows not affected by MyDocument reload

- Inline editing of MyDocument pages via MarkdownEditor/HtmlEditor
  in WebView, triggered from footer edit link
- New MyDocFooter component replaces AiFooter, shows edit link for
  all MyDocument pages and regenerate/delete for AI pages
- MyDocumentPagesActivity: new page creation (with content type
  selection), Markdown/HTML file import, and page export
- Bridge methods: getMyDocumentPageRawContent, saveMyDocumentPageContent,
  reloadMyDocumentPage
- Window listens to MyDocumentUpdatedEvent to reload only affected windows
- MarkdownEditor scroll fix: preserve scroll position during auto-resize
tuomas2 added 12 commits March 17, 2026 21:04
Resolve conflicts in OsisDocument.vue, OsisSegment.vue, and
MyDocumentBackend.kt by keeping current-stable's approach:
AiFooter as Vue component instead of backend-embedded MyDocFooter.
Export writes all pages as numbered files (01-Title.md) to a
user-selected folder. Import creates a new document from multiple
selected .md/.html files.
Remove AiFooter.vue and consolidate into MyDocFooter.vue with
isAiPage prop. All MyDocument pages get edit button; AI pages
also get regenerate and delete. Use FontAwesome icons instead
of emoji characters. Add FontAwesome usage note to CLAUDE.md.
Move "Imported", "page", and "Page N" fallback strings to
strings.xml for localization.
Remove ab-action:// URL scheme and AiDocumentAction enum from
BibleView. Edit uses eventbus emit directly in Vue.js. Regenerate
and delete call new JS interface methods. Footer uses buttons
instead of links.
Re-add EditableText component, edit mode state, and eventbus
listener for start_mydocument_edit that was lost during merge
conflict resolution. Add .stop modifier to footer buttons to
prevent event bubbling.
Guard SwordGenBook.getKey() calls with try-catch for
NullPointerException when the book's internal key map is not
initialized. Affects both MyDocumentPagesActivity and
MyDocumentsActivity result handlers.
Pass pageId with start_mydocument_edit event so only the
correct OsisDocument instance opens the editor when multiple
pages are loaded via infinite scroll.
Deactivate the old SwordGenBook in Activator before unregistering it.
Without this, the Activator's HashSet retained the old instance, and
because AbstractBookMetaData.equals/hashCode matches by name+initials,
the newly registered book was never activated — leaving SwordGenBook's
internal key map null and causing NPE in getKey().

Also reverts the try-catch workaround from cdcf8fa which masked the
real issue.
Combine the separate MyDoc action buttons (edit/regenerate/delete) and
whole-page bookmark icons into a single ButtonRow-based toggle menu
component at the top of each OsisDocument. The toggle icon shows a
bookmark icon when bookmarks exist, or ellipsis otherwise.
Instead of destroying and recreating the SwordGenBook instance (which
causes stale Activator entries due to equals/hashCode matching by
name+initials), reuse the existing instance by deactivating and
reactivating it. This forces readIndex() to reload pages from the
database while keeping the same object identity in Activator's set.
@tuomas2 tuomas2 marked this pull request as ready for review March 18, 2026 18:57
@tuomas2 tuomas2 merged commit 33d66ba into current-stable Mar 18, 2026
11 checks passed
@github-project-automation github-project-automation bot moved this from Needs triage to Closed in Tuomas' project board Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

1 participant