Skip to content

fix(integrations): repair corrupt icons, backfill missing block metas, restore scroll on back-nav#5342

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/integrations-load-and-remove-error-digest
Jul 1, 2026
Merged

fix(integrations): repair corrupt icons, backfill missing block metas, restore scroll on back-nav#5342
waleedlatif1 merged 3 commits into
stagingfrom
fix/integrations-load-and-remove-error-digest

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Corrupt icons: restored 7 brand icons (Google, Outlook, MongoDB, Postgres, OpenRouter, Groq, Cerebras) whose SVG d path data was mangled by a past bulk icon reformat — this was flooding the integrations page with dozens of <path> attribute d console errors. Geometry restored byte-for-byte from the pre-corruption commit.
  • New CI guard check:icon-paths: validates every icon d attribute in components/icons.tsx (operand counts + arc flags) so malformed path data can never silently ship again.
  • Missing block metas: backfilled BlockMeta (tags/url/templates/skills) for postgresql, mysql, ssh, sftp, smtp — these were catalog integrations rendering empty detail pages (no templates/skills). Content web-validated against each service's real operations.
  • New CI guard (meta coverage): every catalog integration (category: 'tools', not hidden) must now have a BlockMeta, enforced in check-block-registry.ts.
  • Scroll restoration: the integrations index/detail scroll an inner overflow-y-auto container, which Next.js doesn't restore on Back. Added a useScrollRestoration hook (sessionStorage, per-pathname) so Back returns to your prior scroll position.
  • Error digest pill: removed the digest badge from the shared workspace ErrorShell (still logged, just not shown in the UI).

Type of Change

  • Bug fix

Testing

Tested manually. All CI guards pass locally (check:icon-paths, check:block-registry meta coverage, check:bare-icons); tsc clean on changed files; biome clean; error-boundary test passes. Icon-path validator confirmed to catch the historical corruption and accept valid packed arc-flag syntax.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…, restore scroll on back-nav

- Restore 7 brand icons (Google, Outlook, MongoDB, Postgres, OpenRouter, Groq, Cerebras) whose SVG path data was corrupted by a past bulk reformat, flooding the integrations page console with <path> parse errors; add a check:icon-paths CI gate that validates every icon d attribute (operand counts + arc flags).
- Backfill BlockMeta (tags/url/templates/skills) for postgresql, mysql, ssh, sftp, smtp — previously catalog integrations with empty detail pages; add an integration meta-coverage CI check so every catalog block must have a meta.
- Add scroll-position restoration for the integrations index/detail inner scroll containers so browser Back returns to where you were.
- Remove the error digest pill from the shared workspace ErrorShell (kept in logs, dropped from UI).
@waleedlatif1 waleedlatif1 requested a review from a team as a code owner July 1, 2026 23:26
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 1, 2026 11:58pm

Request Review

@cursor

cursor Bot commented Jul 1, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Mostly icon fixes, integration metadata, client scroll UX, and new static CI checks—no auth, payments, or data-model changes.

Overview
Fixes broken brand SVG paths and adds check:icon-paths in CI so malformed d attributes cannot ship again. Several icons also switch hard-coded fills to currentColor for theme-safe rendering.

Catalog integrations mysql, postgresql, ssh, sftp, and smtp get full BlockMeta (tags, templates, skills) and registry/catalog updates so detail pages are no longer empty. check-block-registry now fails if a visible tools integration lacks meta.

Integrations list and detail pages use useScrollRestoration on their inner scroll containers (sessionStorage, back/forward only, retries when credentials finish loading).

The workspace ErrorShell no longer shows the error digest pill; digest is still logged.

Reviewed by Cursor Bugbot for commit 757e568. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR addresses three independent regressions on the integrations surface: corrupted SVG path data in seven brand icons, empty integration detail pages for five blocks lacking BlockMeta, and lost scroll position on browser Back navigation. Each fix is accompanied by a new CI guard to prevent the regression from recurring.

  • Icon repairs restore the d attribute byte-by-byte for Google, Outlook, MongoDB, Postgres, OpenRouter, Groq, and Cerebras in both apps/sim/components/icons.tsx and apps/docs/components/icons.tsx, and add a check:icon-paths Bun script + CI step that validates every <path d> attribute against the SVG grammar.
  • Block meta backfill exports BlockMeta objects (tags, url, templates, skills) for postgresql, mysql, ssh, sftp, and smtp, registers them in BLOCK_META_REGISTRY, and extends check-block-registry.ts to enforce meta coverage for all catalog-visible integration blocks going forward.
  • Scroll restoration introduces a useScrollRestoration hook (sessionStorage, per-pathname, Back/Forward-only) that gates restoration on popstate detection via a module-level flag, and waits for async data (ready option) before applying the saved position; both Integrations and IntegrationBlockDetail adopt it.

Confidence Score: 5/5

Safe to merge. All three regressions (corrupted icons, empty detail pages, lost scroll position) are addressed with targeted fixes, each backed by a new CI check that prevents recurrence.

The icon path restorations are verified by the new check:icon-paths validator. The block meta additions follow the established pattern and are enforced by the extended check-block-registry guard. The scroll-restoration hook is well-reasoned, addresses the known race conditions raised in prior review threads, and the ready-flag late-retry path is logically sound. The only gap is that the docs icons file is not covered by the new CI guard, but this does not affect runtime correctness of the main app.

scripts/check-icon-paths.ts — the default target covers only apps/sim/components/icons.tsx; apps/docs/components/icons.tsx is not validated.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/integrations/hooks/use-scroll-restoration.ts New hook implementing scroll restoration via sessionStorage and module-level popstate flag; logic is carefully designed to distinguish programmatic from user scrolls by value comparison and to handle late async-content readiness via the ready option.
apps/sim/components/icons.tsx Restores correct SVG path data for Google, Outlook, MongoDB, Postgres, OpenRouter, Groq, and Cerebras icons; operand counts and arc flags are now valid.
apps/docs/components/icons.tsx Mirrors the sim icon fixes plus updates several hardcoded fill colors to currentColor for theme compatibility; changes are consistent with the sim icons file.
scripts/check-icon-paths.ts New CI script validating SVG path grammar in icons.tsx; correctly handles compact number forms, arc flags, and implicit repeated operands — but defaults only to apps/sim/components/icons.tsx, leaving apps/docs/components/icons.tsx uncovered.
apps/sim/blocks/blocks/postgresql.ts Adds PostgreSQLBlockMeta with 8 templates and 4 skills; uses the as-const-satisfies-BlockMeta pattern consistently with the existing codebase.
apps/sim/blocks/blocks/mysql.ts Adds MySQLBlockMeta with 8 templates and 4 skills; correctly notes MySQL-specific INSERT … ON DUPLICATE KEY UPDATE syntax in the upsert skill rather than Postgres ON CONFLICT syntax.
apps/sim/blocks/blocks/ssh.ts Adds SSHBlockMeta with 7 templates and 4 skills; templates cover the full SSH operation set (execute, file transfer, health-check, log digest).
apps/sim/blocks/blocks/sftp.ts Adds SftpBlockMeta with 8 templates and 4 skills; no url field present (SFTP is a protocol with no single canonical home page, so this appears intentional).
apps/sim/blocks/blocks/smtp.ts Adds SmtpBlockMeta with 7 templates and 4 skills; uses SmtpIcon uniformly for templates and omits url (SMTP is a protocol, not a specific product).
apps/sim/blocks/registry-maps.ts Imports and registers the five new *BlockMeta exports into BLOCK_META_REGISTRY in alphabetical order, consistent with the existing pattern.
apps/sim/scripts/check-block-registry.ts Adds checkIntegrationMetaCoverage that fails CI if any category:'tools', non-hidden block lacks a BlockMeta entry; correctly reuses the getBlockMeta resolver that strips version suffixes.
apps/sim/app/workspace/[workspaceId]/components/error/error.tsx Removes the digest prop and its badge from ErrorShell; the digest is still logged server-side but no longer shown in the UI — clean and consistent change.
apps/sim/app/workspace/[workspaceId]/integrations/integrations.tsx Attaches scrollContainerRef to the inner overflow-y-auto div and wires useScrollRestoration with ready gated on credentials loading; minimal invasive change.
apps/sim/app/workspace/[workspaceId]/integrations/[block]/integration-block-detail.tsx Same scroll restoration wiring as integrations.tsx; exposes credentialsLoading from useWorkspaceCredentials to drive the ready flag.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Browser
    participant ModuleScope as Module (use-scroll-restoration)
    participant LayoutEffect as useLayoutEffect
    participant ScrollEffect as useEffect (scroll)
    participant SessionStorage

    Browser->>ModuleScope: popstate event (Back/Forward)
    ModuleScope->>ModuleScope: "lastNavWasTraversal = true"

    Note over Browser: Page mounts
    LayoutEffect->>ModuleScope: read lastNavWasTraversal (true)
    LayoutEffect->>ModuleScope: "clear lastNavWasTraversal = false"
    LayoutEffect->>SessionStorage: getItem(storageKey)
    SessionStorage-->>LayoutEffect: saved scrollTop
    LayoutEffect->>Browser: "el.scrollTop = savedValue (lastAppliedRef set)"

    ScrollEffect->>Browser: addEventListener('scroll', onScroll)

    Browser->>ScrollEffect: user scroll event
    ScrollEffect->>ScrollEffect: "scrollTop !== lastAppliedRef → user scroll"
    ScrollEffect->>ScrollEffect: latestUserScrollRef updated, RAF enqueued
    ScrollEffect->>SessionStorage: setItem(storageKey, newScrollTop)

    Note over Browser: Page unmounts
    ScrollEffect->>SessionStorage: flush latestUserScrollRef (final persist)
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Browser
    participant ModuleScope as Module (use-scroll-restoration)
    participant LayoutEffect as useLayoutEffect
    participant ScrollEffect as useEffect (scroll)
    participant SessionStorage

    Browser->>ModuleScope: popstate event (Back/Forward)
    ModuleScope->>ModuleScope: "lastNavWasTraversal = true"

    Note over Browser: Page mounts
    LayoutEffect->>ModuleScope: read lastNavWasTraversal (true)
    LayoutEffect->>ModuleScope: "clear lastNavWasTraversal = false"
    LayoutEffect->>SessionStorage: getItem(storageKey)
    SessionStorage-->>LayoutEffect: saved scrollTop
    LayoutEffect->>Browser: "el.scrollTop = savedValue (lastAppliedRef set)"

    ScrollEffect->>Browser: addEventListener('scroll', onScroll)

    Browser->>ScrollEffect: user scroll event
    ScrollEffect->>ScrollEffect: "scrollTop !== lastAppliedRef → user scroll"
    ScrollEffect->>ScrollEffect: latestUserScrollRef updated, RAF enqueued
    ScrollEffect->>SessionStorage: setItem(storageKey, newScrollTop)

    Note over Browser: Page unmounts
    ScrollEffect->>SessionStorage: flush latestUserScrollRef (final persist)
Loading

Reviews (4): Last reviewed commit: "fix(ci): attribute icon-path errors for ..." | Re-trigger Greptile

…detection + Back/Forward-only gate

Addresses review: replace the racy programmatic-scroll flag with value comparison (a restore's echo equals lastApplied and is ignored, so a stuck flag can never drop the first user scroll or overwrite the saved target), and gate restoration on popstate history traversals so fresh push navigations open at the top instead of jumping mid-list. TSDoc-only comments.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

Greptile review: iconNameAt only matched 'export function', so a malformed path inside an 'export const XxxIcon = (...)' arrow-function icon would be misattributed to the preceding function-declared icon. Match both forms (mirrors check-bare-icons indexIconBodies).
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 757e568. Configure here.

@waleedlatif1 waleedlatif1 merged commit 507cee1 into staging Jul 1, 2026
11 of 12 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/integrations-load-and-remove-error-digest branch July 1, 2026 23:58
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 757e568. Configure here.

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.

1 participant