feat(editorial): add :Leet editorial command #230

Open
thecuriousone25 wants to merge 1 commit from thecuriousone25/feat-editorial into master
thecuriousone25 commented 2026-08-02 16:39:09 -05:00 (Migrated from github.com)

Open a problem's official solution article (editorial) in a floating popup, styled like :Leet info / :Leet hints.

What it does

  • api: question.editorial(slug) via ugcArticleOfficialSolutionArticle and question.playground(uuid) via allPlaygroundCodes. Both tolerate null/missing GraphQL data and malformed responses.
  • ui: new Editorial popup (leetcode-ui/popup/editorial.lua) with a self-contained markdown renderer (headings, lists, blockquotes, rules, fenced code, inline emphasis). Each editorial <iframe> playground embed is replaced inline with its actual code, fetched from the playground API, as a fenced code block. Content loads lazily on first open.
  • premium: editorials are only sometimes premium-gated. The fetch is skipped only when a paid-only problem meets a non-premium user (per config.auth.is_premium); every other case is fetched and falls back to "No editorial available" if declined, so public editorials on free problems still load.

Usage

:Leet editorial while a problem is open.

Open a problem's official solution article (editorial) in a floating popup, styled like `:Leet info` / `:Leet hints`. ## What it does - **api**: `question.editorial(slug)` via `ugcArticleOfficialSolutionArticle` and `question.playground(uuid)` via `allPlaygroundCodes`. Both tolerate null/missing GraphQL `data` and malformed responses. - **ui**: new `Editorial` popup (`leetcode-ui/popup/editorial.lua`) with a self-contained markdown renderer (headings, lists, blockquotes, rules, fenced code, inline emphasis). Each editorial `<iframe>` playground embed is replaced inline with its actual code, fetched from the playground API, as a fenced code block. Content loads lazily on first open. - **premium**: editorials are only *sometimes* premium-gated. The fetch is skipped only when a paid-only problem meets a non-premium user (per `config.auth.is_premium`); every other case is fetched and falls back to "No editorial available" if declined, so public editorials on free problems still load. ## Usage `:Leet editorial` while a problem is open.
thecuriousone25 commented 2026-08-04 14:38:11 -05:00 (Migrated from github.com)

@kawre Can you please take a look at this?

@kawre Can you please take a look at this?
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin thecuriousone25/feat-editorial:thecuriousone25/feat-editorial
git switch thecuriousone25/feat-editorial

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff thecuriousone25/feat-editorial
git switch thecuriousone25/feat-editorial
git rebase master
git switch master
git merge --ff-only thecuriousone25/feat-editorial
git switch thecuriousone25/feat-editorial
git rebase master
git switch master
git merge --no-ff thecuriousone25/feat-editorial
git switch master
git merge --squash thecuriousone25/feat-editorial
git switch master
git merge --ff-only thecuriousone25/feat-editorial
git switch master
git merge thecuriousone25/feat-editorial
git push origin master
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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
arduinohatesme/leetcode.nvim!230
No description provided.