Skip to content

COR-6291: support export and query record - #244

Merged
thamha-emotiv merged 5 commits into
masterfrom
COR-6291
Nov 17, 2026
Merged

thamha-emotiv merged 5 commits into
masterfrom
COR-6291

Conversation

@tungntEmotiv

Copy link
Copy Markdown
Contributor

The PR include:

  • support for export and query record example
  • adjust message log box to make it scrollable

Please help to review. Thanks

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.

Pull request overview

This PR updates the Unity SimpleExample scene and script to demonstrate record export + record querying, and redesigns the message log UI into a scrollable text box.

Changes:

  • Added UI controls for querying records and entering a record ID for exporting.
  • Switched record export to an async flow and added a QueryRecords(...) example using a JSON query object.
  • Reworked the message log UI to be scrollable (via an InputField/ScrollRect setup) and reduced log overwrites by only syncing when the underlying plugin log changes.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
unity/Assets/SimpleExample.unity Adds new query/export-related UI elements and replaces the message log with a scrollable text field setup.
unity/Assets/SimpleExample.cs Adds query/export record handlers, updates message log binding logic, and wires new UI elements into interactable-state logic.

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

Comment thread unity/Assets/SimpleExample.cs Resolved
Comment thread unity/Assets/SimpleExample.cs Resolved
Comment thread unity/Assets/SimpleExample.cs Resolved
Comment thread unity/Assets/SimpleExample.unity Resolved
Comment thread unity/Assets/SimpleExample.unity Resolved
Copilot AI lite review requested due to automatic review settings November 16, 2026 09:18

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.

Comment on lines +3667 to +3670
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}

try
{
List<Record> records = await _eItf.QueryRecords(query, null, 100, 0, true, true);
Comment on lines +577 to +578
_exportRecordBtn.interactable = _eItf.IsAuthorizedOK && !_eItf.IsRecording;
_queryRecordBtn.interactable = _eItf.IsAuthorizedOK;
Comment on lines +3132 to +3134
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
Comment thread unity/README.md
### Test Notes

- The query uses a rolling range from the current UTC time back three months. To change the range, edit `queryStart` in `onQueryRecordBtnClick()` in `Assets/SimpleExample.cs` (for example, change the `AddMonths(-3)` value).
- The export request currently includes only EEG and MOTION and uses CSV V2; these options are not configurable from the UI.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@khanhle1993 , i think we should mention that not configurable from the UI but you can change at the example at function...

Comment thread unity/README.md Outdated
- **Export Record** takes a record ID entered in the UI and calls Cortex `exportRecord` for EEG and MOTION streams in CSV V2 format. The result log reports successful and failed record IDs.
- Export is enabled after authorization and while not recording. Query is enabled after authorization.

### Manual Test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@khanhle1993 , i think no need to mention about manual test here, i think they follow above guideline, so can query and export record

Copilot AI lite review requested due to automatic review settings November 17, 2026 01:33

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.

🔵 Needs a closer look

The change still has unresolved interaction and UI layout defects that can trigger duplicate requests and prevent the message log from displaying or showing all returned records.

4 open issues

Review effort: Lite

@thamha-emotiv thamha-emotiv 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.

@khanhle1993 tested this pull.

@thamha-emotiv
thamha-emotiv merged commit b62915f into master Nov 17, 2026
4 of 6 checks passed
@thamha-emotiv
thamha-emotiv deleted the COR-6291 branch November 17, 2026 02:03
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.

4 participants