Skip to content

Add Sheet Playground sample - #15

Open
hthau wants to merge 5 commits into
mainfrom
feature/sheet-component-playground
Open

Add Sheet Playground sample#15
hthau wants to merge 5 commits into
mainfrom
feature/sheet-component-playground

Conversation

@hthau

@hthau hthau commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

What I Did:

  • Added a new Sheet Playground LWC sample demonstrating how to embed and interact with the <msmx-sheet-sheet> component directly from a custom Lightning Web Component.

  • Added a new Sheet Playground tab to the Sheet Integration Example app.

  • Updated the sample permission set to grant access to the new Sheet Playground tab.

  • Updated both README and README_ja with:

    • Usage instructions for the Sheet Playground sample.
    • Technical highlights covering component embedding, property binding, event handling, and manual application patterns.
    • Screenshots illustrating the Sheet Playground UI and behavior.

Note:

  • The sample is currently using an older package version. Due to a known limitation, changes to the book-id and sheet-id properties are not reflected when these values are updated dynamically after the component has been initialized.
  • Once a package version that includes support for dynamic book-id / sheet-id updates becomes available, the sample and documentation should be revisited and updated accordingly.

@hthau hthau self-assigned this Jun 18, 2026
@hthau
hthau requested a review from stomita June 18, 2026 02:23
Comment thread README_ja.md Outdated

<img width="1920" height="1688" alt="sheet-playground" src="https://github.com/user-attachments/assets/59834dda-4fe7-461a-8dde-7f35f843f39b" />

このサンプルは、カスタム Lightning Web コンポーネントのテンプレート内で **Mashmatrix Sheet LWC コンポーネント (`<msmx-sheet-sheet>`)** を直接埋め込み、制御する方法を示しています。

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.

<msmxsheet-sheet-component>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 44035bf

Comment thread README.md Outdated

<img width="1920" height="1688" alt="sheet-playground" src="https://github.com/user-attachments/assets/3eb61ff9-e230-4ed7-a8d5-6088f7112cce" />

This sample demonstrates how to embed and control the **Mashmatrix Sheet LWC component (`<msmx-sheet-sheet>`)** directly within a custom Lightning Web Component's template.

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.

<msmxsheet-sheet-component>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 44035bf

label="Component ID"
value={draft.componentId}
onchange={handleComponentIdChange}
></lightning-input>

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.

The component id would not be changed (and developer should not change it) during the component lifecycle.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 44035bf

- disabled componentId
- update the readme to the correct sheet-component name.
@hthau
hthau requested a review from stomita June 23, 2026 03:22

@stomita stomita 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.

@hthau

Doc/attribute name mismatch: README says context-record-id, component attribute is record-id

In README.md (line 166) and README_ja.md (line 169), the Property Binding section lists context-record-id, but msmxSheet's sheetComponent exposes the record context through the record-id attribute (@api recordId) — there is no context-record-id attribute.

The sample markup itself is correct: force-app/main/default/lwc/sheetPlayground/sheetPlayground.html (line 187) uses record-id={applied.contextRecordId}. Only the READMEs use the non-existent context-record-id name (the binding source variable is contextRecordId, which looks like where the mix-up came from).

Please update both READMEs to use record-id so the documented attribute names match the actual component API.

@hthau
hthau requested a review from stomita July 27, 2026 01:35
@msmx-mnakagawa

Copy link
Copy Markdown
Contributor

Findings from exercising the Sheet Playground sample:

  1. Permission set lacks Apex class access for SheetPlaygroundController — with only the README-prescribed permission sets, a non-admin user gets a "no access to Apex class" error on getBooks, leaving the Book picker empty. Adding the class access to Mashmatrix_Sheet_Integration_Examples (plus sharing a book to the user) makes the playground fully functional (verified). Consider also noting in the README that books must be shared to the testing user, since the controller is with sharing.

  2. Fixed componentId breaks multi-instance placement — every instance mounts with component-id="sheet-integration-example" and the field is not editable. Placing two playgrounds on one page makes them interfere with each other (applying Book/Sheet on one switches the other's display; reproduced). Each instance needs a distinct component-id; suggest a per-instance design-time id (e.g. an App Builder property or a generated unique default) plus a README note that a unique component-id per instance is required.

  3. Auto-selecting the first book overrides the host's intentwiredBooks falls back to bookOptions[0] and applies it, so the playground displays a book the host never requested and the sample never exercises the empty book-id state. Suggest dropping the auto-select (or making it opt-in) so the sample reflects only what the user explicitly sets.

  4. README install package needs updating for this sample — with the package id currently referenced in the setup steps, the playground's book/sheet switching does not work as demonstrated. The package id in both README.md and README_ja.md should be updated to one that this sample actually works against before release.

Everything else checked out: markup/attribute names in both READMEs match the component API, and the sample demonstrates record-selection events, parameter changes, context-record switching, and book/sheet switching.

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