diff --git a/docs/mobile-plan.md b/docs/mobile-plan.md index 7a5c418..5e0a712 100644 --- a/docs/mobile-plan.md +++ b/docs/mobile-plan.md @@ -23,7 +23,7 @@ Two tabs and a cog. `TABS` in `app/web/pages.py` becomes Roles and Applications. | Path | Label | Was | |---|---|---| -| `/settings/profiles` | Profiles | Agents | +| `/settings/ranking` | Ranking | Agents | | `/settings/searches` | Searches | Sources, the searches half | | `/settings/companies` | Companies | Companies, plus the company boards and the prune from Sources | | `/settings/pulls` | Pulls | Jobs and Schedules | @@ -32,7 +32,13 @@ Two tabs and a cog. `TABS` in `app/web/pages.py` becomes Roles and Applications. Setup first, system after. The old paths (`/agents`, `/companies`, `/sources`, `/jobs`, `/schedules`, `/messages`, `/account`) redirect with 301, so `?agent=` links and bookmarks keep working. -"Profiles" is a label in the UI only. Code, API, CLI and config keep `agent`. A search agent reads as something that goes and searches a board, which is what a saved search does; a profile is what every pulled role is scored against. +## Ranking + +The agents were three named intents, each a ranking of its own, and the owner read "search agent" as something that searches a board, which is what a saved search does. The UI collapses them to one ranking. Code, API, CLI and config keep `agent` and the `agents` table keeps its rows; nothing is migrated. + +`/settings/ranking` edits the first enabled agent, creating one when the table is empty: a paragraph "What you are looking for" (the intent), the three weights, and the gates in a `
` "Advanced" holding the JSON editor as today. No New, no list, no Delete. Saving rescores, as now. The starter list in `config.yaml` is cut to one agent, Copenhagen engineering; the other two move to `config.example.yaml` as examples. + +On Roles the order select reads Newest and Best match. When the table holds more than one enabled agent, from the CLI or the config, the select lists them by name instead of Best match, so nothing the CLI can do is lost. The score badge is labelled match. ## Frame and CSS @@ -51,23 +57,23 @@ Into `app/static/app.css`, from health unless noted: ## Roles -The row follows news's feed row (`index.html` 999-1022, `app.css` 566-638 and 1839-1846): a grid with a bottom rule, no card. Line one is the title, a link to the read page. Line two is company · place · age. Line three is the badges (remote, function, score for the chosen profile). Then a one-line excerpt: the summary when there is one, else the first 160 characters of `description`. The actions sit on the right: ▲ ● ▼ ★, news's `voteButtons` and `starButton` (`index.html` 1067-1090) with the filled pressed states (`app.css` 1906-1941). At 640px the actions drop under the text, right-aligned. +The row follows news's feed row (`index.html` 999-1022, `app.css` 566-638 and 1839-1846): a grid with a bottom rule, no card. Line one is the title, a link to the read page. Line two is company · place · age. Line three is the badges (remote, function, match). Then a one-line excerpt: the summary when there is one, else the first 160 characters of `description`. The actions sit on the right: ▲ ● ▼ ★, news's `voteButtons` and `starButton` (`index.html` 1067-1090) with the filled pressed states (`app.css` 1906-1941). At 640px the actions drop under the text, right-aligned. The company affinity control leaves the row: a row judges the role, and the company is judged on the Companies page and the read page. -The filter bar at phone width is one row: the order select, the search box, and a Filters button that opens a `
` holding company, place, function, remote, new-in, show muted, show gated and show passed. +The filter bar at phone width is one row: the order select, the search box, and a Filters button that opens a `
` holding company, place, function, remote, new-in, a judged select (Any, Liked, Unjudged, Passed), show hidden companies, and show gated. Paging. `GET /api/roles` takes `offset` and returns `{"items": [...], "total": n}`. The page loads 60 and appends on an `IntersectionObserver` sentinel with `rootMargin: 600px` (news 558-610). The count line reads "60 of 1,204 roles". Offset paging is enough for one person; a cursor is the upgrade if a pull lands mid-scroll often enough to notice. -Votes. `roles.vote INTEGER` (NULL unjudged, else -1, 0, 1) and `roles.voted_at`. `POST /api/roles/{uid}/vote {"value": -1|0|1}` sets it, `DELETE /api/roles/{uid}/vote` clears it, and pressing the stance a role already has clears it (news `vote()` 2346-2363, optimistic). A role voted -1 is left out of the list unless "show passed" is on, in SQL beside `hide_muted` so it is excluded before `LIMIT`. Votes do not enter the score yet; a `fit` nudge from votes is a later step once there are enough of them. +Votes. `roles.vote INTEGER` (NULL unjudged, else -1, 0, 1) and `roles.voted_at`. `POST /api/roles/{uid}/vote {"value": -1|0|1}` sets it, `DELETE /api/roles/{uid}/vote` clears it, and pressing the stance a role already has clears it (news `vote()` 2346-2363, optimistic). A vote never hides a role: a stray tap must be visible and undoable. A vote moves the rank instead, at read time in `Store.roles`: under Best match the order is `s.score * CASE roles.vote WHEN -1 THEN 0.5 WHEN 1 THEN 1.2 ELSE 1 END`, capped at 1, and the served `score` is that adjusted value, so no rescore is needed and the list reflects a vote at once. Under Newest a passed role is dimmed like a hidden company's. The judged filter (`judged=liked|unjudged|passed`) is a `WHERE` on `vote`. Votes as training for `fit` is a later step once there are enough of them. ★ is Save: `POST /api/applications` as now. Pressing it on a saved role calls `DELETE /api/applications/{id}`, which removes the application while its status is still `saved` and answers 409 once it has moved on. ## The read page -`GET /roles/{uid}` renders `role.html`; `role.js` fetches `GET /api/roles/{uid}`. The layout is news's reader (`index.html` 1400-1601, `app.css` 329-428): a bar with ▲ ● ▼ ★ and ↗ to `original_url`, then title, company, place, badges, salary when stated, the summary when there is one, the text, and the link out once more at the end. At phone width the page is edge to edge (news 1794-1807). Back is `history.back()` when the list opened it, `/` otherwise. +`GET /roles/{uid}` renders `role.html`; `role.js` fetches `GET /api/roles/{uid}`. The layout is news's reader (`index.html` 1400-1601, `app.css` 329-428): a bar with ▲ ● ▼ ★ and ↗ to `original_url`, then title, company with its ★ ▲ ⊘ control beside it (the one place a company is judged outside the Companies page), place, badges, salary when stated, the summary when there is one, the text, and the link out once more at the end. At phone width the page is edge to edge (news 1794-1807). Back is `history.back()` when the list opened it, `/` otherwise. The text is `description` for a board role: 29,194 of 29,196 open board roles have one, 6,300 characters on average. A search role has a 240-character teaser and its `original_url` is Jobindex's own page. For those, `POST /api/roles/{uid}/text` runs `desk.tools.scrape.scrape(original_url)` once and stores the plain text in `roles.article_text`; the page offers "Fetch the posting" when `description` is under 500 characters and `article_text` is empty. On demand rather than in the pull, because `decisions.md` records that following Jobindex's redirect per role counts as a click in its statistics; one click for a posting somebody opened is fair. -Summary. `app/jobs/summarise.py` is a `ModelTask` beside `extract`, writing `roles.summary` and `roles.summarised_at`, with a prompt after `news\newsdesk\jobs\summarise.py` 63-135: about 60 words, what the role is, the stack, where, what it pays if stated, nothing the posting does not say. Off by default like extract (`summarise.enabled: false`). As a stage of the pull cascade after `score`, it takes only roles in the top `summarise.per_agent` (default 30) of an enabled profile's scores that have no summary, so the cost is bounded whatever the backlog. The read page has a Summarise button that enqueues one for that role. +Summary. `app/jobs/summarise.py` is a `ModelTask` beside `extract`, writing `roles.summary` and `roles.summarised_at`, with a prompt after `news\newsdesk\jobs\summarise.py` 63-135: about 60 words, what the role is, the stack, where, what it pays if stated, nothing the posting does not say. Off by default like extract (`summarise.enabled: false`). As a stage of the pull cascade after `score`, it takes only roles in the top `summarise.per_agent` (default 30) of an enabled agent's scores that have no summary, so the cost is bounded whatever the backlog. The read page has a Summarise button that enqueues one for that role. ## Applications @@ -75,15 +81,15 @@ Rows are title (link to the read page), company, status select, saved-when. The ## Companies -One sub-tab with one row per company: name (link to Roles filtered by it), a board host badge or "from searches", open roles, an on/off switch when it has a board, and three icon toggles: ★ favourite (2), ▲ like (1), ⊘ mute (-1). Pressing the pressed one returns to neutral (0); neutral is no button. A filter box and an affinity or on/off select sit above the list, and "Follow a company" sits on top of the page, above the list, since the list is 186 rows long. +One sub-tab with one row per company: name (link to Roles filtered by it), a board host badge or "from searches", open roles, an on/off switch when it has a board, and three icon toggles: ★ favourite (2), ▲ like (1), ⊘ hide (-1). Pressing the pressed one returns to neutral (0); neutral is no button. "Hidden" is the word everywhere the UI shows affinity -1: the toggle's title, the filter ("Show hidden companies" on Roles, "Hidden" in the select here), the dimmed row. The code keeps `mute` and `hide_muted`. A filter box and an affinity or on/off select sit above the list, and "Follow a company" sits on top of the page, above the list, since the list is 186 rows long. The follow form has a host `