andymatuschak / orbit

Experimental spaced repetition platform for exploring ideas in memory augmentation and programmable attention
https://withorbit.com
Other
1.71k stars 54 forks source link

Improve layout of code blocks #191

Open andymatuschak opened 3 years ago

andymatuschak commented 3 years ago

Lines probably shouldn't wrap so much with code blocks. Probably this means that code blocks should use fairly different text metrics than the rest of the prompt.

image

To reproduce

  1. Run: cd packages/ui; yarn storybook
  2. Visit http://localhost:6006/?path=/story/card--basic
  3. Press "A" to open the addons view if necessary, then enter the following into the prompt field:
{"promptType":"qaPrompt","question":{"contents":"What's wrong with this implementation of `sum`?\n\n```\nfunction sum(list: number[]): number {\n    return list.reduce((number, total) => number + total)\n}\n```","attachments":[]},"answer":{"contents":"The arguments to `reduce` are reversed.","attachments":[]}}