CenterForDigitalHumanities / CenterForDigitalHumanities/TPEN-services
History tool default URL points to a 404 path
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
The default `history` tool registration in `classes/Tools/Tools.js:221` points to `https://app.t-pen.org/components/line-history/index.js`, which returns **404 Not Found**. There is no `components/line-history/` directory in `tpen3-interfaces`. The component is actually published on GitHub Pages from the [tpen-line-history](https://github.com/CenterForDigitalHumanities/tpen-line-history) repo.
As a result, every project created with the default tool set inherits a broken `history` tool URL. In the splitscreen interface (`components/simple-transcription/index.js`) the script branch tries to load the URL and fails with `net::ERR_ABORTED 404`, so the `` element never gets defined and the pane stays blank.
## Reproduction
1. Open any project with the default tool set in the simple-transcription splitscreen.
2. Activate the History tool.
3. DevTools console shows: `GET https://app.t-pen.org/components/line-history/index.js net::ERR_ABORTED 404 (Not Found)`.
## Suggested fix
In `classes/Tools/Tools.js`, change line 221:
```diff
- "url": "https://app.t-pen.org/components/line-history/index.js",
+ "url": "https://centerfordigitalhumanities.github.io/tpen-line-history/tpen-line-history.js",
```
(The filename is `tpen-line-history.js`, matching the repo's `package.json#main` — not `index.js`.)
## Migration note for existing projects
Existing project documents in MongoDB carry the bad URL embedded in their `tools` array. After the source fix lands, a one-time update is needed:
```javascript
db.projects.updateMany(
{ "tools.toolName": "history" },
{ $set: { "tools.$[t].url": "https://centerfordigitalhumanities.github.io/tpen-line-history/tpen-line-history.js" } },
{ arrayFilters: [ { "t.toolName": "history", "t.url": "https://app.t-pen.org/components/line-history/index.js" } ] }
)
```
Contributor guide
Research direction
Start at classes/Tools/Tools.js:221 and inspect the default history tool registration, then review components/simple-transcription/index.js to understand how the URL is loaded. Done means the registration uses the published tpen-line-history.js entry point, the History pane loads without a 404, and the migration note for existing project documents is addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100