This file provides repository-specific guidance for agents working on /Users/robschoen/Dropbox/CC/TM/TMMvotes.html.
- Primary artifact:
/Users/robschoen/Dropbox/CC/TM/TMMvotes.html - Supporting data: Excel files in
/Users/robschoen/Dropbox/CC/TM/Votes/*.xlsx - Primary cross-session metadata:
/Users/robschoen/Dropbox/CC/TM/Votes/AllVotes_categorized.xlsx - Runtime model: single static HTML page with inline CSS/JS, no build step
- Load one Brookline Town Meeting vote spreadsheet from GitHub raw URLs.
- Parse the first worksheet using
xlsxin the browser. - Provide two views:
View by Vote: members grouped byYES,NO,ABSTAIN,NoVotefor one selected article.View by Member: articles grouped by vote value for one selected member.
The parser assumes a fixed worksheet structure.
- Row indexes are zero-based in JS arrays:
TITLE_ROW_INDEX = 2(Excel row 3)DESCRIPTION_ROW_INDEX = 3(Excel row 4)HEADER_ROW_INDEX = 4(Excel row 5)FIRST_DATA_ROW_INDEX = 5(Excel row 6)- Column indexes:
PRECINCT_COL_INDEX = 0(A)NAME_COL_INDEX = 1(B)- Vote columns start at
FIRST_VOTE_COL_INDEX = 2(C)
If spreadsheet shape changes, update constants first and then revalidate both tabs.
AllVotes_categorized.xlsx now acts as the primary vote metadata source for descriptions.
- Expected first-row headers include:
ID(unique hash),Town Meeting Session,Vote Title,Description,Category- Optional/used when present:
Session Night - There should be one metadata row per vote (currently 449 data rows).
- Key matching in apps is by normalized
(session, vote title);IDis loaded and retained as metadata but is not yet the runtime primary key.
- Vote normalization must continue returning only:
YES,NO,ABSTAIN,NoVote- Vote descriptions should resolve in this order:
AllVotes_categorized.xlsxdescription first, then legacyVoteGuide.xlsxdescription, then source session spreadsheet description.- Member keys must remain stable as:
${name} (Precinct ${precinct})precinctSortValue("AL")must remain sorted after numeric precincts.View by Votepercentages are based only onYES + NO.View by Memberpercentages are based on total article count.- Spreadsheet change must fully reset and reload global state (
votingData,votes,members). - Category values from
AllVotes_categorized.xlsxare loaded for future use but may remain hidden in current UI.
- Prefer additive edits with small, isolated function changes.
- Keep all DOM IDs stable unless updating all call sites.
- Avoid relying on browser-global
event; pass event objects explicitly. - Avoid repeated listener binding when data reloads; ensure listeners are attached once.
- Treat spreadsheet values as untrusted content when rendering to DOM.
- Prefer
textContentand DOM node creation over directinnerHTMLinterpolation.
- Keep each
<option value>URL-encoded (spaces as%20) and rooted atVotes/. - In single-select dropdowns, only one option should use
selected. - Keep displayed vote counts in sync with source spreadsheets.
Run this checklist after any functional change.
- Open
/Users/robschoen/Dropbox/CC/TM/TMMvotes.htmlin a browser. - Confirm initial load completes and renders vote results without console errors.
- Switch across all spreadsheet options and verify data refreshes each time.
- In
View by Vote, verify all four vote columns populate and percentages update. - Toggle
Sort by last name onlyand verify ordering changes. - In
View by Member, switch members and verify all four article columns populate. - Toggle
Sort by precinct, then nameand verify member ordering changes. - Toggle tabs repeatedly and confirm active-tab styling and content visibility remain correct.
- Duplicate event listeners when reloading data.
- XSS risk from spreadsheet values rendered via
innerHTML. - Ambiguous default spreadsheet selection if multiple
<option selected>values exist. - Tab activation logic tied to implicit global
event.
- If you change parsing rules, update this file and in-code comments together.
- Keep comments concise and focused on invariants, not obvious syntax.
- Do not introduce build tooling unless explicitly requested by the user.