Files
wekan/docs/Features/Cards/QR-Code.md
T
Lauri Ojansivu 942d1f022c Docs: Card actions: what each feature is, how to use it, how its numbers are calculated, how it works, and its commits.
Copy, Move, Link, More, QR code, Create board from card, Drawing, Flow fields,
Flowtime and Pomodoro, Planning Poker, Linked cards and Requested/Assigned By
follow one structure, checked against the code: Create board from this card is
no longer hidden from members who can edit the card, a Pomodoro break ends in
ready-to-start rather than the next work interval, a Pomodoro stopped during
Work credits the minutes worked, and the timers have their own Board Settings /
Card rows instead of depending on Time Tracking.

Thanks to xet7 !
2026-11-22 18:31:21 +02:00

3.6 KiB
Raw Blame History

Card menu / QR code

What it is

Card menu (☰ in the opened card's header, Card Actions) → QR code shows the card's link as a QR code, to open the card on a phone or tablet (#2015; cardQrCodePopup in client/components/cards/cardDetails.jade). Point the phone's camera at the screen and the card opens there, without typing its address.

Read more

How to use it

  1. Open the card and click ☰ in its header (Card Actions).
  2. Under Share and history, click QR code.
  3. Scan the code with a phone or tablet, and sign in there if asked.

Who sees it

Every signed-in user who can open the card. It changes nothing.

What it shows

  • The QR code of the card's absolute address (the same one Copy link to clipboard copies; see Board item links), 264 × 264 pixels.
  • Scan it to open this card on a phone or tablet. and the address as text.
  • If the address is too long for the encoder: The link of this card is too long for a QR code.

The code is drawn in the browser by models/lib/qrCode.js (byte mode, error correction level M, versions 1-10, up to 213 bytes). Nothing is sent anywhere. Whoever scans it still has to sign in and have access to the board.

How the numbers are calculated

From models/lib/qrCode.js:

  • Version: the smallest of versions 1-10 whose level-M byte capacity holds the address's UTF-8 bytes (versionFor). Capacity is the sum of the data codewords of its blocks (BLOCKS_M), less the mode and length bits; version 1 holds 14 bytes, version 10 holds 213. Over 213 bytes there is no code, and the "too long" message is shown.
  • Size: version × 4 + 17 modules a side (21 for version 1, 57 for version 10), plus a quiet zone of 4 modules on every side.
  • Mask: each of the eight masks is tried and the one with the lowest penalty score of the standard is used (penalty).
  • Error correction: Reed–Solomon over GF(256) with the polynomial x^8 + x^4 + x^3 + x^2 + 1; level M restores about 15 % of the codewords.
  • Picture: drawn as SVG at 6 pixels a module (qrSvg(url, { scale: 6 })) and shown 264 × 264 pixels.

How it works in WeKan

  • Client: Template.cardQrCodePopup in client/components/cards/cardDetails.js takes card.absoluteUrl(), calls qrSvg, and shows it as a data:image/svg+xml image. The SVG is the encoder's own markup, never the link's text.
  • Encoder: models/lib/qrCode.js, pure, with no dependency.
  • Tests: tests/qrCode.test.cjs checks the encoder against qrcode-svg, the encoder Meteor's own accounts-2fa ships, and the popup's template.

Commits