Skip to content

Commit e4ae172

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
Merge origin/staging into feat/quickbooks-integration
2 parents bb2bb1c + c759a88 commit e4ae172

499 files changed

Lines changed: 65031 additions & 9313 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/rules/sim-settings-pages.md

Lines changed: 177 additions & 33 deletions
Large diffs are not rendered by default.

.claude/rules/sim-styling.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ paths:
88

99
## Tailwind
1010

11-
1. **No inline styles** - Use Tailwind classes
11+
1. **No inline styles** - Use Tailwind classes. Exception: a genuinely dynamic
12+
value (a hashed avatar colour, a brand tile background) that cannot be a class.
1213
2. **No duplicate dark classes** - Skip `dark:` when value matches light mode
13-
3. **Exact values** - `text-[14px]`, `h-[26px]`
14+
3. **Exact values over approximations** - `h-[26px]`, not `h-6`. But **type size is
15+
always a named token** (`text-sm`, `text-caption`) — never `text-[14px]`, which
16+
sets font-size only and inherits a different line-height. See
17+
`sim-settings-pages.md` for the scale.
1418
4. **Transitions** - `transition-colors` for interactive states
1519

1620
## Conditional Classes

.claude/rules/sim-url-state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ const { sort, dir, activeSort, onSort, onClear } = useUrlSort(thingsSortParams,
179179
Two modes, chosen by whether you pass a default:
180180

181181
- **Defaulted (the common case)** — pass the list's existing default sort; it must match exactly. A clean URL means the default ordering; explicitly selecting the default collapses back to a clean URL (`clearOnDefault`), and "clear sort" writes the defaults back. `useUrlSort` derives `activeSort: null` for the default state.
182-
- **Nullable** — omit the default when "no active sort" is behaviorally distinct from explicitly sorting by the fallback column (e.g. files: with no sort, files order by updated/desc but folders by name/asc). The params carry no defaults, explicit selections always persist in the URL, and "clear sort" strips both params (`useUrlSort` writes `null`s).
182+
- **Nullable** — omit the default when "no active sort" is behaviorally distinct from explicitly sorting by the fallback column (e.g. document chunks: with no sort the query omits `sortBy` entirely and the server's own order applies). The params carry no defaults, explicit selections always persist in the URL, and "clear sort" strips both params (`useUrlSort` writes `null`s).
183183

184184
Sort params live alongside — not inside — the feature's grouped filter parser map (one definition per param; `useUrlSort` owns its own `useQueryStates`, and nuqs keeps hooks on the same keys in sync). Both params carry the shared filter options (`{ history: 'replace', clearOnDefault: true }`). Free-form user-defined columns (e.g. `tables/[tableId]`) can't use `parseAsStringLiteral` and stay hand-rolled with `parseAsString` — reuse the shared `SORT_DIRECTIONS` there.
185185

.claude/skills/add-settings-page/SKILL.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ skill is the procedure.
1212

1313
Key paths:
1414
- Layout primitive: `apps/sim/app/workspace/[workspaceId]/settings/components/settings-panel/settings-panel.tsx`
15-
- Nav metadata (titles + descriptions): `apps/sim/app/workspace/[workspaceId]/settings/navigation.ts`
15+
- Nav metadata (titles + descriptions): `apps/sim/components/settings/navigation.ts`
1616
- Section switch + provider: `apps/sim/app/workspace/[workspaceId]/settings/[section]/settings.tsx`
1717
- Pages: `apps/sim/app/workspace/[workspaceId]/settings/components/<name>/<name>.tsx` and EE pages under `apps/sim/ee/<feature>/components/`
1818

@@ -53,7 +53,9 @@ For each page component, confirm the checklist in `.claude/rules/sim-settings-pa
5353
3. Find literal pixel text sizes (should be 0 — see "Text-scale tokens" in
5454
`.claude/rules/sim-settings-pages.md` for the token map and the row
5555
title/subtitle pairing convention):
56-
`git grep -n "text-\[1[0-8]px\]" -- 'apps/sim/**/settings/' 'apps/sim/ee/'`
56+
`git grep -nE "text-\[1[0-8]px\]" -- 'apps/sim/**/settings/' 'apps/sim/ee/'` — should
57+
be 0. Display type above the scale (`text-[40px]` hero headings, the `text-[8px]`
58+
member-avatar initial) is deliberate and out of scope.
5759
4. Confirm each page imports `SettingsPanel` and that its `NavigationItem` has an
5860
accurate `description` of consistent length with its peers.
5961
- Editable pages: confirm Save/Discard go through `SaveDiscardActions` and
@@ -77,3 +79,31 @@ For each page component, confirm the checklist in `.claude/rules/sim-settings-pa
7779
8. **Verify the whole sweep:** `tsc --noEmit`, `biome check` on every touched
7880
file, and run the affected pages' tests. Diff each file against the base and
7981
confirm the change is purely structural before shipping.
82+
83+
## Mode C — Migrate list rows to `SettingsResourceRow`
84+
85+
Read "The resource row" in `.claude/rules/sim-settings-pages.md` first — it is the
86+
contract. Then, per page:
87+
88+
1. Find hand-rolled rows:
89+
`git grep -n "truncate text-\[var(--text-body)\] text-sm" -- 'apps/sim/app/workspace/' 'apps/sim/ee/'`
90+
Every match outside `settings-resource-row.tsx` is either a row to migrate or a
91+
genuinely different shape (multi-line body, tabular columns, a grid) that stays
92+
bespoke — decide which, and say so.
93+
2. Replace the row *and* its wrapper: a `<button>`/`<Link>` around the row becomes
94+
`onClick`/`href` on the row itself. Wrapping the row is what the primitive
95+
exists to stop — it is also invalid HTML once `trailing` holds a control.
96+
3. Sort the trailing content: interactive → `trailing`, decorative → `badge`.
97+
Getting this backwards makes the row's right edge a dead zone.
98+
4. Add `navigable` only if the row opens a detail page, and `clickLabel` always.
99+
5. Drop the container's `-mx-2` — the row now owns the bleed. Use
100+
`RESOURCE_LIST_STACK` / `RESOURCE_LIST_GRID`; do not hand-write the gap.
101+
6. Unlike Mode B, this migration **may** change conditional rendering: a
102+
`<button disabled={!can}>` becomes `onClick={can ? … : undefined}` +
103+
`navigable={can}`, which renders a plain non-interactive row. Verify the gated
104+
state has no clickable affordance left.
105+
7. Check what the old row rendered *beside* the title (a badge, a timestamp, a
106+
transport label). The row's title truncates as one unit, so anything folded
107+
into it can be ellipsised away — move it to `description` or `badge`.
108+
8. Verify: `tsc --noEmit`, `biome check`, the page's tests, and a diff read of
109+
every converted block for lost props, conditions, and `key` placement.

.github/codeql/codeql-config.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Sim CodeQL config
2+
3+
# Trims the extraction surface. CodeQL parses every matching file into a
4+
# database before a single query runs, and that phase dominates runtime on a
5+
# ~12.7k-file JS/TS tree. Test and fixture code is not attacker-reachable, so
6+
# excluding it costs no real coverage.
7+
#
8+
# paths-ignore applies to analysis. The workflow's `on.pull_request.paths`
9+
# filter is separate and decides whether the run happens at all.
10+
paths-ignore:
11+
- '**/*.test.ts'
12+
- '**/*.test.tsx'
13+
- '**/*.test.js'
14+
- '**/*.spec.ts'
15+
- '**/*.spec.tsx'
16+
- '**/__tests__/**'
17+
- '**/__mocks__/**'
18+
- '**/__fixtures__/**'
19+
- '**/e2e/**'
20+
# Deliberately no '**/test/**' or '**/tests/**'. A directory named `test` is a
21+
# routable Next.js path segment, not necessarily test code: those globs
22+
# excluded the real endpoint
23+
# apps/sim/app/api/organizations/[id]/data-drains/[drainId]/test/route.ts,
24+
# which authorizes, decrypts destination credentials, and makes an outbound
25+
# request. CodeQL's paths-ignore has no `!` negation to carve it back out
26+
# ("The filter pattern characters ?, +, [, ], and ! are not supported and will
27+
# be matched literally"), and the globs only covered 76 of 12,716 files, so
28+
# the naming convention above is the safer filter.
29+
- '**/*.d.ts'
30+
- '**/node_modules/**'
31+
- '**/dist/**'
32+
- '**/.next/**'
33+
- 'apps/docs/content/**'

.github/workflows/codeql.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: CodeQL
2+
3+
# Advanced setup, replacing the repo-settings "default setup".
4+
#
5+
# Default setup pinned every scan to a 4-vCPU GitHub-hosted runner with no
6+
# cancel-in-progress, which put PR scans at 30-125 min and re-ran them on every
7+
# push (PR #6183 burned six overlapping runs). None of that is configurable from
8+
# the settings UI, so the config moves into the repo.
9+
#
10+
# Before enabling this, disable default setup or the two will both run:
11+
# gh api -X PATCH repos/:owner/:repo/code-scanning/default-setup -f state=not-configured
12+
#
13+
# The runs-on expression is the same CI_PROVIDER escape hatch as ci.yml and must
14+
# change together with it.
15+
16+
on:
17+
# Pushes to main are infrequent (merges only), so a full scan per push is
18+
# affordable and is what GitHub recommends pairing with the PR trigger:
19+
# "Scanning code when someone pushes a change, and whenever a pull request is
20+
# created, prevents developers from introducing new vulnerabilities."
21+
push:
22+
branches: [main]
23+
pull_request:
24+
branches: [main, staging]
25+
# `ready_for_review` is not a default activity type, so it has to be listed
26+
# alongside the defaults it replaces. Without it, a PR opened as a draft and
27+
# then marked ready is skipped by the job-level draft guard and never
28+
# rescanned until the next push.
29+
types: [opened, synchronize, reopened, ready_for_review]
30+
paths:
31+
- '**/*.ts'
32+
- '**/*.tsx'
33+
- '**/*.js'
34+
- '**/*.jsx'
35+
- '**/*.mjs'
36+
- '**/*.cjs'
37+
- '.github/workflows/**'
38+
- '.github/actions/**'
39+
- '.github/codeql/**'
40+
schedule:
41+
# Safety net behind the push trigger, and the thing that keeps the
42+
# default-branch alert view fresh when main is quiet. Only fires once this
43+
# file is on the default branch — schedule events ignore other branches.
44+
- cron: '17 8 * * *'
45+
workflow_dispatch:
46+
47+
# Scheduled main scans must run to completion — only PR pushes supersede.
48+
concurrency:
49+
group: codeql-${{ github.ref }}
50+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
51+
52+
permissions:
53+
contents: read
54+
55+
jobs:
56+
analyze:
57+
name: Analyze ${{ matrix.language }}
58+
runs-on: ${{ (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') && 'blacksmith-8vcpu-ubuntu-2404' || 'ubuntu-latest' }}
59+
timeout-minutes: 60
60+
if: github.event.pull_request.draft != true
61+
permissions:
62+
security-events: write
63+
contents: read
64+
actions: read
65+
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
# One entry covers both JS and TS — `javascript`, `typescript` and
70+
# `javascript-typescript` all resolve to the same extractor
71+
# (github/codeql-action src/languages/builtin.json), so the three
72+
# entries default setup listed were one analysis, not three.
73+
# `javascript-typescript` is the documented spelling. Python dropped:
74+
# 7 files in the tree.
75+
language: [javascript-typescript, actions]
76+
77+
steps:
78+
- name: Checkout repository
79+
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
80+
with:
81+
persist-credentials: false
82+
83+
- name: Initialize CodeQL
84+
uses: github/codeql-action/init@18420e3271f74589575af831a523c833acda327f # codeql-bundle-v2.26.2
85+
with:
86+
languages: ${{ matrix.language }}
87+
config-file: ./.github/codeql/codeql-config.yml
88+
89+
- name: Perform CodeQL Analysis
90+
uses: github/codeql-action/analyze@18420e3271f74589575af831a523c833acda327f # codeql-bundle-v2.26.2
91+
env:
92+
NODE_OPTIONS: --max-old-space-size=8192
93+
with:
94+
category: /language:${{ matrix.language }}

0 commit comments

Comments
 (0)