Refactor: Replace console.log/alert with toast/alert dispatcher
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- frontend
Research direction
Start by reviewing the listed UI files, especially manage/projectsHighlight.js, components/roles-handler/index.js, and the classroom directory, then trace the existing eventDispatcher usage for tpen-toast and tpen-alert. Inventory the remaining console and alert calls and determine which are user-facing versus debugging. Done means the affected calls follow one agreed notification or logging approach across the listed files, with no unexplained production notifications left.
Written by the indexing model from the issue text.
Description
Description
Multiple UI components currently use console.log(), console.debug(), and alert() for user notifications and debugging. This creates inconsistent UX and noisy console output.
Current State
Found 40+ instances across the codebase:
console.log()in various components (line-history, projects, classroom, etc.)alert()calls in roles-handler, projects, legacy-annotator, etc.
Proposed Solution
-
Route user-facing messages through the existing toast/alert dispatcher system:
- Use
eventDispatcher.dispatch('tpen-toast', { status, message })for notifications - Use
eventDispatcher.dispatch('tpen-alert', { message, buttonText })for confirmations
- Use
-
For debug logging, consider:
- Remove debug logs entirely from production code
- Use a debug flag/wrapper that respects environment (dev vs prod)
- Leverage browser dev tools instead of inline logs
Files Affected
manage/projectsHighlight.jscomponents/roles-handler/index.jscomponents/projects/project-list-write.jscomponents/line-history/index.jscomponents/legacy-annotator/plain.jscomponents/annotorious-annotator/plain.jscomponents/classroom/(multiple files)api/Project.js
Benefits
- Consistent user experience
- Cleaner console output in production
- Better error tracking and user feedback
- Easier to test notification flows
- 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
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ericcornelissen/depreman#591 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
NanmiCoder/dsh-agent-teams#269 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
docs
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
idean3885/claude-ops-agent#765 ·
Maintainers usually reply within 1 day
-
docs html v6
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day