Skip to content

[OP-19358] Show popover values verbatim - #25123

Open
myabc wants to merge 1 commit into
feature/dream-813-shared-popover-caretfrom
bug/op-19358-popover-values-verbatim
Open

[OP-19358] Show popover values verbatim#25123
myabc wants to merge 1 commit into
feature/dream-813-shared-popover-caretfrom
bug/op-19358-popover-values-verbatim

Conversation

@myabc

@myabc myabc commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Note

Stacked on #25112 (DREAM-813). Only the last commit belongs to this PR.

Ticket

https://community.openproject.org/wp/OP-19358

What are you trying to accomplish?

The "My spent time" popover showed non-ASCII values as numeric character references (Ша…) while the labels and the entry block behind it rendered the same text correctly.

Every value went through DomSanitizer.sanitize(SecurityContext.HTML, …), which serialises non-ASCII characters as &#NNNN;. lit then bound the result as text, so the references were displayed literally.

Screenshots

Before After
My spent time popover showing numeric character references before the fix My spent time popover showing Cyrillic text after the fix

What approach did you choose and why?

Drops the sanitizer: lit's text binding already escapes, so no HTML was ever rendered from these strings. Row building moves out of the component into timeEntryPopoverRows() next to the lit template, so it is a pure function with a spec covering Cyrillic values and a comment containing <b> staying a literal string.

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@myabc
myabc requested review from a team and a lite review from Copilot September 3, 2026 19:36
@myabc myabc added this to the 17.9.x milestone Sep 3, 2026
@myabc myabc added bugfix needs review javascript Pull requests that update Javascript code labels Sep 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The functional change is well-scoped and backed by targeted tests; remaining feedback is a small import hygiene improvement.

Pull request overview

Fixes incorrect rendering of non-ASCII strings in the “My spent time” popover by avoiding HTML sanitization that serialized characters into numeric references, and by moving row construction into a pure helper with focused unit coverage.

Changes:

  • Remove DomSanitizer.sanitize(SecurityContext.HTML, …) from popover value handling so lit text bindings render verbatim characters.
  • Extract popover row construction into timeEntryPopoverRows() as a pure function.
  • Add specs covering Cyrillic values and verifying values are bound as text (not markup).
File summaries
File Description
frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts Stops sanitizing popover values and delegates row creation to a helper.
frontend/src/app/features/calendar/te-calendar/te-calendar-popover.ts Introduces TimeEntrySchema/timeEntryPopoverRows() and keeps popover template text-bound.
frontend/src/app/features/calendar/te-calendar/te-calendar-popover.spec.ts Adds tests for verbatim non-ASCII output and “no markup rendering” behavior.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@myabc
myabc force-pushed the bug/op-19358-popover-values-verbatim branch from 1c38d73 to 864da05 Compare September 3, 2026 19:43
@myabc
myabc marked this pull request as ready for review September 3, 2026 19:43
Angular's HTML sanitizer encodes every non-ASCII character as a numeric
character reference, and lit binds the result as text, so Cyrillic
values showed up as "&#1058;…". Drops the sanitizer: lit's text binding
already escapes, so no HTML was ever rendered from these strings. Moves
row building next to the template so it can be unit-tested.

https://community.openproject.org/wp/OP-19358
@myabc
myabc force-pushed the bug/op-19358-popover-values-verbatim branch from 864da05 to 6c9c042 Compare September 4, 2026 08:32
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Warning

Flaky specs

  • rspec ./spec/features/projects/creation_wizard/wizard_from_template_flow_spec.rb[1:1]
🤖 Ask Copilot to investigate

Copy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer.

@copilot The following spec(s) are flaky in CI (first seen on PR #25123, linked for reference only):

- `rspec ./spec/features/projects/creation_wizard/wizard_from_template_flow_spec.rb[1:1]`

Treat this as a standalone task, unrelated to PR #25123. Create a new branch from origin/dev and open a new pull request targeting dev — do not stack it on PR #25123 or reuse that branch.

Follow the playbook in docs/development/testing/handling-flaky-tests/README.md to find the root cause and fix the underlying race — do not skip, delete, or weaken the spec to make it pass; disabling is a last resort per the playbook, and only with a bug ticket. Verify the fix by running the spec(s) repeatedly (e.g. `script/bulk_run_rspec --run-count 10`).

If you cannot reproduce the flake or are not confident in a fix after reasonable investigation, do not fabricate a change or skip the spec to force CI green. Instead, leave the pull request in draft and document what you tried, the suspected cause, and any leads in its description, then assign @myabc to take over.

Once the fix is verified, title the PR after the spec(s) it fixes, and use the PR description to explain the root cause, how the change resolves it, and the before/after results. Label the PR `flaky-spec`, assign @myabc, and request a review from @myabc.
On every commit, set @myabc as the sole co-author with a `Co-authored-by:` trailer (use their GitHub no-reply email so it links to their account), so it is traceable who dispatched the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix javascript Pull requests that update Javascript code needs review

Development

Successfully merging this pull request may close these issues.

3 participants