Skip to content

chore: sync with version 16 hotfix - #100

Open
trufurs wants to merge 32 commits into
version-16from
version-16-hotfix
Open

chore: sync with version 16 hotfix#100
trufurs wants to merge 32 commits into
version-16from
version-16-hotfix

Conversation

@trufurs

@trufurs trufurs commented Sep 8, 2026

Copy link
Copy Markdown
Member

No description provided.

trufurs and others added 30 commits July 28, 2026 15:01
1b457e0 bumped frappe-ui to 1.0.0-beta.24 in package.json but left yarn.lock
resolving ^0.1.270 -> 0.1.278, so `yarn install --frozen-lockfile` failed and a
fresh install produced a different tree than the one being tested — the components
in that commit were adapted for frappe-ui 1.x, not 0.1.x.

Re-resolving the lock also picks up the patched versions of the vulnerable
transitive dependencies Dependabot flagged:

  brace-expansion  1.1.15 -> 1.1.18, 5.0.6 -> 5.0.9  (DoS: exponential expansion,
                                                      unbounded expansion OOM)
  js-yaml          4.2.0  -> 4.3.1   (quadratic CPU via merge-key chains)
  postcss          8.5.15 -> 8.5.25  (path traversal via sourceMappingURL)
  dompurify        3.4.11 -> 3.4.13  (CUSTOM_ELEMENT_HANDLING bypass)
  echarts          5.6.0  -> 6.1.0   (XSS; only 6.x is patched while frappe-ui
                                      still declares ^5.6.0 — hence a resolution)

echarts is not part of the built bundle (its size is byte-identical before and
after), so pinning a major carries no runtime risk here.
crm 1.81 rebuilt its sidebar on frappe-ui's Sidebar/SidebarItem components: a row
is now `div[data-slot="sidebar-item"]` (h-7) wrapping a link whose icon sits in a
`span.grid`, and collapsing sets an inline width instead of toggling `w-12`. Our
injection hardcoded the crm <= 1.74 shape (`button > div.px-2.py-[7px]`), so on
1.81 the anchor lookup — which required a `<button>` — matched nothing and no
custom items were injected at all.

Rather than re-copy their markup every release, rows are now built by cloning a
real row out of the CRM's own sidebar and swapping icon + label
(utils/sidebarRow.js). Height, padding, hover, focus ring, dark mode and collapse
behaviour then come from whatever version is installed. Group headers likewise
clone the CRM's own `div[data-slot="sidebar-label"]`, chevron included.

Fixes found by diffing our rendered rows against the CRM's:

- The group header sat 8px right of "Public Views": syncCollapse() treated every
  label like a nav row and added `ml-2`, but a section label only fades its <h3>
  (`w-auto opacity-100`, no margin). The tag now records which animation applies.
- Collapsed rail: icons stayed left-hugged, because the host swaps `pl-2` for
  `justify-center` and grows the icon holder to `size-7` — something static clones
  never did. The header also collapsed to an empty 28px gap (frappe-ui shows a
  divider rule there instead), and group children were force-hidden, so a group's
  icons vanished from the rail entirely.
- Reloading while collapsed showed icons with no labels after expanding: the
  cloned template was already in rail form (`ml-0 w-0 opacity-0`), leaving nothing
  to restore. Clones are now normalised to the expanded state first.
- Labels render through `__()`, so matching the literal "Call Logs" broke the whole
  injection on a translated site. There is now a structural fallback, and the label
  element is located by layout rather than by the template's text.
- The Search row showed a list icon: `search` was missing from the curated icon map.

List view: the route host div used `height: 100%` inside FCRM's
`flex-1 flex flex-col h-full overflow-auto` column — one AppHeader too tall, so the
column scrolled and the bottom of the list was cut off. It now sizes as a flex
child. Its header also drew a second bar below the CRM's empty `#app-header` slot;
it teleports into that slot like FCRM's own pages do.

Also dead code and robustness cleanups the review turned up: the unreachable
crm <= 1.74 markup branch is gone (the caller already requires a template), and the
cached sidebar element is re-resolved when the SPA detaches it.

Verified against the markup both versions actually render — 67 assertions over
happy-dom fixtures for crm 1.74 rows, crm 1.81 rows, a collapsed sidebar and a
translated sidebar.
…nerations

fb3b61c's aliases were written from frappe-ui's legacy `tailwind/colors.js`, which
is not what the shipped preset emits. Two wrong premises made most of those rules
dead:

  - ink variables are `--ink-*` in both generations, not `--text-ink-*`;
  - both generations store whole colours (0.1.x `#fff`, 1.x `oklch(...)`), so
    wrapping them in `rgb()` produced invalid values, not RGB channels.

Regenerated against the stylesheets crm 1.74.1 (frappe-ui 0.1.261) and crm 1.81.0
(frappe-ui 1.0.0-beta.29) actually produce. Each rule now names the 1.x token first
and falls back to its 0.1.x counterpart, then to a literal, so one chain serves
either host; because the variables are the host's own, dark mode and any theme
customisation follow automatically and no duplicate dark-mode rules are needed.

Coverage also extends past the pure renames to the ramps the same migration
renumbered (surface-gray-5 -> 8, ink-red-2 -> 5, outline-gray-5 -> 7, ...), which
is what the first attempt missed: those class names exist only in 1.x, so on a
0.1.x host our solid buttons, hover states and error text had no rule at all.

Every selector stays wrapped in `:where()` (zero specificity), so wherever the host
ships the class its own rule wins — these can only fill gaps, never restyle the CRM.
Result: of the 97 token classes the bundle uses, 0 are unstyled on either version
(was 49 unstyled on 1.74.1 and 27 on the 1.x line).
- public/js/search_bar.js: the pre-Vue Cmd+K implementation from c8c1f44,
  superseded by SearchDialog.vue. Nothing references it — no hooks include, no
  entry in www/crm.py's EXTENSION_SCRIPTS, no mention in the README.
- public/js/style.css: a stale build artifact (frappe-ui popover keyframes from an
  old bundle CSS). b5098f5 stopped tracking Vite outputs but missed this one; the
  live file is the gitignored frappe-crm-xt-frontend.css.
- frontend/pnpm-workspace.yaml: vestigial since ed8b0c5 moved to yarn classic. It
  only held unanswered `allowBuilds:` placeholders and there is no pnpm-lock.yaml.
- @rollup/rollup-darwin-arm64 optionalDependency: never imported, and it pinned a
  darwin-arm64 binary into a lockfile that CI resolves on Linux. Rollup declares
  its own per-platform optional deps, so the correct binary is still installed.

Also ignore .ruff_cache, which was untracked but unignored (invisible so far only
because the directory happens to be empty).

Verified: the six patched dependency versions are unchanged after re-resolving,
and the bundle still builds.
# Conflicts:
#	frontend/yarn.lock
feat: Ui update to frappe ui v1.0.0
@trufurs
trufurs requested a balanced review from Copilot and removed request for Copilot September 8, 2026 13:58
@trufurs
trufurs requested a review from dpk404 September 8, 2026 14:37
fix: update description and add id on web element
Copilot AI balanced review requested due to automatic review settings September 9, 2026 08:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Newly injected sidebar controls are not keyboard-operable in modern anchor and section-label layouts.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Synchronizes the extension with the Frappe CRM v16 hotfix, updating frontend integration, styling, dependencies, and migrated metadata.

Changes:

  • Reworks sidebar injection and list-view header integration.
  • Adopts updated Frappe UI tokens and dependencies.
  • Cleans obsolete assets and custom-field descriptions.
File summaries
File Description
.gitignore Ignores Ruff cache.
README.md Documents group icon limitations.
pyproject.toml Expands supported CRM versions.
frontend/package.json Updates frontend dependencies.
frontend/pnpm-workspace.yaml Removes obsolete pnpm configuration.
frontend/src/components/App.vue Reworks sidebar injection and cleanup.
frontend/src/components/Attendee.vue Updates design tokens and typography.
frontend/src/components/EventNotifications.vue Updates surface styling.
frontend/src/components/ExtListRows.vue Updates typography.
frontend/src/components/ExtListView.vue Teleports headers and updates styling.
frontend/src/components/InjectedEventModal.vue Updates modal styling.
frontend/src/components/InjectedEventsTab.vue Updates event view styling.
frontend/src/components/ListFilterLocal.vue Updates filter styling and removes dead code.
frontend/src/components/SearchDialog.vue Updates input metadata and styling.
frontend/src/composables/event.js Makes duration formatting private.
frontend/src/lucideIcons.js Adds search and folder icons.
frontend/src/styles/bundle.css Adds compatibility utility styles.
frontend/src/utils/index.js Adds email validation.
frontend/src/utils/sidebarRow.js Adds native sidebar cloning utilities.
frappe_crm_xt/__init__.py Bumps package version.
frappe_crm_xt/fixtures/crm_form_script.json Updates calendar filtering and fixture encoding.
frappe_crm_xt/hooks.py Updates sidebar configuration and fields.
frappe_crm_xt/patches.txt Registers the new migration patch.
frappe_crm_xt/patches/v1_0/clear_calendar_field_descriptions.py Clears obsolete field descriptions.
frappe_crm_xt/public/js/search_bar.js Removes obsolete search implementation.
frappe_crm_xt/public/js/style.css Removes obsolete generated styles.
frappe_crm_xt/setup/custom_fields.json Removes outdated field descriptions.
Review details
  • Files reviewed: 25/28 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread frontend/src/utils/sidebarRow.js
Comment thread frontend/src/utils/sidebarRow.js
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.

3 participants