-
Notifications
You must be signed in to change notification settings - Fork 0
Company Workspace & Roles Tab
Relevant source files
- src/lib/fit.test.ts
- src/lib/fit.ts
- src/lib/pipeline.ts
- src/lib/rolesView.test.ts
- src/lib/rolesView.ts
- src/lib/styles/layout/roles.css
- src/lib/styles/layout/workspace.css
- src/routes/companies/[slug]/+page.svelte
The Company Detail page (src/routes/companies/[slug]/+page.svelte) serves as the primary workspace for managing a specific company entity. It provides a split-view interface comprising an Overview (meta-grid and notes) and a Roles tab (the Triage List). This page is the orchestration point for the Job-Fetch Pipeline at the company level.
The workspace is structured using a standard header and a tabbed body. The header contains the company name, screening chips, and global actions like "Fetch jobs" src/routes/companies/[slug]/+page.svelte:36-68.
The "Overview" tab displays company metadata in a .meta-grid (a two-column CSS grid) src/lib/styles/layout/workspace.css#135-144
- Scalar Fields: Includes
company_size,stage,remote_policy,location,website, andcareers_url. - List Fields:
domainandbusiness_modelare handled as arrays. - Implementation: The page uses Svelte 5
$stateforeditingDetailsanddetailDraft. When saving, it differentiates between list fields (usingcs.setListField) and scalar fields (usingcs.updateField) src/routes/companies/[slug]/+page.svelte:69-90.
The notes section supports a live toggle between a rendered Markdown view and a plaintext editor src/routes/companies/[slug]/+page.svelte:31-33.
- Rendering: Uses
renderNotesfrom$lib/markdownsrc/routes/companies/[slug]/+page.svelte:8. - Persistence: Updates are pushed via
cs.setNotes(slug, notesDraft)src/routes/companies/[slug]/+page.svelte:33.
Sources:
The Roles tab (wtab === "roles") contains the Triage List, which manages the lifecycle of individual job postings found at the company.
Roles are sorted using the sortRoles utility src/lib/rolesView.ts#11-30:
- Scored roles (where
fit_score !== null) appear first, descending by score. - Ties in score are broken by job title ascending.
- Unscored roles appear last, sorted by title ascending.
The .roles__fit column visualizes the fit_score using a color-coded band src/lib/styles/layout/roles.css#46-72 The fitBand function maps scores to keys: strong (>=80), good (>=60), partial (>=40), weak (>=20), and mismatch (<20) src/lib/fit.ts#7-14
Sources:
The Roles tab integrates directly with the Job-Fetch Pipeline. Users can trigger discovery for the whole company or detail/scoring runs for selected jobs.
The UI maintains a runBySlug Map of RunState objects to track live progress src/routes/companies/[slug]/+page.svelte:157.
Title: Pipeline State Synchronization
sequenceDiagram
participant UI as "+page.svelte (Frontend)"
participant IPC as "Tauri IPC Bridge"
participant RS as "pipeline/steps.rs (Rust)"
UI->>IPC: fetchJobDetails(slugs)
IPC->>RS: start_job_detail_runs(slugs)
RS-->>UI: FetchJobDetailsOutcome (started/skipped/failed)
Note over UI: UI populates runBySlug Map
RS->>IPC: emit("run:step" | RunStepEvent)
IPC->>UI: onRunStep callback
UI->>UI: update runBySlug (activePhase | stageStatus)
RS->>IPC: emit("run:finished" | RunStepEvent)
IPC->>UI: onRunFinished callback
UI->>UI: remove from runBySlug
Sources:
The "Step Strip" is a sequence of CSS rectangles (.roles__steps i) representing the pipeline stages src/lib/styles/layout/roles.css#148-167
| Run Phase | Stages (DETAIL_STAGES & SCORING_STAGES) |
|---|---|
| Detail |
jd-scrape, structure-jd, gap-detect, research-gaps
|
| Scoring |
fit-score, alignment
|
- Done:
background: var(--primary); opacity: 0.7 - Now:
background: var(--primary)(with pulsing dot) - Failed:
background: var(--danger) - Skipped:
opacity: 0.4(e.g., ifgap-detectfinds no gaps) src/lib/pipeline.ts#9-17src/lib/styles/layout/roles.css#163-166
- Fetch jobs: Calls
fetchJobsForCompanyto start a discovery run (scrape careers page) src/lib/pipeline.ts#41-43 - Fetch selected: Calls
fetchJobDetailsfor jobs checked in the Triage List src/lib/pipeline.ts#49-54 - Re-score: Calls
rescoreJobto bypass scraping and update the fit score based on current profile criteria src/lib/pipeline.ts#72-74
Title: UI Entity to Code Mapping
flowchart LR
subgraph subGraph1 ["Code Entities"]
A1["src/routes/companies/#91;slug#93;/+page.svelte"]
B1["sortedJobs (derived from sortRoles)"]
C1["DETAIL_STAGES / SCORING_STAGES (src/lib/pipeline.ts)"]
D1[".roles__livedot (src/lib/styles/layout/roles.css)"]
E1["runBySlug Map"]
end
subgraph subGraph0 ["UI Surface (Natural Language)"]
A["Company Workspace"]
B["Triage List"]
C["Step Strip"]
D["Pulsing Dot"]
end
A --> A1
B --> B1
C --> C1
D --> D1
B --> E1
E1 --> C1
Sources: