Skip to content

Version 3#2

Open
champion-ibrahim wants to merge 187 commits into
champion-sys:version-3from
frappe:version-3
Open

Version 3#2
champion-ibrahim wants to merge 187 commits into
champion-sys:version-3from
frappe:version-3

Conversation

@champion-ibrahim

Copy link
Copy Markdown
Collaborator

No description provided.

Gajendra Nishad and others added 30 commits February 10, 2026 17:09
fix: correct wiki edit links redirection
…-issue

fix: prevent DiffViewer Shadow DOM from overlaying dialogs
…s-change-requests

Revert "fix: prevent duplicate leaf slugs in change requests"
fix: archive btn not visible in contribution banner
WikiPagePatch references the obsolete "Wiki Page" doctype (replaced by
Wiki Document in v3). Replace with a stub class for backward compat.
Remove apply_markdown_diff, apply_changes, highlight_changes from
wiki/utils.py — no other code calls them. Clean up wiki_page_patch.js.

Phase 3 of the wiki contribution & merge flow refactor plan.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wiki Documents edited from Frappe Desk now automatically update the
space's main_revision via on_update/on_trash doc_events hooks. Guard
flags in apply_merge_revision() and reorder_wiki_documents() prevent
infinite loops. Three new tests verify desk-to-revision sync, CR
visibility, and no double-sync during merge.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… (Phase 2)

Replace line_merge_fallback, merge_content_linewise, merge_content_disjoint,
and merge_content with a single merge_content_three_way() function. Delete
the duplicated retry block in merge_change_request() and unused helpers
edits_conflict/ranges_overlap. Net ~50 lines removed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lpers (Phase 6)

Extract the 60-line monolithic function into _find_existing_draft(),
_is_stale_empty_draft(), and _archive_stale_draft(). Replace duplicated
inline hash comparison with a call to has_revision_changes().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CR working revisions now start empty and only accumulate items as they
are edited (copy-on-write). This eliminates the O(N) clone on CR
creation — a 500-page wiki no longer inserts 500 revision items just
to open the editor.

Key changes:
- create_overlay_revision() replaces clone_revision() for CRs
- get_effective_revision_item_map() merges base + overlay transparently
- ensure_overlay_item() handles copy-on-write for mutations
- Lazy hash computation defers recompute until merge/diff time
- All read/write CR functions updated for overlay awareness
- Data migration patch converts existing open CRs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… (Phase 5)

Merge now only processes changed doc_keys instead of the entire tree.
Fast-forward merges skip 3-way logic entirely. Content-only changes
use frappe.db.set_value() to bypass validation. For a 500-page wiki
with 1 changed page, this reduces merge from O(N) to O(changed).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…utions

# Conflicts:
#	wiki/frappe_wiki/doctype/wiki_change_request/wiki_change_request.py
…sError

When merging a CR, deletions must happen after structural saves so that
children are reparented away before their parent group is deleted.
Extracted shared deletion logic into _delete_wiki_documents helper.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The 800-page/80-group perf test was timing out CI with too many writes.
Moved to wiki/benchmarks/ so it only runs on-demand.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
refactor: overhaul contribution & merge flow for O(1) CR creation and delta-based merges
fix: wiki user unable to view editor sidebar
NagariaHussain and others added 30 commits April 28, 2026 17:36
Gates the TOC headings list in get_web_context on the
Wiki Settings.enable_table_of_contents flag. The existing template and
SPA navigation already collapse the TOC aside on an empty list, so no
template or JS changes are needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reads head_html from the Wiki Settings single via frappe.get_cached_value
and renders it inside <head> on every wiki page, allowing admins to add
analytics, meta tags, or custom <head> markup site-wide.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
chore: enable HTML syntax highlighting for head_html field
The same Wiki Page can be referenced by sidebars in multiple Wiki Spaces.
Wiki Document leaves require globally unique routes, so the second space's
migration was raising ValidationError when it tried to create another leaf
with the same wiki_page route. Skip and log instead during bench migrate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fix: skip duplicate leaf creation during v3 migration
* fix: make v3 wiki migration resumable

* chore: rerun v3 wiki migration patches

* revert: drop forced wiki migration patch reruns
Merging develop to version-3
- Drop get_download_pdf_url helper; build the URL in JS from doc.route.
- Slim download_pdf: remove unused print_format/language params and the
  defensive save/restore around ignore_print_permissions.
- Reduce before_print to one line; have the print template read
  doc.get_wiki_space() and doc.get_formatted("modified") directly.
- Extract download_action_item macro and replace two ~20-line copies in
  document.html's mobile and desktop dropdowns.
- Drop the Content-Disposition regex; derive filename from doc.route.
- Print format: "Downloaded At" -> "Last Updated"; clear forced "en".
- Revert unrelated drive-by changes to wiki_settings.js/json.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Keep the actions dropdown open while the PDF is being prepared so the
  loading spinner stays visible; close it after the download settles.
- Read the route from window.location.pathname on every click instead of
  caching doc.route at Alpine init — SPA navigation updates the URL via
  history.pushState, so this stays in sync with the visible page.
- Print format: show the full breadcrumb (space › group › subgroup) in
  the header eyebrow, not just the space name.
- Style blockquotes in the PDF to match the public-facing prose: italic,
  thicker left rule, and open/close quote marks on the first/last
  paragraph.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Frappe's print CSS pulls in Bootstrap, which sets `blockquote { padding:
10px 20px; font-size: 17.5px }` and `@media print { blockquote { border:
1px solid #999 } }`. Our `border-left` shorthand only overrode the left
side, so the top/right/bottom borders and extra padding leaked through —
the PDF showed a fully-boxed quote with vertical air around the text
instead of the public site's simple left-rule treatment.

Explicitly zero the border and padding before re-applying the left rule.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirror the public-page callout treatment in the print format so
note/tip/caution/danger callouts render with their colored backgrounds
and tinted icons instead of plain icon + text.

While doing this, inline every `var(--...)` reference as a hex value:
wkhtmltopdf's QtWebKit predates CSS Custom Properties, so all our
existing `var(--gray-*)` declarations were silently dropping too — the
header divider, table borders, blockquote rule, and eyebrow colors
weren't rendering either, not just the new callout colors.

Layout note: the public CSS uses `display: grid` with
`grid-template-columns: auto 1fr`; QtWebKit doesn't support Grid, so
the print format floats the icon left and gives `.callout-body` its
own block formatting context via `overflow: hidden`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fix(wiki): order feedback reactions bad -> good
Merging develop into version-3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants