Skip to content

Company Workspace & Roles Tab

Chazona Baum edited this page Jun 24, 2026 · 1 revision

Relevant source files

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.

Workspace Layout & Meta-Grid

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.

Meta-Grid & Edit Mode

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, and careers_url.
  • List Fields: domain and business_model are handled as arrays.
  • Implementation: The page uses Svelte 5 $state for editingDetails and detailDraft. When saving, it differentiates between list fields (using cs.setListField) and scalar fields (using cs.updateField) src/routes/companies/[slug]/+page.svelte:69-90.

Notes Edit Mode

The notes section supports a live toggle between a rendered Markdown view and a plaintext editor src/routes/companies/[slug]/+page.svelte:31-33.

Sources:


The Roles Tab & Triage List

The Roles tab (wtab === "roles") contains the Triage List, which manages the lifecycle of individual job postings found at the company.

Sorting Logic

Roles are sorted using the sortRoles utility src/lib/rolesView.ts#11-30:

  1. Scored roles (where fit_score !== null) appear first, descending by score.
  2. Ties in score are broken by job title ascending.
  3. Unscored roles appear last, sorted by title ascending.

Fit Band Display

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:


Pipeline Integration & Live Progress

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.

Data Flow: Pipeline Events to UI

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
Loading

Sources:

Step Strip Visualization

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

Pipeline Action Buttons

  1. Fetch jobs: Calls fetchJobsForCompany to start a discovery run (scrape careers page) src/lib/pipeline.ts#41-43
  2. Fetch selected: Calls fetchJobDetails for jobs checked in the Triage List src/lib/pipeline.ts#49-54
  3. Re-score: Calls rescoreJob to 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
Loading

Sources:

Clone this wiki locally