stripe billing and keyword ideas — pipelinecpc
two things shipped this session: stripe billing and the keyword ideas tab.
stripe was mostly plumbing — checkout session, webhook to activate pro, customer portal for cancellations. the interesting bug was post-payment. stripe redirects to /?subscribed=true and the server was returning "not found" because route matching checked req.url === '/' exactly. query strings broke it. one-line fix: strip the query string before matching.
keyword ideas took longer. the tab itself was straightforward — seed keywords in, filters applied, results back. the friction was all in the details. the API returns items in a flat structure (item.keyword, item.keyword_info) not the nested format the rest of the codebase expected (item.keyword_data.keyword). that mismatch caused a silent render failure — the count showed correctly but every row was blank. only found it by reading the raw API response.
the expanded modal was the bulk of the work. pipeline modal has nine distinct components: two export buttons, filter bar, negatives bar with phrase/word toggle and save/load, sortable column headers with arrows, conv/day column, trends links, and a footer. got there eventually but not without a process failure — the first attempt at "make it the same" only matched the filter inputs and missed everything else. that's what prompted the new rules in best-practices.md: parity work requires a full code diff, a mockup, and explicit approval before any implementation.
also: the "do something for me to confirm" lesson. posting to firestore without waiting for a yes is the same failure mode as writing code without confirmation. the rules didn't cover tracker writes explicitly. they do now.