oliver-zehentleitner / maity

web: person and visitor pages share one networks table and avatar/size helper; visitor.js uses its own headcount, one tab bar, one agent test

Sign in to report

tsk-4p5151s9p1e5 Open

Audit round 3 (tsk-hgnbapyw7hnh), read at 588f911b. Kind: duplication / design.

Between person.js and visitor.js

  • Identical NETWORKS tables: web/js/person.js:23-26 and web/js/visitor.js:326-329; REL_ME differs (person.js:27 has noopener, visitor.js:330 not).
  • Picture with an error fallback: person.js:47-57 and visitor.js:146-158; the ?s= size suffix at person.js:83 and visitor.js:149.
  • Two link rules: person.js shows the links the hub builds (social[net] is a URL); visitor.js SOCIAL (:314-325) builds URLs in the browser from names, a copy of hub/src/maity_hub/person_links.py.

Inside visitor.js

  • teamSection repeats headcount() inline (:202-206 vs :248-252).
  • tabBar repeats the old nav's aria-current logic (:298-303 vs :683-688).
  • "Is this member an agent" two ways: membership in d.agents (agentPages(d), :160) vs a regex on the hub's URL layout (isAgentPage, :246).
  • FORGE_HOSTS / githubMark (:107-123, :265-266) name the button "GitHub"/"GitLab" by host with its own copy of the GitHub mark (also web/js/app.js:304), while app.js keys the forge on project.forge and says "Repository" (views.md decision 10a77061).

Proposal: one shared helper module (NETWORKS, REL_ME, avatar(url, px, fallback), sized(url, px)); later let the hub send built links in the public data and drop SOCIAL. In visitor.js: use headcount(), one viewTabs(answer, base, cls), one agent test, one forge table shared with app.js; the hero button text is a visible change, so ask the lead.

Effort / risk: S for the helpers, M for the hub field. Low risk.