Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 3, 2025

Closes #62008316-1f4f-42d5-9793-0928f77ed09a

Overview

Adds a new os.showAlert() function that displays an information/alert dialog with a single dismiss button. This complements the existing os.showConfirm() function and provides a simple way to communicate important information to users that needs to be manually dismissed.

Changes

Core Implementation

  • Added ShowAlertAction and ShowAlertOptions types in BotEvents.ts with proper JSDoc documentation
  • Implemented os.showAlert(options) function in AuxLibrary.ts that returns a Promise<void> which resolves when the user dismisses the alert
  • Created ShowAlertModal Vue component with TypeScript, template, and CSS files that handles the alert dialog display
  • Integrated the modal into PlayerApp.ts and PlayerApp.vue

API

interface ShowAlertOptions {
    /**
     * The title that should be shown on the dialog.
     */
    title: string;

    /**
     * The content of the dialog.
     */
    content: string;

    /**
     * The text that should be shown on the "Dismiss" button.
     */
    dismissText?: string;  // Defaults to "OK"
}

Usage Examples

// Basic alert
await os.showAlert({
    title: 'Alert',
    content: 'This is an important message.'
});

os.toast('Alert dismissed');
// Alert with custom button text
await os.showAlert({
    title: 'Warning',
    content: 'Please read this carefully.',
    dismissText: 'Got it'
});

Testing

  • ✅ Added comprehensive unit tests in AuxLibrary.spec.ts
  • ✅ All 1,798 tests pass in AuxLibrary test suite
  • ✅ All 3,731 tests pass in aux-runtime test suite
  • ✅ Build completes successfully
  • ✅ Linter passes with no issues

Documentation

  • Added JSDoc comments with @dochash, @docid, and @docname tags for automatic documentation generation
  • Updated CHANGELOG.md with the new feature
  • Included example usage in the JSDoc comments

The implementation follows the same architectural pattern as os.showConfirm(), ensuring consistency with the existing codebase.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkpoint.prisma.io
    • Triggering command: /opt/hostedtoolcache/node/20.19.5/x64/bin/node /home/REDACTED/work/casualos/casualos/node_modules/.pnpm/[email protected][email protected]/node_modules/prisma/build/child {&#34;product&#34;:&#34;prisma&#34;,&#34;version&#34;:&#34;6.14.0&#34;,&#34;cli_install_type&#34;:&#34;local&#34;,&#34;information&#34;:&#34;&#34;,&#34;local_timestamp&#34;:&#34;2025-10-03T17:48:21Z&#34;,&#34;project_hash&#34;:&#34;a33db9b0&#34;,&#34;cli_path&#34;:&#34;/home/REDACTED/work/casualos/casualos/src/aux-server/node_modules/prisma/build/index.js&#34;,&#34;cli_path_hash&#34;:&#34;3b63eda1&#34;,&#34;endpoint&#34;:&#34;REDACTED&#34;,&#34;disable&#34;:false,&#34;arch&#34;:&#34;x64&#34;,&#34;os&#34;:&#34;linux&#34;,&#34;node_version&#34;:&#34;v20.19.5&#34;,&#34;ci&#34;:true,&#34;ci_name&#34;:&#34;GitHub Actions&#34;,&#34;command&#34;:&#34;generate&#34;,&#34;schema_providers&#34;:[&#34;cockroachdb&#34;],&#34;schema_preview_features&#34;:[&#34;tracing&#34;],&#34;schema_generators_providers&#34;:[&#34;prisma-client-js&#34;],&#34;cache_file&#34;:&#34;/home/REDACTED/.cache/checkpoint-nodejs/prisma-3b63eda1&#34;,&#34;cache_duration&#34;:43200000,&#34;remind_duration&#34;:172800000,&#34;force&#34;:false,&#34;timeout&#34;:5000,&#34;unref&#34;:true,&#34;child_path&#34;:&#34;/home/REDACTED/work/casualos/casualos/node_modules/.pnpm/[email protected][email protected]/node_modules/prisma/build/child&#34;,&#34;client_event_id&#34;:&#34;&#34;,&#34;previous_client_event_id&#34;:&#34;&#34;,&#34;check_if_update_available&#34;:false} (dns block)
    • Triggering command: /opt/hostedtoolcache/node/20.19.5/x64/bin/node /home/REDACTED/work/casualos/casualos/node_modules/.pnpm/[email protected][email protected]/node_modules/prisma/build/child {&#34;product&#34;:&#34;prisma&#34;,&#34;version&#34;:&#34;6.14.0&#34;,&#34;cli_install_type&#34;:&#34;local&#34;,&#34;information&#34;:&#34;&#34;,&#34;local_timestamp&#34;:&#34;2025-10-03T17:48:24Z&#34;,&#34;project_hash&#34;:&#34;5ca80110&#34;,&#34;cli_path&#34;:&#34;/home/REDACTED/work/casualos/casualos/src/aux-server/node_modules/prisma/build/index.js&#34;,&#34;cli_path_hash&#34;:&#34;3b63eda1&#34;,&#34;endpoint&#34;:&#34;REDACTED&#34;,&#34;disable&#34;:false,&#34;arch&#34;:&#34;x64&#34;,&#34;os&#34;:&#34;linux&#34;,&#34;node_version&#34;:&#34;v20.19.5&#34;,&#34;ci&#34;:true,&#34;ci_name&#34;:&#34;GitHub Actions&#34;,&#34;command&#34;:&#34;--config [redacted] generate&#34;,&#34;schema_providers&#34;:[&#34;sqlite&#34;],&#34;schema_preview_features&#34;:[&#34;tracing&#34;],&#34;schema_generators_providers&#34;:[&#34;prisma-client-js&#34;],&#34;cache_file&#34;:&#34;/home/REDACTED/.cache/checkpoint-nodejs/prisma-3b63eda1&#34;,&#34;cache_duration&#34;:43200000,&#34;remind_duration&#34;:172800000,&#34;force&#34;:false,&#34;timeout&#34;:5000,&#34;unref&#34;:true,&#34;child_path&#34;:&#34;/home/REDACTED/work/casualos/casualos/node_modules/.pnpm/[email protected][email protected]/node_modules/prisma/build/child&#34;,&#34;client_event_id&#34;:&#34;&#34;,&#34;previous_client_event_id&#34;:&#34;&#34;,&#34;check_if_update_available&#34;:false} (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Add os.showAlert() to show an alert / info dialog with only an OK button.</issue_title>
<issue_description>We currently have os.showConfirm() which is great for asking the user if they want to do something or cancel the operation. It would be very useful to have a version of this that is just used for information / alerts where something should be communicated to the user and then manually dismissed.</issue_description>

<agent_instructions>Currently, there is no way to easily show the user an "alert" or "warning". This task is to add a new function, os.showAlert() that displays an information dialog to the user.

Implementation details

User Script Function

Function name: os.showAlert(options: ShowAlertOptions)
Parameters:

  • options is a ShowAlertOptions
interface ShowAlertOptions {
    /**
     * The title that should be shown on the dialog.
     */
    title: string;

    /**
     * The content of the dialog.
     */
    content: string;

    /**
     * The text that should be shown on the "Dismiss" button.
     */
    dismissText?: string;
}

Return value: A promise that resolves when the user has dismissed the alert.
Implementation Areas:

  • AuxLibrary.ts for the user script function
  • AuxLibrary.spec.ts for tests for the user script function
  • AuxLibraryDefinitions.def for typescript definitions for the function
  • ShowAlertModal.ts for the implementation of the HTML alert modal.
  • PlayerApp.vue for including the ShowAlertModal.
  • (Example) ShowConfirmModal.ts for an example implementation
    </agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #685

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@CLAassistant
Copy link

CLAassistant commented Oct 3, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ KallynGowdy
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

@Copilot Copilot AI changed the title [WIP] Add os.showAlert() to show an alert / info dialog with only an OK button. Add os.showAlert() function to display information dialogs Oct 3, 2025
Copilot finished work on behalf of KallynGowdy October 3, 2025 18:05
@Copilot Copilot AI requested a review from KallynGowdy October 3, 2025 18:05
@KallynGowdy KallynGowdy marked this pull request as ready for review October 6, 2025 19:21
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.

Add os.showAlert() to show an alert / info dialog with only an OK button.

3 participants