Skip to content

[cards][Feature Request] Add line numbers and copy to clipboard functionality to codeblocks in Adaptive Cards #234

@LordBoBCUP

Description

@LordBoBCUP

Currently CodeBlocks do not render correctly in teams or devtoolsplugin. Codeblocks dont have line numbers, and are in adaptive card that isn't even copyable. We would like to see a copy to clipboard button and correct line numbering working on the CodeBlock adaptive cards in teams (at least on web/desktop where the documentation already states they are supported).

Currently we see the codeblock rendered in what looks like some kind of container that is then not even selectable to copy manually let alone provide line numbering and other features of the codeblock. highlighting does seem to work correctly.

I have tried both 2.0.0-preview.2 and 2.0.0-preview.3 as well as different versions on the adaptive card itself from 1.2 to 1.6 with no change.

Image

Here is the basic code sent as a test in my app.on('message'...

const AC = new AdaptiveCard();
        AC.version = '1.5';
        AC.id = '12345';
        AC.body = [
            new CodeBlock({
                codeSnippet: `/**\n* @author John Smith <john.smith@example.com>\n*/\npackage l2f.gameserver.model;\n\npublic abstract strictfp class L2Char extends L2Object {\n  public static final Short ERROR = 0x0001;\n\n  public void moveTo(int x, int y, int z) {\n    _ai = null;\n    log(\"Shouldn't be called\");\n    if (1 > 5) { // what!?\n      return;\n    }\n  }\n}`,
                language: 'Java',
                startLineNumber: 61,

            })
        ];
        await send(AC);

It looks like on the various repos there have been many requests for this functionality in order to improve app's UX in teams so it would be good if this could be given some priority.

Metadata

Metadata

Assignees

Labels

spikeTimeboxed research item

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions