Repository navigation
Conversation
caf95f0 to
e40200c
Compare
jserv
left a comment
There was a problem hiding this comment.
Rebase latest main branch instead of merging!
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
Because readers cannot easily return to the original LeetCode problem from a completed interview report, I include the original problem link in completed reports, saved attempts, replays, and Markdown exports so readers can revisit the source while reviewing their answers.
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. |
|
|
||
| function downloadSavedReport(attempt) { | ||
| async function downloadSavedReport(attempt) { | ||
| const problemPages = await loadPageMapForDownload(); |
There was a problem hiding this comment.
downloadSavedReport now waits for loadPageMapForDownload before anything happens. If /problem-pages.json is slow or stalled, the button shows nothing and stays enabled for up to ten seconds. Every extra click starts another export, and all of them download once the map arrives or the time runs out. Ignore clicks (or disable the button) while an export is pending and reset that in finally; downloadReport in web/interview.js needs the same guard.
| void loadPageMap() | ||
| .then((pages) => { | ||
| if (selected === recordingId) | ||
| showOriginalProblem(nodes.report, pages, saved.problemId); | ||
| }) | ||
| .catch(() => {}); |
There was a problem hiding this comment.
No browser test reaches this lookup, or the one renderReport in web/interview.js starts for the report shown right after an interview, which is the case #152 asks for. Only the Past attempts path is driven end to end, so the selected === recordingId guard and the immediate report's link could break with every test still passing. Add one test that finishes an interview and expects the link under the title, and one that opens a second recording before the first lookup settles and checks the first problem's link does not appear on it.
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