Skip to content

Comments

SK-2571 sample and readme changes for zip file#674

Open
skyflow-bharti wants to merge 2 commits intomainfrom
SK-2571-sample-and-readme-changes-for-zip-file
Open

SK-2571 sample and readme changes for zip file#674
skyflow-bharti wants to merge 2 commits intomainfrom
SK-2571-sample-and-readme-changes-for-zip-file

Conversation

@skyflow-bharti
Copy link
Collaborator

No description provided.

@github-actions
Copy link

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions
Copy link

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for rendering and interacting with ZIP files using Composable Reveal Elements in the Skyflow JavaScript SDK. It introduces a new sample HTML file demonstrating ZIP file rendering functionality and comprehensive documentation explaining the feature.

Changes:

  • Added a new sample file (render-zip-file.html) demonstrating how to render ZIP files with navigation and download capabilities
  • Added comprehensive documentation in README.md explaining ZIP file rendering feature, including API usage, styling options, and code examples
  • Introduced new styling options specific to ZIP rendering: zipNavStyles, zipNavListItemStyles, and zipPanelStyles

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 14 comments.

File Description
samples/using-script-tag/render-zip-file.html New sample file demonstrating ZIP file rendering with composable reveal elements, including file navigation and download functionality
README.md Added documentation section for ZIP file rendering feature with step-by-step guide, styling options, response format, and complete example

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

After you create and mount the element, call the renderFile() method on the element as shown below:
```javascript
const options = {
zipRender: true, // Enable zip file rendering, Default is false
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

Inconsistency in capitalization: "zip" vs "ZIP". Line 4456 uses lowercase "zip" in the comment "Enable zip file rendering" while most other places in the documentation use uppercase "ZIP" (e.g., line 4448, 4532, 4577). Maintain consistent capitalization throughout the documentation, preferably using "ZIP" as it's an acronym.

Suggested change
zipRender: true, // Enable zip file rendering, Default is false
zipRender: true, // Enable ZIP file rendering, Default is false

Copilot uses AI. Check for mistakes.
Comment on lines +4452 to +4469
### Step 3: Enable ZIP rendering in options
After you create and mount the element, call the renderFile() method on the element as shown below:
```javascript
const options = {
zipRender: true, // Enable zip file rendering, Default is false
};

const renderZipFileElement = revealContainer.create(renderZipFileInput, options);

renderZipFileElement
.renderFile()
.then(data => {
// Handle success
})
.catch(err => {
// Handle error
});
```
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

Step 3 heading is misleading. The heading says "Enable ZIP rendering in options" but the code example shows both creating the element with options AND calling renderFile(). This should either be split into two steps (Step 3: Create element with options, Step 4: Render the file) or the heading should be updated to "Create and render the ZIP file element".

Copilot uses AI. Check for mistakes.
skyflowID: "<SKYFLOW_ID>", // zip
column: "<COLUMN_NAME>",
table: "<TABLE_NAME>",
altText: "Driving License",
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The altText value "Driving License" seems inconsistent with the purpose of rendering ZIP files. Consider using a more generic placeholder like "Loading ZIP file..." or "ZIP File" to better match the context of this sample.

Suggested change
altText: "Driving License",
altText: "ZIP File",

Copilot uses AI. Check for mistakes.
cursor: 'pointer',
borderBottom: '1px solid #eee',
},
focus:{
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

Missing space after colon in "focus:{". Should be "focus: {" for consistency with the code style used throughout the documentation.

Suggested change
focus:{
focus: {

Copilot uses AI. Check for mistakes.
Comment on lines +4594 to +4596
.catch((err) => {
console.error("Failed to fetch skyflow_id:", err);
});
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

Broken code structure: There is an orphaned .catch() block without a matching promise chain. Lines 4594-4596 show a catch block that appears to be intended to close a fetch promise, but there's no opening fetch or promise chain in the example. This will cause a syntax error if copied as-is.

Suggested change
.catch((err) => {
console.error("Failed to fetch skyflow_id:", err);
});

Copilot uses AI. Check for mistakes.
Comment on lines +55 to +72

const revealContainerOptions = {
layout: [1],
styles: {
base: {
}
},
errorTextStyles: {
base: {
color: 'red',
fontFamily: '"Roboto", sans-serif'
},
global: {
'@import' :'url("https://fonts.googleapis.com/css2?family=Roboto&display=swap")',
}
}
}

Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

Inconsistent indentation with tabs instead of spaces. Lines 57-70 use tabs for indentation while the rest of the file uses spaces. This should be consistent with the codebase convention of using 2 spaces per indentation level.

Suggested change
const revealContainerOptions = {
layout: [1],
styles: {
base: {
}
},
errorTextStyles: {
base: {
color: 'red',
fontFamily: '"Roboto", sans-serif'
},
global: {
'@import' :'url("https://fonts.googleapis.com/css2?family=Roboto&display=swap")',
}
}
}
const revealContainerOptions = {
layout: [1],
styles: {
base: {
}
},
errorTextStyles: {
base: {
color: 'red',
fontFamily: '"Roboto", sans-serif'
},
global: {
'@import' :'url("https://fonts.googleapis.com/css2?family=Roboto&display=swap")',
}
}
}

Copilot uses AI. Check for mistakes.
}
}

const revealContainer = skyflowClient.container(Skyflow.ContainerType.COMPOSE_REVEAL, revealContainerOptions);;
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

Double semicolons at the end of the statement. Remove one semicolon to maintain consistency with the rest of the codebase.

Suggested change
const revealContainer = skyflowClient.container(Skyflow.ContainerType.COMPOSE_REVEAL, revealContainerOptions);;
const revealContainer = skyflowClient.container(Skyflow.ContainerType.COMPOSE_REVEAL, revealContainerOptions);

Copilot uses AI. Check for mistakes.
Comment on lines +74 to +120
const renderStyleOptions = {
inputStyles: { // styled for overall container where zip file is rendered
base: {
borderRadius: "3px",
border: '2px solid #eae8ee',
height: "400px",
width: "100%",
overflow: 'auto',
},
},
zipNavStyles: { // styles for zip navigation panel
base: {
borderRight: '4px solid #eae8ee',
},
focus: {
// boxShadow: 'red',
// borderColor: 'red',
},
},
zipNavListItemStyles: { // styles for file name list items on zip nav
base: {
margin: '0px',
border: 'none',
borderRadius: '0px',
backgroundColor: 'none',
// height: '10px',
// width: '500px',
// borderRadius: '4px',
// backgroundColor: '#f5f5f5',
// font: '16px Arial, sans-serif',
// color: '#1d1d1d',
// padding: '10px',
// margin: '5px',
},
focus: { // styles for file name list item on focus
border: 'none',
backgroundColor: '#d0f0c0', //light green on focus
},
},
zipPanelStyles: { // styles for right panel where file content is rendered
base: {
// backgroundColor: '#ffffff',
// border: '10px solid #eae8ee',
// overflow: 'none',
// padding: '16px',
}
}
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

Significant amount of commented-out code should be removed. Lines 89-90, 99-106, and 115-118 contain commented-out style properties. If these are meant as examples, they should be documented in the README or removed entirely to keep the sample clean and focused.

Copilot uses AI. Check for mistakes.
Comment on lines +4445 to +4450
**Enable Zip Render** -
```javascript
const options = {
zipRender: true // Enable ZIP file rendering, defaults to false
};
```
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

Duplicate section: "Enable Zip Render" is documented both here (lines 4445-4450) and again in Step 3 (lines 4455-4457). This creates confusion as the same options object is shown twice with slight variations in comments ("defaults to false" vs "Default is false"). Consider removing this duplicate section or consolidating it into Step 3.

Suggested change
**Enable Zip Render** -
```javascript
const options = {
zipRender: true // Enable ZIP file rendering, defaults to false
};
```

Copilot uses AI. Check for mistakes.
Comment on lines +4572 to +4577
// Render ZIP file with zipRender option enabled
const renderButton = document.getElementById("renderButton");
if (renderButton) {
renderButton.addEventListener("click", () => {
fileElement
.renderFile({ zipRender: true }) // Enable ZIP file rendering
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

Inconsistency in API usage: The renderFile() method is called with a zipRender option parameter on line 4577, but earlier in Step 3 (line 4462), renderFile() is called without parameters. The zipRender option should be set when creating the element (as shown in line 4459), not when calling renderFile(). This inconsistency could confuse users about the correct API usage.

Suggested change
// Render ZIP file with zipRender option enabled
const renderButton = document.getElementById("renderButton");
if (renderButton) {
renderButton.addEventListener("click", () => {
fileElement
.renderFile({ zipRender: true }) // Enable ZIP file rendering
// Render ZIP file (zipRender should be configured when creating the element)
const renderButton = document.getElementById("renderButton");
if (renderButton) {
renderButton.addEventListener("click", () => {
fileElement
.renderFile()

Copilot uses AI. Check for mistakes.
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