[frontend] Duplicated utility functions (esc, el) across 5+ files instead of shared imports #792
Labels
No labels
area:chat
area:core
area:llm
area:routes
area:tools
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sleepy/odysseus#792
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding
Per AGENTS.md: "Writing new helpers without searching for existing ones first" is prohibited. Yet multiple files re-declare the same utility functions locally instead of importing the canonical version from
ui.js:esc()(HTML escape):ui.js:738— canonical exportsettings.js:14— redeclares as wrapperadmin.js:17— redeclares as wrapperusage.js:51— redeclares independently (different implementation!)skills.js:17— redeclares as wrapperel()(getElementById shorthand):ui.js:564— canonical exportsettings.js:13— redeclares locallyadmin.js:16— redeclares locallysearch-chat.js:11— redeclares locallyImpact
usage.jshas a differentesc()implementation — if it differs fromui.js.esc(), some code paths escape differently than othersRecommendation
Replace all local
esc()andel()declarations withimport { esc, el } from './ui.js'or use the existing module references.