From 5ba380d59052de01ffd96e25663134944c503afc Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 11 May 2026 15:22:01 +0100 Subject: [PATCH] Add how-it-works steps to home page and fix post-OAuth redirect - Add three-step explanation (Search, Review, Save or skip) below the search form on the index page - After a LoginNeeded during save, redirect to OAuth with next= pointing back to the article page showing the same candidate Co-Authored-By: Claude Sonnet 4.6 --- templates/index.html | 33 +++++++++++++++++++++++++++++++-- web_view.py | 3 ++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/templates/index.html b/templates/index.html index 11c14ec..46405a6 100644 --- a/templates/index.html +++ b/templates/index.html @@ -7,11 +7,40 @@

Missing Link

-

Find unlinked mentions of a Wikipedia article and add the links.

-
+

Find Wikipedia articles that mention a topic but don't link to it β€” then add the link.

+
+
+
+
+ πŸ” +
+
Search
+

Enter a Wikipedia article title. Missing Link searches for other articles that mention it by name but don't have a wikilink.

+
+
+
+
+
+ πŸ‘€ +
+
Review
+

For each candidate article, a diff shows exactly what would change. You can see the proposed link in context before doing anything.

+
+
+
+
+
+ βœ… +
+
Save or skip
+

Save the edit directly to Wikipedia with one click, or skip to the next candidate. Log in with your Wikipedia account to save edits.

+
+
+
+
diff --git a/web_view.py b/web_view.py index 6cc669c..ae2564d 100755 --- a/web_view.py +++ b/web_view.py @@ -318,7 +318,8 @@ def handle_post(url_title: str) -> Response: try: do_save(from_title, hit_title) except mediawiki_oauth.LoginNeeded: - return flask.redirect(flask.url_for("start_oauth")) + next_url = flask.url_for("article_page", url_title=url_title, title=hit_title) + return flask.redirect(flask.url_for("start_oauth", next=next_url)) except (mediawiki_api.APIError, api.MediawikiError) as e: return flask.make_response( flask.render_template("error.html", message=f"Save failed: {e}"), 502