Skip to content

feat(fe): an If can follow a list through its count (#264) - #268

Merged
Lexirieru merged 2 commits into
mainfrom
feat/fe-if-count
Nov 12, 2026
Merged

Lexirieru merged 2 commits into
mainfrom
feat/fe-if-count

Conversation

@AncungAulia

Copy link
Copy Markdown
Contributor

@Lexirieru The FE part of #264, on top of the engine's #265.

What changed

  • An If can follow a list. Every list tool in the Builder also offers its count in an If's "Look at":
    • "Number of events" (Read the calendar)
    • "Number of emails" (Read the inbox)
    • "Number of rows" (Read a Google Sheet, Read a Notion database)
    • "Number of free slots" (Find free time)
    • "Number of meetings" (List Zoom meetings)
    • "Number of pages found" (Search Notion)
  • It's saved as { left: "{{steps.<node>.count}}", op: "gt", right: 0 }, as you asked on feat(engine): count on list tools so a Builder If can test "Number of events > 0" (#264) #265, never .length.
  • So this job can be built now: Read the calendar → If number of events is more than 0 → Ask (a note about {Calendar events}) → Email me; otherwise it stops. The card reads "If number of events is more than 0".
  • An If on an Ask step's answer is not offered, as you asked: the engine compares exact text only.
  • The locked-If message says why instead of "Add a check or a website first", which read like a bug: "Add a step that gives a number or text first", or "The path already ends above". Shown in the Blocks panel, the phone's "Add a block" drawer and an If way's picker (ifLockedWhy). Its "gives a list" case was dropped, since a list now always has a count.
  • apps/fe/CLAUDE.md updated.

Tests (local, on main 8b9f947)

  • bun run lint, bun run typecheck, bun run build: pass.
  • bun run test: 273/273. New: an If after Read the calendar is allowed, "Number of events" is the only comparable field, the canvas carries {{steps.c.count}} and no .length, and it opens again.
  • Not run: integration and load tests (the FE has none).
  • Not checked in a browser, and not against a real calendar. The engine side was checked end to end on feat(engine): count on list tools so a Builder If can test "Number of events > 0" (#264) #265.

Closes #264 once it's in, unless you want to keep it open for the Ask-answer If.

🤖 Generated with Claude Code

AncungAulia and others added 2 commits November 12, 2026 10:29
Ancung, 11 Nov: after "Read the calendar", If was greyed out with "Add a check or a website
first", which read like a bug since a step was right there. The real reason: an If compares a
number or a text, and the calendar (like the inbox, free time, Notion rows, Sheets values and Zoom
meetings) gives a list. The palette, the phone's "Add a block" and a way's picker now say which:
"Read the calendar gives a list, which an If can't compare yet", or, with nothing before it, "Add a
step that gives a number or text first". Making it possible (a count on list tools, and an If on an
Ask step's answer) needs the engine and is proposed on #264.

Tests: typecheck, lint, vitest 272/272 (new: the list case, the empty case, the path-ends case).
Not checked in a browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The engine now returns a count beside every list (#265), so the
Builder offers "Number of events", "Number of emails", rows, free
slots, meetings and pages found in an If's "Look at", saved as
{{steps.id.count}}. "Read the calendar, then If number of events is
more than 0, then Ask, then Email me" can be built now. An If on an
Ask step's answer is left out: the engine compares exact text only.

The locked-If message drops its "gives a list" case, which can't
happen any more.

Tests: lint, typecheck, vitest 273/273 (new: count offered and saved
as steps.c.count, never .length).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Lexirieru
Lexirieru merged commit 5aae59e into main Nov 12, 2026
1 check passed
@Lexirieru

Copy link
Copy Markdown
Contributor

Merged with Axel's approval; main deploys after its CI. Tested locally: lint, typecheck, bun run test 273/273.

@AncungAulia two small things for a later PR, nothing blocking:

  • apps/fe/next-env.d.ts was committed with the dev paths (.next/dev/types/…). It's generated, and the build rewrites it, so please just leave it out of future commits.
  • "Number of rows" for Sheets counts the header row too (the engine's count is the length of values). Maybe label it "Number of rows (with the header)", or leave it.

Could you also try it once on the hosted demo: Read the calendar → If number of events > 0? @Lin1er no backend change.

@Lin1er

Lin1er commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Live on the hosted demo: main dda8314, which includes this PR (merge 5aae59e) together with #269. The automatic deploy posted on #269 only.

  • GET /v1/health → {"ok":true,"engine":true,"revision":"dda8314"}. No rollback.
  • hellonear-be, hellonear-engine, hellonear-fe, hellonear-landing active; 0 http error lines since the deploy.
  • Try-out end to end: 22/22. https://app.hellonear.xyz answers 200.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Builder: an If after a list (calendar, inbox…) and after an Ask step's reply

3 participants