Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/GLOSSARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ A city on Permits is **quiet** (v2.7880, `permitQuiet.ts`) when its newest permi
A builder's **share of dollars** and **share of permits** (v2.9263, punch list #465, `builderShare.ts`) are its parts of the dollars declared and of the permits on the Builders list as it was read, drawn as a dark bar and a light bar, so every name's shares add up to the whole list.
A name on Builders is **ours** when we priced a job for it in two years or a person tied it to a customer, and **not ours yet** otherwise: its bars are green or grey, and the chips **Everyone**, **Ours** and **Not ours yet** narrow the list.
Builders reads **All five cities** at once unless a city is picked, one row a name, through `research_builders_v2` (`20261203033600`, `loadBuildersOf`), which adds the dollars a name's permits declare, how many declare some and the cities they are in.
A **company's profile** (v2.9266, punch list #465 step 2, `builderProfile.ts`, `PermitBuilderProfile`) is the page a name on Builders opens in place of the list, on an address of its own (`view=builders&builder=<key>`): the name with its chips and the other spellings it files under, four numbers, **Working on now**, **Who to ask for**, **Who they use** and **Us and them**, over every city the name files in.
On a profile a job is **open now** while no plumbing permit sits on it, whatever we answered, which is the rule behind the list's **Open now**, and its chip says where it stands with us in the tab's own words.
**Market** (v2.7978, punch list #405, `permitMarket.ts`) is the Permits view beside Builders that says what the permits mean for us: every **company we bid** in two years beside the commercial permits its names pulled in twelve months, each row reading *Builds, and we win*, *Builds, we never win*, too early to say or *No permit on record*, and **the clock**, the middle wait between two dates on a city's permits.
A **company we bid** there is a bid's customer or the old builders list's name on it, keyed as permits are, with practice bids (a project name that starts with the word ZZ) and a bid platform's catch-all customer left out, in the last two years.
That is **the one rule for our bids**: in the client `src/lib/research/ourBids.ts` (`bidCounts`, `bidPartyKey`), on the database `research_bid_counts` and `research_bid_party_key`, and since v2.8138, v2.8147 and v2.8181 Builders' **Our bids**, the call list's *We bid N, won N* and *Never bid*, a tied customer's bids and the skim's *warm · cold · seen · new name* word all count by it.
Expand Down
2 changes: 1 addition & 1 deletion docs/PROJECT_DOCUMENTATION.md

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions docs/recent-features/v2.9266.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# v2.9266 — Builders: a page for every company (2026-12-02)

Punch list #465, step 2, the page and its first way in. It stands on v2.9263, the Builders list's client, which stands on v2.9261's migration. Client only. Nothing owed on prod of its own.

## What it does

- **A company's page.** A press on a name on Builders opens `PermitBuilderProfile` in place of the list. The page is on the address: `view=builders&builder=<key>` (`builderProfileHref`, `permitsLinkWithBuilder` and `PermitsLink.builder` in `permitsLink.ts`). So it has a link of its own, the browser's Back leaves it, and another view of the tab drops the key.
- **Every city.** A profile covers every city (call 4). While one is open the list behind it reads every city, and the tab's picker says *All five cities*. A city picked over a profile goes back to that city's list.
- **The top line.** The name, **Ours** or **Not ours yet**, the kind of company where the office set one, our mark where there is one, and *also files as* with the other spellings of the company on its own permits (`filesAs`, three named and the rest counted).
- **Four numbers** (`profileTiles`): the jobs open now, its share of the dollars declared with its rank and its share of the permits with its rank under it, the plumbers its permits name, and our bids in two years. A name whose permits declare nothing leads with its share of the permits and says so.
- **Working on now** (`openJobs`): every permit of the name with no plumbing permit on file, the newest first, with its title, its declared value, its street, its city and the day it was filed. Each has a chip that says where it stands with us (`jobStanding`).
- **Who to ask for.** The call list's own block (`PermitAskFor`), with **Checked**, **Wrong** and **Put back** kept the same way, and under it the people the permits name beside the company (`filers`).
- **Who they use** (`plumbersUsed`, `plumbersUsedWords`): each plumber by the jobs that name it, and one of *One plumber nearly every time*, *Leans to one plumber* or *Shops around* once three jobs name a plumber, by Market's own rule (`tieOf`, `TIE_MIN_JOBS`).
- **Us and them**: our bids in two years with the last one's day, how many came through a tied customer, and our mark with who set it and why.
- **The builder's sheet opens from the page**, on **Mark, kind and ties**. The mark, the kind of company and the ties to a customer are set there as before. Once the sheet keeps something, the page reads again.

## How it reads

- The name's row and its two shares are the Builders list's own (`research_builders_v2`, `builderShares`), so the page and the row cannot disagree.
- The jobs come from a new read in `permitResearchIo.ts`, `loadBuilderStanding`: the tab's own `research_permits_v4`, a city at a time, held to the name's key, and asked only of the cities the name files in. So a job's place is said by the rule every list of the tab uses (`placeOf`). The database works a city's permits out before it keeps the name's, so the walker should time a profile's first draw for a company in a large city.
- The looked-up facts are read by a new hook, `useBuilderAskFor`, which the sheet now uses too. The two pills moved to `BuilderPills.tsx`.

## Where it differs from the drawing

- **What open means.** The drawing's five jobs held one with a plumber. Here a job is open while no plumbing permit sits on it, the rule behind the list's **Open now**, so the tile, the list and the column are one count. A job the office said has a plumber, with no plumbing permit on the feed yet, is still open and its chip reads *Has a plumber*.
- **The chips' words** are the tab's own, as the card asks: *Skim*, *Investigating*, *Pursuing*, *Passed* with the count's reason, *Not pursuing* with its reason, *Has a plumber*.
- **Plumbers are counted on the jobs that name one**, and the tile says how many those are. The drawing said *on their last 7 jobs*.
- **The press *Call about all 5 jobs* is not drawn.** It opens step 3's screen, which is not built, and a press that does nothing is worse than none.
- ***Never called* is not said.** No call is kept against a builder today. Step 3 keeps one.
- ***Also files for 2 other companies* is not said.** That is a count across companies, which is step 4's.
- **A press on a name opens the page, not the sheet.** The sheet is one press further, from the page.

## Left of step 2

The other five ways in: a name wherever it is drawn (a skim card, the ledger, Market), the calling deck, the search, the Overview's second press, and a tied customer's record. Each is a link to `builderProfileHref`.

## Tests

`builderProfile.test.ts` (12), `permitsLink.test.ts` (four new cases), `PermitBuilders.render.test.tsx` (five new cases, and every case that opened the sheet now opens it through the page), `ProspectsResearchTab.render.test.tsx` (one new case).

## To verify on the live site

Read only. Prospects → Permits → Builders. Press a name with several permits. Count its *Working on now* rows against the row's **Open now**. Open the ledger and check two of the jobs' places. Copy the address into a new tab and see the same page. Pick a city in the picker and see that city's list. Time the page's first draw for the largest name.
2 changes: 1 addition & 1 deletion docs/twins/APP_DIRECTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Help guides open at `/help?g=<slug>`, and `/help/<slug>` typed or pasted opens t
- New-builder pipeline / hiring pipeline, as three funnels with their counts and a press for each step → `/prospects` (Overview, guide `find-your-way-around-prospects`)
- Note a candidate's or a new sub's qualifications, a level from 0 to 3 in plumbing, electrical and HVAC, the license and where they drive in from → their thread on `/messages`, the flow's **Qualifications** step (a candidate's flow and a sub's coming-on lane since v2.5812; guide `see-where-a-person-stands-and-what-comes-next`)
- Owners, developers and architects with a job we could build as the GC → `/prospects?kind=gc-leads` (guide `find-jobs-to-build-as-the-gc`)
- The permits five cities issue (San Antonio, Austin, New Braunfels, San Marcos, Seguin), skimmed one at a time best first with Investigate or Pass, then worked under Investigating, Pursuing and Closed, with who pulled it, whether a plumber already has it, a search over every list and city, and Builders, every name on permits with our bids and the customers the name is tied to (Pursue makes a lead: a GC on the Customers deck, an owner or architect on Jobs to GC) → `/prospects?tab=permits` (guide `research-permits-for-work-to-bid`; `?tab=research` still opens it); five builders to call this week with who to ask for at each, whether the companies we bid build, and the clock from application to permit → `/prospects?tab=permits&view=market` (Market, v2.7978, v2.7993, v2.8121; the same guide); the names on permits that look like one of our customers, each answered **Same company** or **Not them** → `/prospects?tab=permits&view=builders&looks=1` (v2.6962; the Dashboard's Needs you line opens it); what the city has on a bid's own address and on the jobs priced for its GC, in the bid's Edit window → `/bids?tab=bid-board` (v2.6866; guide `see-what-the-city-has-on-a-bids-address`); **Permit news** on Followup, the permits on the addresses of your bids not yet won or lost, each a card answered in one press (**We lost it…**, **Still waiting**, **Got it** or **Not our job**), with a red count beside Followup → `/bids?tab=permit-news` (v2.7941; the same guide); the names a city lists that are us, so our own plumbing permit reads **Ours**, the owner's with a dev → `/settings?tab=settings-company#settings-company-our-permit-names` (v2.6959)
- The permits five cities issue (San Antonio, Austin, New Braunfels, San Marcos, Seguin), skimmed one at a time best first with Investigate or Pass, then worked under Investigating, Pursuing and Closed, with who pulled it, whether a plumber already has it, a search over every list and city, and Builders, every name on permits with our bids and the customers the name is tied to (Pursue makes a lead: a GC on the Customers deck, an owner or architect on Jobs to GC) → `/prospects?tab=permits` (guide `research-permits-for-work-to-bid`; `?tab=research` still opens it); five builders to call this week with who to ask for at each, whether the companies we bid build, and the clock from application to permit → `/prospects?tab=permits&view=market` (Market, v2.7978, v2.7993, v2.8121; the same guide); who holds the work, every name on the permits of all five cities with its share of the dollars and of the permits, and a company's own page from a press on its name → `/prospects?tab=permits&view=builders` (Builders; a company's page adds `&builder=` and its key; the same guide); the names on permits that look like one of our customers, each answered **Same company** or **Not them** → `/prospects?tab=permits&view=builders&looks=1` (v2.6962; the Dashboard's Needs you line opens it); what the city has on a bid's own address and on the jobs priced for its GC, in the bid's Edit window → `/bids?tab=bid-board` (v2.6866; guide `see-what-the-city-has-on-a-bids-address`); **Permit news** on Followup, the permits on the addresses of your bids not yet won or lost, each a card answered in one press (**We lost it…**, **Still waiting**, **Got it** or **Not our job**), with a red count beside Followup → `/bids?tab=permit-news` (v2.7941; the same guide); the names a city lists that are us, so our own plumbing permit reads **Ours**, the owner's with a dev → `/settings?tab=settings-company#settings-company-our-permit-names` (v2.6959)
- The state's public roll of licensed plumbers kept for our counties, with when each state file was last read and what the read changed, for the people who hold the Hiring switch, and for one who also opens People → Licenses the **Our own** view, each plumbing license we hold beside the state's row of the same number and rank, with **Use the state's date** (v2.8233), and the **Everyone** view, the kept roll searched by name or number, where a row opens the person's sheet with what changed, our notes and **Leave off** (v2.8390) → `/prospects?tab=roll` (`&roll=everyone`, `&person=<id>`; guides `see-the-state-roll-of-licensed-plumbers`, `look-up-a-licensed-plumber-on-the-state-roll`)
- Trade companies to call for the bench, by what GC mode needs right now (every trade short of quotes, the bench, the scope book's trades), the path onto the bench as a strip (To call → Called → Talked → On the bench → Quoted), the list by trade with For, the project a set of plans is for, and the Board by trade whose Call the top 3 → runs the deck through a column's best three, a drag pinning a card and Call first · Normal · Later on every sub (v2.5809), and the sub that says yes asked on the project's job as it lands on the bench (v2.5810) → `/prospects?kind=subs` (the list `/prospects?kind=subs&tab=prospect-list`, the board `/prospects?kind=subs&tab=board`; guide `find-subs-for-the-bench`)
- Small quotes to homeowners (not bids) → `/estimates`
Expand Down
18 changes: 18 additions & 0 deletions src/components/prospects/BuilderPills.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { CSSProperties } from 'react'
import { BUILDER_OURS_WORDS } from '../../lib/research/builderShare'
import { BUILDER_SHOWING_WORDS } from '../../lib/research/permitBuilders'
import type { BuilderMarkValue } from '../../lib/research/permitResearch'

/** The small pills a builder wears on the Builders list and on its profile: our mark, and ours or not ours yet. */
const pill: CSSProperties = { display: 'inline-block', borderRadius: 999, padding: '1px 8px', fontSize: '0.72rem', fontWeight: 600, whiteSpace: 'nowrap' }

export function MarkPill({ mark }: { mark: BuilderMarkValue | null }) {
if (mark === 'good') return <span style={{ ...pill, background: 'var(--bg-green-tint)', color: 'var(--text-green-700)' }}>Good</span>
if (mark === 'avoid') return <span style={{ ...pill, background: 'var(--bg-red-tint)', color: 'var(--text-red-700)' }}>Avoid</span>
return <span style={{ ...pill, background: 'var(--bg-200)', color: 'var(--text-700)' }}>{BUILDER_SHOWING_WORDS.unmarked}</span>
}

/** Ours, or not ours yet. */
export function OursPill({ ours }: { ours: boolean }) {
return ours ? <span style={{ ...pill, background: 'var(--bg-green-tint)', color: 'var(--text-green-700)' }}>{BUILDER_OURS_WORDS.ours}</span> : <span style={{ ...pill, background: 'var(--bg-200)', color: 'var(--text-700)' }}>{BUILDER_OURS_WORDS.not_ours}</span>
}
Loading
Loading