Skip to content

Added red/green icon next to signers to show if not signed or signed. - #44

Merged
gbastien merged 3 commits into
mainfrom
PARAF-476_highlight_session_signed_or_not_signed
Jun 16, 2026
Merged

Added red/green icon next to signers to show if not signed or signed.#44
gbastien merged 3 commits into
mainfrom
PARAF-476_highlight_session_signed_or_not_signed

Conversation

@gbastien

@gbastien gbastien commented Jun 12, 2026

Copy link
Copy Markdown
Member

In info viewlet, display signed in green.
See #PARAF-476

Summary by CodeRabbit

Release Notes

  • New Features

    • Added red/green (and refusal) icon indicators next to signers to reflect signature status.
    • Updated the signer “Status” display to style results by status and show tooltip titles for signed, not signed, and refused.
    • Enhanced the info viewlet to highlight “signed” in green.
  • Localization

    • Added new translatable strings for signer status tooltip/title text (English and French).

In info viewlet, display `signed` in green.
See #PARAF-476
@gbastien
gbastien requested review from chris-adam and sgeulette June 12, 2026 11:24
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 31813883-954f-46bd-832a-41cf0c5c6467

📥 Commits

Reviewing files that changed from the base of the PR and between b8b9dde and 699ac22.

📒 Files selected for processing (4)
  • src/imio/esign/locales/en/LC_MESSAGES/imio.esign.po
  • src/imio/esign/locales/fr/LC_MESSAGES/imio.esign.po
  • src/imio/esign/locales/imio.esign.pot
  • src/imio/esign/locales/manual.pot
✅ Files skipped from review due to trivial changes (2)
  • src/imio/esign/locales/en/LC_MESSAGES/imio.esign.po
  • src/imio/esign/locales/imio.esign.pot
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/imio/esign/locales/manual.pot
  • src/imio/esign/locales/fr/LC_MESSAGES/imio.esign.po

📝 Walkthrough

Walkthrough

This pull request adds visual status indicators for signers in the signer list, displaying conditional red/green icon styling based on signed status with HTML-escaped translated tooltips, alongside supporting translation infrastructure updates and changelog documentation.

Changes

Signer status visual indicators with i18n tooltips

Layer / File(s) Summary
UI rendering and template updates
src/imio/esign/browser/table.py, src/imio/esign/browser/templates/macros.pt
The SignersColumn.renderCell method now imports the html module and renders structured HTML for each signer with a font-awesome icon span. The icon is conditionally chosen (edit for signed, ban for refused) along with CSS class selection (signer-signed, signer-refused, signer-not-signed). The translated status tooltip text is HTML-escaped before insertion into the title attribute. The signers macro template wraps the status cell in a span with conditional signer-<status> CSS class.
New translation message IDs
src/imio/esign/locales/en/LC_MESSAGES/imio.esign.po, src/imio/esign/locales/fr/LC_MESSAGES/imio.esign.po, src/imio/esign/locales/imio.esign.pot, src/imio/esign/locales/manual.pot
Three new message IDs are added for signer status titles: status_title_signed, status_title_not_signed, and status_title_refused. French translations are provided for all three ("Ce signataire a signé la session", "Ce signataire n'a pas encore signé la session", "Ce signataire a refusé la session" respectively).
Translation metadata and source references
src/imio/esign/locales/en/LC_MESSAGES/imio.esign.po, src/imio/esign/locales/fr/LC_MESSAGES/imio.esign.po, src/imio/esign/locales/imio.esign.pot
POT-Creation-Date timestamps are updated and source reference comments are refreshed across all translation files to reflect the restructured rendering logic in table.py.
Changelog documentation
CHANGES.rst
Added entry under 1.0b10 (unreleased) documenting the red/green signer status icons and the green "signed" display in the info viewlet.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • sgeulette

Poem

🐰 A signer's fate displayed so bright,
With icons red and green as light,
Each tooltip whispers who has signed,
Translations perfect, well-designed!
Status badges, clean and clear,
Progress tracked throughout the year! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding visual indicators (red/green icons) next to signers to show signing status, which matches the core functionality across all modified files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch PARAF-476_highlight_session_signed_or_not_signed

Comment @coderabbitai help to get the list of available commands and usage tips.

@coveralls

coveralls commented Jun 12, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 27603847520

Coverage decreased (-0.2%) to 85.962%

Details

  • Coverage decreased (-0.2%) from the base build.
  • Patch coverage: 5 uncovered changes across 1 file (9 of 14 lines covered, 64.29%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
src/imio/esign/browser/table.py 14 9 64.29%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1325
Covered Lines: 1139
Line Coverage: 85.96%
Coverage Strength: 0.86 hits per line

💛 - Coveralls

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
src/imio/esign/locales/en/LC_MESSAGES/imio.esign.po (1)

521-527: ⚡ Quick win

Provide English translations for new status title keys.

The new msgids status_title_not_signed and status_title_signed have empty msgstr values. English users will see the raw msgid keys (e.g., "status_title_not_signed") instead of user-friendly text.

📝 Suggested English translations
 #: ../browser/table.py
 msgid "status_title_not_signed"
-msgstr ""
+msgstr "This signer has not yet signed the session"

 #: ../browser/table.py
 msgid "status_title_signed"
-msgstr ""
+msgstr "This signer has signed the session"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/imio/esign/locales/en/LC_MESSAGES/imio.esign.po` around lines 521 - 527,
Update the English .po entries for the two new msgids by filling their msgstr
values so users see friendly text: set msgid "status_title_not_signed" msgstr to
something like "Not signed" and set msgid "status_title_signed" msgstr to
"Signed" (or other agreed-upon English phrases) in imio.esign.po to replace the
empty strings.
src/imio/esign/browser/table.py (2)

20-20: ⚡ Quick win

Remove redundant import.

The html module is imported here, but escape is already imported from html at line 4. Line 117 calls html.escape() when it could simply use escape() directly.

♻️ Simplify by removing line 20 and using the imported function directly
-import html

Then at line 117, change:

-                        html.escape(
+                        escape(
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/imio/esign/browser/table.py` at line 20, Remove the redundant top-level
"import html" and use the already-imported escape function instead of
html.escape(); specifically delete the "import html" statement and replace all
usages of html.escape(...) (e.g., in the code path that renders table cells)
with escape(...) so the module relies on the existing "from html import escape"
import.

113-113: ⚡ Quick win

Apply consistent encoding to email field.

The email field at line 113 is not wrapped in safe_encode(), while fullname (line 111) and position (line 112) are. This inconsistency could lead to encoding issues if the email contains special characters.

♻️ Wrap email in safe_encode for consistency
-                s.get("email"),
+                safe_encode(s.get("email", "")),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/imio/esign/browser/table.py` at line 113, The email field is not encoded
consistently with fullname and position; wrap s.get("email") with safe_encode()
just like fullname and position to prevent encoding issues, i.e., replace
s.get("email") with safe_encode(s.get("email")) in the same code block (look for
safe_encode, fullname, position and s.get("email") in the table generation
function in table.py).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/imio/esign/browser/table.py`:
- Line 112: The call to safe_encode(s.get("position")) can receive None if
"position" is missing; update the code that builds the position value to provide
a safe default (e.g., use s.get("position", "") or otherwise coerce to an empty
string) before calling safe_encode so safe_encode never receives None; locate
the safe_encode(s.get("position")) usage and replace the get(...) call with a
defaulted variant.

---

Nitpick comments:
In `@src/imio/esign/browser/table.py`:
- Line 20: Remove the redundant top-level "import html" and use the
already-imported escape function instead of html.escape(); specifically delete
the "import html" statement and replace all usages of html.escape(...) (e.g., in
the code path that renders table cells) with escape(...) so the module relies on
the existing "from html import escape" import.
- Line 113: The email field is not encoded consistently with fullname and
position; wrap s.get("email") with safe_encode() just like fullname and position
to prevent encoding issues, i.e., replace s.get("email") with
safe_encode(s.get("email")) in the same code block (look for safe_encode,
fullname, position and s.get("email") in the table generation function in
table.py).

In `@src/imio/esign/locales/en/LC_MESSAGES/imio.esign.po`:
- Around line 521-527: Update the English .po entries for the two new msgids by
filling their msgstr values so users see friendly text: set msgid
"status_title_not_signed" msgstr to something like "Not signed" and set msgid
"status_title_signed" msgstr to "Signed" (or other agreed-upon English phrases)
in imio.esign.po to replace the empty strings.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e6832a0b-5384-4db7-bd53-6a759844035b

📥 Commits

Reviewing files that changed from the base of the PR and between c9403ce and a39b29d.

📒 Files selected for processing (7)
  • CHANGES.rst
  • src/imio/esign/browser/table.py
  • src/imio/esign/browser/templates/macros.pt
  • src/imio/esign/locales/en/LC_MESSAGES/imio.esign.po
  • src/imio/esign/locales/fr/LC_MESSAGES/imio.esign.po
  • src/imio/esign/locales/imio.esign.pot
  • src/imio/esign/locales/manual.pot

Comment thread src/imio/esign/browser/table.py Outdated
"<li>%s, %s%s (%s)</li>" % (
"<li>%s, %s (%s) %s</li>" % (
safe_encode(s.get("fullname", "")),
safe_encode(s.get("position")),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Provide default value for position field.

The position field uses .get("position") without a default value. If the key is missing, None will be passed to safe_encode(), which may raise an error or produce unexpected output.

🛡️ Add empty string default
-                safe_encode(s.get("position")),
+                safe_encode(s.get("position", "")),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
safe_encode(s.get("position")),
safe_encode(s.get("position", "")),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/imio/esign/browser/table.py` at line 112, The call to
safe_encode(s.get("position")) can receive None if "position" is missing; update
the code that builds the position value to provide a safe default (e.g., use
s.get("position", "") or otherwise coerce to an empty string) before calling
safe_encode so safe_encode never receives None; locate the
safe_encode(s.get("position")) usage and replace the get(...) call with a
defaulted variant.

@gbastien
gbastien merged commit 81e19ae into main Jun 16, 2026
6 of 7 checks passed
@gbastien
gbastien deleted the PARAF-476_highlight_session_signed_or_not_signed branch June 16, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants