Skip to content

Link reports to original LeetCode problems - #334

Merged
jserv merged 1 commit into
sysprog21:mainfrom
ga-1113:issue-152-leetcode-report-link
Oct 27, 2026
Merged

jserv merged 1 commit into
sysprog21:mainfrom
ga-1113:issue-152-leetcode-report-link

Conversation

@ga-1113

@ga-1113 ga-1113 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

The completed report now shows an Original problem link directly below its title. The link uses the published problem map to open the corresponding LeetCode page.

The same reference appears in the immediate report, Past attempts, replay, and downloaded Markdown. The lobby loads the map only when a saved report is opened or exported. Unknown or malformed mappings leave the line hidden, and the active interview view is unchanged.

Checks: 138 lobby browser tests, 70 render tests, and 8 history tests passed. Prettier 3.9.9 and ESLint 10.12.0 passed for the changed JavaScript files; the local app was manually tested.

Closes #152

cubic-dev-ai[bot]

This comment was marked as resolved.

Comment thread web/app.js Resolved
Comment thread web/render.js Resolved
cubic-dev-ai[bot]

This comment was marked as resolved.

jserv

This comment was marked as outdated.

@ga-1113
ga-1113 force-pushed the issue-152-leetcode-report-link branch from caf95f0 to e40200c Compare October 20, 2026 10:09
jserv

This comment was marked as outdated.

@jserv jserv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jserv

This comment has been minimized.

@jserv

jserv commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@ga-1113 e40200c merges main into this branch. This project updates a pull request by rebasing onto the latest main and force-pushing to the same branch, never by merging main in (see "Pull requests" in CONTRIBUTING.md). That commit also fails scripts/git-commit-msg.sh: its subject is not git's own merge wording, so it gets no merge exemption, and its body is a single 147-character line where the limit is 72. The hooks make hooks installs would have refused it at commit time, so run make hooks once in this clone first. Then run git rebase onto the latest upstream main, which replays your three commits and drops the merge, resolve the interview-import conflicts there, and force-push. The rebase also clears the failing cargo-audit job, since main already carries that fix.

@ga-1113 ga-1113 changed the title Link original LeetCode problems from reports Link reports to original LeetCode problems Oct 22, 2026
@ga-1113
ga-1113 force-pushed the issue-152-leetcode-report-link branch from e40200c to 97fda76 Compare October 22, 2026 08:36
Comment thread web/render.js
/// Find the published problem for a completed scenario. The map's key is the
/// LeetCode URL slug; scenario page names and saved legacy ids both work here.
/// A malformed map entry cannot turn the fixed destination into another host.
export function originalProblemForPage(pages, page) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This puts the published title and LeetCode URL into Past attempts, the replay and the downloaded Markdown. docs/development.md says the opposite: "The title reaches the live interview page only: saved history, the downloaded report and the replay keep the scenario's." It also lists the only reasons web/problem-pages.json is fetched, and every completed report is now one more. Update that paragraph in this PR so the contract matches what ships.

@ga-1113
ga-1113 force-pushed the issue-152-leetcode-report-link branch from 97fda76 to 620efca Compare October 22, 2026 08:56
jserv

This comment was marked as outdated.

@ga-1113
ga-1113 force-pushed the issue-152-leetcode-report-link branch from 620efca to 84bd452 Compare October 23, 2026 05:52
@ga-1113

ga-1113 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest main to include the CI fixes from #434 and resolved the conflict.

@jserv

jserv commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Rebased onto the latest main to include the CI fixes from #434 and resolved the conflict.

Don't leave messages like the above, as GitHub always tracks.

Comment thread web/app.js Resolved
Comment thread web/replay.js Resolved
jserv
jserv previously requested changes Oct 25, 2026

@jserv jserv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase latest main branch and resolve conflicts.

@ga-1113
ga-1113 force-pushed the issue-152-leetcode-report-link branch from 84bd452 to 5b47ed1 Compare October 25, 2026 06:22
Comment thread web/problem-data.js
let timer;
try {
return await Promise.race([
loadPageMap().catch(() => null),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This .catch(() => null) is what lets a download proceed when the map fetch fails or returns malformed JSON. Every test either swaps out loadPageMapForDownload (the download.test.js harness) or only stalls the fetch to hit the timeout (the lobby test), so deleting this catch would leave the suite green while an offline user loses report export. Add a browser test that aborts /problem-pages.json and another that serves invalid JSON, then asserts one Markdown download with no Original problem: line and a re-enabled button.

Comment thread web/interview.js Resolved
Comment thread web/problem-data.js Resolved
@jserv
jserv dismissed their stale review October 26, 2026 03:55

No merge conflicts at the current head.

@jserv jserv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase the current branch onto the upstream default branch and resolve any conflicts. Run /codetrial-review in AI agents (use $codetrial-review in Codex) and resolve all identified issues. Rework the series into minimal, logically coherent commits, squash closely related commits, and ensure all commit messages follow the project’s rules.

@jserv

jserv commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Add screenshots to the pull request description to illustrate your work, as @ColtenOuO suggests. Example: #349

@jserv jserv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase the current branch onto the upstream default branch and resolve any conflicts. Run /codetrial-review in AI agents (use $codetrial-review in Codex) and resolve all identified issues. Rework the series into minimal, logically coherent commits, squash closely related commits, and ensure all commit messages follow the project’s rules.

@ga-1113
ga-1113 force-pushed the issue-152-leetcode-report-link branch from 5b47ed1 to ccfe98d Compare October 27, 2026 16:32
Completed reports need a direct route back to the original problem for
review and further practice. Show the LeetCode reference below the title
in immediate reports, saved attempts, replays, and Markdown exports.
Keep exports usable when the optional lookup fails or times out, prevent
duplicate downloads, and hold Done until saving and exporting finish.
Cover delayed lookups, recording switches, and failed responses in
browser tests so these paths cannot silently regress.

Close sysprog21#152
@ga-1113
ga-1113 force-pushed the issue-152-leetcode-report-link branch from ccfe98d to 8487a6b Compare October 27, 2026 16:39
@jserv
jserv merged commit 9bab719 into sysprog21:main Oct 27, 2026
21 of 23 checks passed
@jserv

jserv commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Thank @ga-1113 for contributing!

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.

Add LeetCode problem reference to completed interview reports

3 participants