Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Refactor: Replace console.log/alert with toast/alert dispatcher

Open
#327 0 comments 0 reactions 0 assignees View on GitHub

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

core functionality enhancement

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

  1. 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
  2. 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.js
  • components/roles-handler/index.js
  • components/projects/project-list-write.js
  • components/line-history/index.js
  • components/legacy-annotator/plain.js
  • components/annotorious-annotator/plain.js
  • components/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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CenterForDigitalHumanities/TPEN-interfaces

All issues in CenterForDigitalHumanities/TPEN-interfaces

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.