refactor(chatRenderer): Refactor chatRenderer.js such that it only contains data, exports, and logic related to rendering chats.#4540
Open
entitycs wants to merge 1 commit into
Conversation
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
commented
Jun 18, 2026
entitycs
left a comment
Author
There was a problem hiding this comment.
Left to serve as an example of what to expect for new contributors looking to help refactor and/or lint.
notes:
- Absolutely no linting on refactor side-effect handling; okay for files being fully refactored
- eg.
chat.jsvschatRenderer.jswherechatRenderer.jsis the refactor target andchat.jsis where a side-effect is handled
- eg.
- Prefer refactor before linting
- In new files, prefer alignment to current understanding of linting path
entitycs
marked this pull request as draft
June 18, 2026 22:30
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jun 18, 2026
entitycs
force-pushed
the
refactor/dev-chatRenderModel
branch
from
June 18, 2026 23:28
d65823d to
e51bd36
Compare
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jun 18, 2026
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jun 22, 2026
entitycs
force-pushed
the
refactor/dev-chatRenderModel
branch
2 times, most recently
from
June 22, 2026 23:06
3515c72 to
d13ec5a
Compare
entitycs
commented
Jun 22, 2026
entitycs
left a comment
Author
There was a problem hiding this comment.
Ready again.
Please consider merging to help alleviate clashing in chatRenderer.js, and allow contributors to see + use extracted logic so they don't have to import or attempt to change chatRenderer, for example, to modify how model names are shortened in the frontend.
entitycs
marked this pull request as ready for review
June 22, 2026 23:29
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jun 23, 2026
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jun 23, 2026
entitycs
marked this pull request as draft
June 26, 2026 22:23
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jul 2, 2026
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jul 5, 2026
entitycs
force-pushed
the
refactor/dev-chatRenderModel
branch
from
July 6, 2026 02:31
08579c4 to
6862be9
Compare
entitycs
marked this pull request as ready for review
July 6, 2026 02:40
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jul 7, 2026
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jul 8, 2026
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jul 8, 2026
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jul 8, 2026
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jul 9, 2026
entitycs
force-pushed
the
refactor/dev-chatRenderModel
branch
from
July 9, 2026 17:58
6862be9 to
71ce963
Compare
Author
|
Ready once again. Combined the original 2 commits into 1. Left concise comment where I adhered to @pewdiepie-archdaemon request for change. About as clean as I can get this. Will try to keep it rebased/updated in case it pops back up the review queue. |
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jul 11, 2026
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jul 11, 2026
entitycs
force-pushed
the
refactor/dev-chatRenderModel
branch
from
July 11, 2026 06:51
71ce963 to
f702fe4
Compare
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jul 12, 2026
No changes to the module's core logic, properties or functionality.
Two 'private' methods were renamed and extracted as utility functions.
- formatCompactNumber: Formats large numbers to K/M shorthand
- previously named `_fmtCtx` inside of chatRenderer
- toTrimmedString: Converts values to trimmed strings, handling null
- previously named `modelValue` inside of chatRenderer
Elements were factored out - none factored in. Exports not belonging to the remaining set of properties and functions were removed. Updates were applied downstream to importing modules so that they use the correct sources of truth moving forward.
fix(test) Update frontend tests touching refactor
Introduces `tests/helpers/valid_imports.py` to help ease the pain of rewriting exact-match import tests when refactoring, reording of modules lists, etc., occurs
Updates tests where needed
- Update stream render test to use rfind for try block detection
- Update XSS test assertions to use new source of truth for safeDisplayImageSrc. Use valid_imports helper to survive refactors.
entitycs
force-pushed
the
refactor/dev-chatRenderModel
branch
from
July 12, 2026 21:48
f702fe4 to
58a3ccf
Compare
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jul 17, 2026
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jul 18, 2026
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jul 19, 2026
entitycs
added a commit
to entitycs/odysseus
that referenced
this pull request
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors chatRenderer.js, extracting all non-rendering, alternate-domain exports and data into logical, extensible parts.
Target branch
dev, notmain. All PRs land indev;mainis curated by the maintainer at each release. If your PR is onmainby accident, click "Edit" on this PR and change the base.Linked Issue
Closes #4047
Type of Change
Checklist
devdocker compose uporuvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.How to Test
Visual / UI changes — REQUIRED if you touched anything that renders
Anything that changes what the UI looks like — buttons, icons, padding, colors, fonts, spacing, layout, CSS, HTML, SVG, or any
static/js/module that draws to the DOM — needs all of the following. PRs that change rendering without these WILL be closed.--red,--fg,--bg,--card,--border, etc.) — do not introduce new color values, font sizes, or spacing units.static/index.html) or plain text.Fira Code) for primary UI text. Don't override.Screenshots / clips