Skip to content

feat: explain when signer has no visible signature field - #8373

Open
nva138 wants to merge 3 commits into
LibreSign:mainfrom
nva138:feat/explain-no-visible-signature
Open

feat: explain when signer has no visible signature field#8373
nva138 wants to merge 3 commits into
LibreSign:mainfrom
nva138:feat/explain-no-visible-signature

Conversation

@nva138

@nva138 nva138 commented Sep 12, 2026

Copy link
Copy Markdown

Resolves: #8325

📝 Summary

Shows an NcNoteCard in the signing sidebar when the current signer has no visible signature field, so the page does not look incomplete.

Reuses hasVisibleElementsForCurrentUser(). I could not reuse needCreateSignature, it also returns false when the instance disallows creating signatures or when the user already has one.

The card is a sibling of the existing v-if chain, not part of it, so "Sign document" stays available.

🧪 How to test

  1. Upload a PDF in LibreSign
  2. Add yourself as signer, but do not place a visible signature element
  3. Request signatures and open the document to sign
  4. The sidebar shows the note card above the "Sign document" button
  5. Signing still works normally
npx vitest run src/tests/views/SignPDF/Sign.spec.ts -t "no visible signature notice"
npx playwright test sign-herself-with-click-to-sign

🎨 UI / Front-end changes

  • Informational note card when the signer has no visible signature field
  • Screenshots before/after
🏚️ Before 🏡 After
before after
  • Tested in multiple browsers (Chrome, Firefox, Safari)
  • Components, Unit (with vitest) and/or e2e (with Playwright) tests added
  • Accessibility verified (contrast, keyboard navigation, screen reader friendly)
  • Design review approved
  • Documentation updated (if applicable)

Tests: component tests for both cases in Sign.spec.ts, and extended sign-herself-with-click-to-sign which already signs without a visible field.

One thing worth your review: the card also shows while a non-retriable certificate error blocks signing, so "Sign.vue - API error handling" now expects 2 note cards instead of 1. The issue describes the condition without exceptions so I kept it, but tell me if you want it hidden there.

✅ Checklist

  • I have read and followed the contribution guide.
  • Conventional commits with DCO sign-off
  • npm test, npm run lint and npm run ts:check pass

🤖 AI (if applicable)

  • The content of this PR was partially generated using AI

Signed-off-by: Maximilian Mayer <office@maximilianmayer.at>
Signed-off-by: Maximilian Mayer <office@maximilianmayer.at>
@nva138
nva138 requested a review from a team as a code owner September 12, 2026 19:58
@github-project-automation github-project-automation Bot moved this to 0. Backlog in Roadmap Sep 12, 2026
Comment thread src/views/SignPDF/_partials/Sign.vue Outdated
<NcRichText :text="error.message"
:use-markdown="true" />
</NcNoteCard>
<NcNoteCard v-if="!hasVisibleSignatureField"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we avoid showing this notice when signing is blocked by a non-retriable error?

The issue says this message should be shown when the signer has no visible element and is in a valid signing flow. In the blocking error state, the user cannot sign at that moment, so showing “Your digital signature will still be added” together with “Signing is blocked” can be confusing.

I think the notice should be hidden when hasBlockingSignError is true, and the existing API error test should continue expecting only the blocking error card.

})
})

describe('Sign.vue - no visible signature notice', () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we cover the behavior requested by the issue at the component level instead of checking only the exposed computed value?

We should verify the rendered notice for these cases:

  • another signer has a visible element, but the current signer does not → notice is shown;
  • the current signer has a visible element, but another signer does not → notice is not shown;
  • when the notice is shown, Sign document is still available.

This is important because the matching by signRequestId is the main behavior we want to protect here. Checking wrapper.vm.hasVisibleSignatureField alone would still pass if the template condition were changed or removed by mistake.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done. The tests now assert the rendered notice instead of the exposed computed,
using two signers.

  • only the other signer has a visible element -> notice is shown
  • the current signer has a visible element -> notice is not shown
  • while the notice is shown, "Sign document" is still rendered

I also removed hasVisibleSignatureField from defineExpose, since nothing reads
it anymore.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The notice is now hidden when hasBlockingSignError is true, and the API
error test expects one card again.

@github-project-automation github-project-automation Bot moved this from 0. Backlog to 1. to do in Roadmap Sep 12, 2026
Signed-off-by: Maximilian Mayer <office@maximilianmayer.at>
@vitormattos vitormattos added this to the Next Major (36) milestone Sep 13, 2026
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Files with missing lines Coverage Δ
src/views/SignPDF/_partials/Sign.vue 59.93% <100.00%> (+8.14%) ⬆️

... and 220 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

Status: 1. to do

Development

Successfully merging this pull request may close these issues.

Explain when a signer has no visible signature field

3 participants