Skip to content

bug fixes#72

Merged
eviltester merged 2 commits into
masterfrom
71-minor-bug-fixes
May 8, 2026
Merged

bug fixes#72
eviltester merged 2 commits into
masterfrom
71-minor-bug-fixes

Conversation

@eviltester

@eviltester eviltester commented May 8, 2026

Copy link
Copy Markdown
Owner

closes #70
closes #50
closes #51
closes #71

Summary by CodeRabbit

  • New Features

    • Added help icons to Generate Data and Pairwise controls for improved guidance.
    • New UI styles for generator buttons and file icons.
  • Bug Fixes

    • Generate/Pairwise controls now re-evaluate visibility as schema text changes.
    • "Set Grid From Text" is enabled only when preview text has been edited; preview transitions clear the dirty state.
    • Schema text mode now syncs and validates correctly without switching modes.
  • Tests

    • Added coverage for text-mode behavior and preview/edit synchronization.

Copilot AI review requested due to automatic review settings May 8, 2026 16:13
@eviltester eviltester linked an issue May 8, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1aad07e0-1578-43e4-917e-5ba271828ec5

📥 Commits

Reviewing files that changed from the base of the PR and between c333938 and a1a0506.

📒 Files selected for processing (2)
  • packages/core-ui/js/gui_components/data-generator-page.js
  • packages/core-ui/src/tests/generator/data-generator-page.test.js
✅ Files skipped from review due to trivial changes (1)
  • packages/core-ui/src/tests/generator/data-generator-page.test.js

📝 Walkthrough

Walkthrough

This PR enables direct text-mode schema editing and generation in the data generator, adds preview-text dirty-state tracking to gate grid import, updates generator UI styling and help-icon wrappers, and extends tests for text-mode and preview dirty-state behaviors.

Changes

Data Generator Text Mode & Preview State Feature

Layer / File(s) Summary
UI Styling & Layout
apps/web/styles.css
.generator-button-with-help flex container and .generator-file-icon with triangular ::after marker added.
Schema Spec Generation
packages/core-ui/js/gui_components/data-generator-page.js
schemaRowsToSpec trims row names and rule specs separately and skips rows when both are empty.
Text Mode Synchronization
packages/core-ui/js/gui_components/data-generator-page.js
New syncSchemaRowsFromTextMode({ showErrors }) parses schema textarea and syncs this.schemaRows with optional error alerts, allowing zero parsed rows.
Text Mode Integration in Generation
packages/core-ui/js/gui_components/data-generator-page.js
createConfiguredGenerator and countEnumColumns call syncSchemaRowsFromTextMode() before validation, enabling generation directly from text mode.
Data Generator UI Updates
packages/core-ui/js/gui_components/data-generator-page.js
Generate/Pairwise/Preview buttons wrapped with help-icon markup; textarea input listener triggers pairwise button visibility; button visibility controlled via wrapper elements.
ImportExportControls: core binding & state
packages/core-ui/js/gui_components/import-export-controls.js
Constructor adds previewTextDirty and binding guard; GUI setup binds preview textarea input listener; _syncGridFromTextButtonState() respects preview mode and dirty flag.
Dirty Flag Lifecycle Management
packages/core-ui/js/gui_components/import-export-controls.js
Dirty flag cleared on mode switches, programmatic preview renders, and after successful import; importTextArea() refuses when preview not dirty.
Data Generator Test Coverage
packages/core-ui/src/tests/generator/data-generator-page.test.js
Tests added for blank schema filtering, empty textarea for untouched blank schema, generation from text mode producing async CSV without alerts, and alert on empty text-mode generation.
Import-Export Controls Test Coverage
packages/core-ui/src/tests/utils/import-export-controls-mode.test.js
Tests verify preview-mode dirty state tracking: button enablement after edit, input listener binding resilience, and button disablement after import.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰
Text mode hums beneath my paws,
I sync the rows without a pause.
Dirty previews wake a light,
Buttons listen when you write.
From text to grid — hop, all is right!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'bug fixes' is vague and generic, using non-descriptive terms that don't convey specific information about the actual changes made in this pull request. Use a more specific title that summarizes the main changes, such as 'Support text-mode generation and preview with dirty-state tracking' or 'Enable grid configuration from preview edits and remove blank schema line'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The pull request successfully addresses all four linked issues: #70 (preview dirty-state tracking), #50 (text-mode generation/preview), #51 (empty schema initialization), and #71 (bug fixes).
Out of Scope Changes check ✅ Passed All changes are directly aligned with the linked issue objectives; no out-of-scope modifications were detected in the CSS, JavaScript logic, or test files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 71-minor-bug-fixes

Comment @coderabbitai help to get the list of available commands and usage tips.

Repository owner deleted a comment from qa-tech-integration Bot May 8, 2026

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/core-ui/src/tests/generator/data-generator-page.test.js (1)

819-847: ⚡ Quick win

Add the missing text-mode preview regression test too.

This new case covers file generation from text mode, but issue #50 also calls out previewing from text mode. A matching previewDataButton test would lock down the preview-specific path (setGridFromGenericDataTable and generatorOutputPreview) that this download test never touches.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/core-ui/src/tests/generator/data-generator-page.test.js` around
lines 819 - 847, Add a parallel test that verifies previewing from text mode:
instantiate DataGeneratorPage the same way as the existing download test, call
page.init(), click the schemaModeToggleButton, set generatorSchemaText.value and
generateRowsCount.value, then click the previewDataButton (element id
'previewDataButton') and await the preview flow; assert that
page.setGridFromGenericDataTable and page.generatorOutputPreview (or spies on
those methods) were called and that alertFn was not called so the
preview-specific path is exercised. Ensure the test name reflects previewing
from text mode and reuse FakeGridExtension/TestDataGenerator hooks if needed to
observe the grid/preview behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/core-ui/js/gui_components/data-generator-page.js`:
- Around line 651-666: In syncSchemaRowsFromTextMode, when in text mode and
parseSchemaTextToRows returns zero rows, do not replace schemaRows with
createBlankSchemaRow(); instead leave schemaRows as an empty array so the
empty-textarea state preserves zero rows until the user switches back to schema
mode. Concretely, change the branch that sets this.schemaRows =
parsed.rows.length > 0 ? parsed.rows : [this.createBlankSchemaRow()] to assign
an empty array when parsed.rows is empty (this.schemaRows = parsed.rows.length >
0 ? parsed.rows : []), preserving the existing zero-row validation path used
elsewhere.

In `@packages/core-ui/js/gui_components/import-export-controls.js`:
- Line 97: Replace the incorrect/misspelled alert text in
packages/core-ui/js/gui_components/import-export-controls.js: change the string
"Grid to Text only availalable in Edit mode" to a clear, accurate message that
names the button and fixes the typo, e.g. "Set Grid From Text is only available
in Edit mode."; update the alert call where that exact string appears so users
see the corrected copy.

---

Nitpick comments:
In `@packages/core-ui/src/tests/generator/data-generator-page.test.js`:
- Around line 819-847: Add a parallel test that verifies previewing from text
mode: instantiate DataGeneratorPage the same way as the existing download test,
call page.init(), click the schemaModeToggleButton, set
generatorSchemaText.value and generateRowsCount.value, then click the
previewDataButton (element id 'previewDataButton') and await the preview flow;
assert that page.setGridFromGenericDataTable and page.generatorOutputPreview (or
spies on those methods) were called and that alertFn was not called so the
preview-specific path is exercised. Ensure the test name reflects previewing
from text mode and reuse FakeGridExtension/TestDataGenerator hooks if needed to
observe the grid/preview behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 637ce3af-52d4-489e-a09a-8041f23c2034

📥 Commits

Reviewing files that changed from the base of the PR and between d229070 and c333938.

📒 Files selected for processing (5)
  • apps/web/styles.css
  • packages/core-ui/js/gui_components/data-generator-page.js
  • packages/core-ui/js/gui_components/import-export-controls.js
  • packages/core-ui/src/tests/generator/data-generator-page.test.js
  • packages/core-ui/src/tests/utils/import-export-controls-mode.test.js

Comment thread packages/core-ui/js/gui_components/data-generator-page.js
Comment thread packages/core-ui/js/gui_components/import-export-controls.js

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@eviltester eviltester merged commit 711dc53 into master May 8, 2026
5 checks passed
@eviltester eviltester deleted the 71-minor-bug-fixes branch May 8, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants