Bridge a postMessage type to TPEN.eventDispatcher so iframed tools can refresh the page
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- javascript
- Domain
- frontend
Research direction
Start in simple-transcription/index.js at handleToolMessages (line 942), and trace the existing postMessage handling for REQUEST_TPEN_ID_TOKEN and line-navigation message types. Compare that flow with TPEN_CONTEXT and the JSON-paste fallback after a successful page PUT. Done should include an agreed parent-refresh message path and a refreshed parent transcription view, but the issue does not specify the message type or tests.
Written by the indexing model from the issue text.
Description
Problem
In-document components (e.g. tpen-transcription-block) can refresh the simple-transcription view after mutating project data because they share the TPEN.eventDispatcher singleton with simple-transcription — they dispatch on the bus and simple-transcription re-renders.
Iframed splitscreen tools cannot reach that bus. The only channel out is postMessage, and simple-transcription/index.js#handleToolMessages (line 942) currently only forwards REQUEST_TPEN_ID_TOKEN and routes line-navigation message types — there's no handler that lets a tool ask the parent to invalidate cached page data and repaint.
This blocks the JSON-paste fallback flow from refreshing the parent transcription view after a successful page PUT, and would block any future iframed tool that mutates project state.
Suggestion
Pass the parent current interface in via TPEN_CONTEXT (such as /transcribe). That will give us the ability to know the parent interface, and the child can attempt parent navigation or refresh from there.
or
Pass a message back out from the iframed child that tells the parent to repaint.
When a copy-and-paste fallback succeeds we want to see the data in the interface. There is a cheap hack to force the parent interface to reload right now.
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CenterForDigitalHumanities/TPEN-interfaces
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
License link borkedOpen
Difficulty 1/5 Under an hour Newbie friendliness 68/100
All issues in CenterForDigitalHumanities/TPEN-interfaces
Similar issues
-
data
Difficulty 1/5 Under an hour Newbie friendliness 74/100
gaseous-project/hasheous#637 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
gramps-project/gramps-web#1549 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
change request evaluating
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
sindresorhus/eslint-plugin-unicorn#3907 ·
Maintainers usually reply within 1 day
-
Priority: Low Production Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
GrottoCenter/grottocenter-api#1903 ·
Maintainers usually reply within 1 day