oliver-zehentleitner / maity

clean-up: web project views: members via memberRef, one word table, contract parts shared, Why path, overview card links

Sign in to report

tsk-0w7k8adn6q4e Open

From the web clean-up audit, area 17 (tsk-hgnbapyw7hnh), read at 80647565 (findings sent to lotse, seq 125512). Line numbers are from 80647565, so re-check them on current main.

#34 Memory / restricted / board: members are named without the one helper, against views.md:1003 (design).

  • Where:
  • memory.js:28 (authorOf)
  • restricted.js:270 (by())
  • board.js:109-116 (the assignee builds its own ctx.link("team", ...) anchor)
  • board.js:277 (approvals as ctx.nameOf text)
  • The hand-built assignee link skips the checks in memberRef: it is linked even when the member is outside the project or not listed.
  • Proposal: use memberRef(ctx, who, {text: "handle", instance}), with {avatar: 16} for the assignee.
  • Effort S. Risk low: DOM and smoke selectors.

#35 Overview / board / card panel / chat / org: word tables are copied (duplication).

  • Columns are labelled three times: overview.js:16-35 (COLUMNS, COLUMN_LABELS), board-edit.js:111-120 (COLUMNS, columnName) and board.js:779 (COLUMN_GROUPS).
  • CHECK_WORDS is identical in board.js:40-45 and card-panel.js:91-96.
  • PRESENCE_WORDS in board.js:51-55 repeats the unexported table at dom.js:420. More copies are in chat.js:24 and org.js:131 (and the team views, tsk-kgph82yystd8 sibling card #28).
  • Proposal: add checks and presence sets to M.dom.word. Overview and board use M.boardEdit.COLUMNS and columnName.
  • Effort S. Risk low.

#36 Contract view and contract card section: duplicated parts (duplication).

  • Where: contract.js:20, 24-31, 64-76 and contract-panel.js:18, 21-30, 36, 50-76.
  • DEFAULT_PATH is defined twice. The exported M.contractView.DEFAULT_PATH has no reader.
  • The WHY reason tables overlap (not_found_on_forge, too_large, not_text, probe_*).
  • The "read at ref, ago, file, Refresh" line and the unresolved-error paragraph are each built twice.
  • contract-panel.js:36 mayEdit reimplements M.boardEdit.editable (board-edit.js:57).
  • Proposal: share meta() and unresolved() from contract.js, keep one WHY table, and use the exported DEFAULT_PATH and editable.
  • Effort S. Risk low.

#40 Why tab (ktw-host): parses the address bar instead of using ctx.link (design).

  • Where: ktw-host.js:219-222 (whyPath), app.js:1935.
  • whyPath splits M.route.current().path to build /owner/slug/why. makeHost already receives ctx, and ctx.link("why") gives the same thing.
  • The result is stored in a field misleadingly named slug (ktw-host.js:299, 441).
  • Proposal: use ctx.link("why") and rename the field to prefix, adjusting smoke.js:3029.
  • Effort S. Risk low.

#41 Overview / Swarm: a dead "no card route" workaround and drifted comments (debt/docs drift).

  • overview.js:252-253 says "The board has no card route yet: a report links to the board". The tasks/id route exists, and swarm.js already uses ctx.link("tasks", ...). So the latest reports still link to the whole board instead of the card.
  • swarm.js:7 says "There is no Swarm tab", but overview.js:53 has one (views.md:3935, 4172).
  • web/README.md:914-960 (item 10) describes the Overview as one page "then the swarm, then the organisation", with no tab for the swarm, and mentions the contract only as a forge link.
  • Proposal: link each report to ctx.link("tasks", r.task.id), fix the header of swarm.js, and rewrite README item 10 for the three tabs (Summary, Swarm, Project), the contract view in the app, and the organisation on Team.
  • Effort S. Risk none for the docs, low for the link.

Order: tsk-13scv14k4yg4 (Why view merges the children) has a web PR still to come in ktw-host.js. Do #40 after it.