Repository navigation
Report data problems to the console, not to a dialog the reader dismisses - #375
Merged
Merged
Conversation
…sses Three of the four alert() calls in js/ were developer diagnostics that a visitor met as a modal dialog. None of them is something a reader of the map can act on. - warnAboutIncompletePoets() fires at startup, once per poet with no poetDetailName, so a bad import stacks up dialogs. The two lines either side of it already report the same class of problem with console.log. - assertUnreachable() alerts a "this should never happen" message and then throws the same string, so the dialog sits on top of an error the console shows anyway. - parseFilter() does the same when a control bar id does not parse. All three now use console.error. The throw in the last two is unchanged, and the console.error is what survives if anything ever catches it. parseCsvs.js keeps its alert. A CSV that fails to load means an empty map, which is a failure a reader can see but not diagnose, and the dialog is the only thing that says so. The comment there now records that it is the last one and why. Test bookkeeping: loadInitializedData() stubbed globalThis.alert to capture the one alert initializeData() could raise -- Node has no alert, so the stub was also what kept the call from throwing. With the call gone the capture would be dead and the "no alerts" assertion vacuous, so it captures console.error instead and hands it back as errors alongside logs. The browser suite needed no change. Page console errors already go into the same list it asserts is empty, so these three now fail test:browser if they ever fire, where the alert only ever reached the dialog handler. npm test (127 pass), lint, format:check, typecheck and test:browser (28 pass) are clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
davidfdriscoll
force-pushed
the
daviddriscoll-codaio/issue-371-fix
branch
from
August 2, 2026 03:17
c210d85 to
9e7b393
Compare
One conflict, in tests/helpers/loadData.js. #382 extracted the capture into a generic captureReports(fn) and gave loadInitializedData() a raw-CSVs parameter, so that a test can break one row on purpose and read back what startup reported; this branch had replaced the alert() capture with a console.error() one and renamed alerts to errors. Resolved by keeping both: captureReports() and the raw parameter as master has them, capturing console.error rather than stubbing globalThis.alert, and errors as the name throughout. The new missing-id tests read logs, which is unchanged -- getPoet() and getCity() still report with console.log, and warnAboutIncomplete- Poets() skips a poet it cannot resolve, so nothing in them lands on the new channel. npm test (129 pass), lint, format:check, typecheck and test:browser (28 pass) are clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
davidfdriscoll
added a commit
that referenced
this pull request
Aug 2, 2026
…of them (#384) Nothing in CLAUDE.md said how a commit message or a PR description is supposed to look here, so each session re-derived it from whatever the last few commits happened to do. The shape is stable enough to write down: a one-sentence summary and then a fuller description, in both places, with the summary carrying enough of the why to stand on its own in git log. The section is descriptive rather than aspirational. It was written after reading #383, #375 and #382 against the commits they squashed into, and it records what those already do. The summary is imperative and specific, with no type: prefix and no issue number -- the squash merge appends the PR number itself. Subjects on master run 12 to 86 characters, median 59, which is longer than the usual advice and long for a reason, so "shorter is better" is qualified as short-but-specific rather than given a column count. The description carries the argument: what was wrong, what the change does about it, and the decisions the diff cannot show. It closes with a line saying which checks were run. The PR body and the commit message are two renderings of that argument rather than the same text, which is the part most worth recording because it is the easiest to get wrong. The PR bodies use headings, tables and code fences; none of the last twenty-five commit bodies has a heading in it, and they carry the same material as plain ASCII prose, wrapped at about 80 columns, with tables recast as paragraphs or bullets. Two things were left unspecified on purpose. Closes #NNN sits at the top of a PR body and the bottom of a commit message, and #382 said Fixes instead, so there is no settled rule to state. Nor is there one for when a change is small enough to skip the fuller description. The Claude attribution stays: the Co-authored-by trailer and the "Generated with Claude Code" footer are both wanted. The Claude-Session trailer is not, because this repository is public. Seventeen commits on master still carry one and nine PR bodies did until they were edited, but those commits are being left alone -- GitHub keeps refs/pull/N/head forever, so a history rewrite would not actually remove them, and the links resolve to "this session could not be found" for anyone not signed in as their author. What is left is untidy rather than a leak. npm test (133 pass), lint, format:check and typecheck are clean. test:browser was not run: the change is one markdown file and draws nothing. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #371.
Three of the four
alert()calls injs/were developer diagnostics that a visitor met as a modal dialog they had to dismiss. None of them is something a reader of the map can act on.data.js:216Poet X with poetId N lacks a details nameassertUnreachable.js:20<message>: <value>getters.js:111"X" is not a places filterAll three now use
console.error.Why each one
warnAboutIncompletePoets()fires at startup for every poet with nopoetDetailName, so a bad import stacks up dialogs one behind the other. The two lines either side of it already report the same class of problem withconsole.log.assertUnreachable()andparseFilter()alert a message and then throw the same string, so the dialog sat on top of an error the console shows anyway. The throw is unchanged — theconsole.erroris what survives if anything ever catches it.The CSV alert stays
parseCsvs.js:60is the one a reader needs. A CSV that fails to load means an empty map: a failure they can see but not diagnose, and the dialog is the only thing that says so. The comment there now records that it is the last one and why.Test bookkeeping
loadInitializedData()stubbedglobalThis.alertto capture the one alertinitializeData()could raise — Node has noalert, so the stub was also what kept the call from throwing. With the call gone the capture would be dead and theno alertsassertion vacuous, so it capturesconsole.errorinstead and hands it back aserrorsalongsidelogs.The browser suite needed no change, and quietly gets stricter: page console errors already go into the same list
no console errors, page errors or alerts throughoutasserts is empty, so these three now failtest:browserif they ever fire. The alert only ever reached the dialog handler.Not done here
data.js:217-218still useconsole.logfor the missingdatesandsourceson the same poet, so that three-line block now reports at two levels. #371 scoped itself toalert(), and which level those two belong at is a separate call — the helper already capturesconsole.errorif they are raised.npm testnpm run lintnpm run format:checknpm run typechecknpm run test:browser🤖 Generated with Claude Code