Repository navigation
Link reports to original LeetCode problems - #334
Conversation
caf95f0 to
e40200c
Compare
jserv
left a comment
There was a problem hiding this comment.
Check CONTRIBUTING.md carefully.
Improve git commit messages per https://cbea.ms/git-commit/ :
- Separate subject from body with a blank line
- Limit the subject line to 50 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line
- Wrap the body at 72 characters
- Use the body to explain what and why vs. how
Don’t make the same mistakes again! Run make hooks in advance.
This comment has been minimized.
This comment has been minimized.
|
@ga-1113 e40200c merges |
e40200c to
97fda76
Compare
| /// 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) { |
There was a problem hiding this comment.
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.
97fda76 to
620efca
Compare
620efca to
84bd452
Compare
|
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. |
jserv
left a comment
There was a problem hiding this comment.
Rebase latest main branch and resolve conflicts.
84bd452 to
5b47ed1
Compare
| let timer; | ||
| try { | ||
| return await Promise.race([ | ||
| loadPageMap().catch(() => null), |
There was a problem hiding this comment.
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.
jserv
left a comment
There was a problem hiding this comment.
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.
|
Add screenshots to the pull request description to illustrate your work, as @ColtenOuO suggests. Example: #349 |
jserv
left a comment
There was a problem hiding this comment.
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.
5b47ed1 to
ccfe98d
Compare
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
ccfe98d to
8487a6b
Compare
|
Thank @ga-1113 for contributing! |
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