Fossil SCM
Set /chat's default input mode to contenteditable and document why.
Commit
df37d216966b23a9de50a66bcce6d13d18d28d4318fc47909f2e31d12b99236b
Parent
ac7ed615ff32ca0…
1 file changed
+28
-8
+28
-8
| --- src/fossil.page.chat.js | ||
| +++ src/fossil.page.chat.js | ||
| @@ -1,6 +1,6 @@ | ||
| 1 | --/** | |
| 1 | +/** | |
| 2 | 2 | This file contains the client-side implementation of fossil's /chat |
| 3 | 3 | application. |
| 4 | 4 | */ |
| 5 | 5 | window.fossil.onPageLoad(function(){ |
| 6 | 6 | const F = window.fossil, D = F.dom; |
| @@ -530,11 +530,20 @@ | ||
| 530 | 530 | which gets played when new messages arrive. When true, |
| 531 | 531 | the first entry in the audio file selection list will be |
| 532 | 532 | used. */ |
| 533 | 533 | "audible-alert": true, |
| 534 | 534 | /* |
| 535 | - */ | |
| 535 | + When on, /chat will beep only once after the tab is hidden | |
| 536 | + from view. Interacting with /chat will reset it, such that | |
| 537 | + it beeps only once after being subsequently hidden. When | |
| 538 | + this is off it beeps for each new message. | |
| 539 | + | |
| 540 | + In other words: this works like most notifications on | |
| 541 | + Android: it only beeps once, then not again until you | |
| 542 | + interact with it, which resets the beep for the next | |
| 543 | + notification. | |
| 544 | + */ | |
| 536 | 545 | "beep-once": false, |
| 537 | 546 | /* When on, show the list of "active" users - those from |
| 538 | 547 | whom we have messages in the currently-loaded history |
| 539 | 548 | (noting that deletions are also messages). */ |
| 540 | 549 | "active-user-list": false, |
| @@ -543,16 +552,27 @@ | ||
| 543 | 552 | "active-user-list-timestamps": false, |
| 544 | 553 | /* When on, the [audible-alert] is played for one's own |
| 545 | 554 | messages, else it is only played for other users' |
| 546 | 555 | messages. */ |
| 547 | 556 | "alert-own-messages": false, |
| 548 | - /* "Experimental mode" input: use a contenteditable field | |
| 549 | - for input. This is generally more comfortable to use, | |
| 550 | - and more modern, than plain text input fields, but | |
| 551 | - the list of browser-specific quirks and bugs is... | |
| 552 | - not short. */ | |
| 553 | - "edit-widget-x": false | |
| 557 | + /* Use a contenteditable field for input. This is generally | |
| 558 | + more comfortable to use, and more modern, than plain text | |
| 559 | + input fields. In its early years the contenteditable | |
| 560 | + capability had some browser-specific quirks which made is | |
| 561 | + difficult on some clients so was opt-in rather than | |
| 562 | + opt-out. In recent years (2023+) those quirks have been | |
| 563 | + limited to an occasional injection of an extraneous | |
| 564 | + newline, and this method really is more comfortable to | |
| 565 | + use, so the default was changed to true on 2026-08-16. | |
| 566 | + | |
| 567 | + Historical note: the name of this option is unfortunately | |
| 568 | + vague. The "X" originally stood for "experimental". It's | |
| 569 | + not been renamed because changing this default out from | |
| 570 | + under long-running /chat clients on their next reload | |
| 571 | + seems too disruptive to justify such an | |
| 572 | + internal-cosmetics-only change. */ | |
| 573 | + "edit-widget-x": true | |
| 554 | 574 | } |
| 555 | 575 | }, |
| 556 | 576 | /** Plays a new-message notification sound IF the audible-alert |
| 557 | 577 | setting is true, else this is a no-op. Returns this. |
| 558 | 578 | */ |
| 559 | 579 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -1,6 +1,6 @@ | |
| 1 | -/** |
| 2 | This file contains the client-side implementation of fossil's /chat |
| 3 | application. |
| 4 | */ |
| 5 | window.fossil.onPageLoad(function(){ |
| 6 | const F = window.fossil, D = F.dom; |
| @@ -530,11 +530,20 @@ | |
| 530 | which gets played when new messages arrive. When true, |
| 531 | the first entry in the audio file selection list will be |
| 532 | used. */ |
| 533 | "audible-alert": true, |
| 534 | /* |
| 535 | */ |
| 536 | "beep-once": false, |
| 537 | /* When on, show the list of "active" users - those from |
| 538 | whom we have messages in the currently-loaded history |
| 539 | (noting that deletions are also messages). */ |
| 540 | "active-user-list": false, |
| @@ -543,16 +552,27 @@ | |
| 543 | "active-user-list-timestamps": false, |
| 544 | /* When on, the [audible-alert] is played for one's own |
| 545 | messages, else it is only played for other users' |
| 546 | messages. */ |
| 547 | "alert-own-messages": false, |
| 548 | /* "Experimental mode" input: use a contenteditable field |
| 549 | for input. This is generally more comfortable to use, |
| 550 | and more modern, than plain text input fields, but |
| 551 | the list of browser-specific quirks and bugs is... |
| 552 | not short. */ |
| 553 | "edit-widget-x": false |
| 554 | } |
| 555 | }, |
| 556 | /** Plays a new-message notification sound IF the audible-alert |
| 557 | setting is true, else this is a no-op. Returns this. |
| 558 | */ |
| 559 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -1,6 +1,6 @@ | |
| 1 | /** |
| 2 | This file contains the client-side implementation of fossil's /chat |
| 3 | application. |
| 4 | */ |
| 5 | window.fossil.onPageLoad(function(){ |
| 6 | const F = window.fossil, D = F.dom; |
| @@ -530,11 +530,20 @@ | |
| 530 | which gets played when new messages arrive. When true, |
| 531 | the first entry in the audio file selection list will be |
| 532 | used. */ |
| 533 | "audible-alert": true, |
| 534 | /* |
| 535 | When on, /chat will beep only once after the tab is hidden |
| 536 | from view. Interacting with /chat will reset it, such that |
| 537 | it beeps only once after being subsequently hidden. When |
| 538 | this is off it beeps for each new message. |
| 539 | |
| 540 | In other words: this works like most notifications on |
| 541 | Android: it only beeps once, then not again until you |
| 542 | interact with it, which resets the beep for the next |
| 543 | notification. |
| 544 | */ |
| 545 | "beep-once": false, |
| 546 | /* When on, show the list of "active" users - those from |
| 547 | whom we have messages in the currently-loaded history |
| 548 | (noting that deletions are also messages). */ |
| 549 | "active-user-list": false, |
| @@ -543,16 +552,27 @@ | |
| 552 | "active-user-list-timestamps": false, |
| 553 | /* When on, the [audible-alert] is played for one's own |
| 554 | messages, else it is only played for other users' |
| 555 | messages. */ |
| 556 | "alert-own-messages": false, |
| 557 | /* Use a contenteditable field for input. This is generally |
| 558 | more comfortable to use, and more modern, than plain text |
| 559 | input fields. In its early years the contenteditable |
| 560 | capability had some browser-specific quirks which made is |
| 561 | difficult on some clients so was opt-in rather than |
| 562 | opt-out. In recent years (2023+) those quirks have been |
| 563 | limited to an occasional injection of an extraneous |
| 564 | newline, and this method really is more comfortable to |
| 565 | use, so the default was changed to true on 2026-08-16. |
| 566 | |
| 567 | Historical note: the name of this option is unfortunately |
| 568 | vague. The "X" originally stood for "experimental". It's |
| 569 | not been renamed because changing this default out from |
| 570 | under long-running /chat clients on their next reload |
| 571 | seems too disruptive to justify such an |
| 572 | internal-cosmetics-only change. */ |
| 573 | "edit-widget-x": true |
| 574 | } |
| 575 | }, |
| 576 | /** Plays a new-message notification sound IF the audible-alert |
| 577 | setting is true, else this is a no-op. Returns this. |
| 578 | */ |
| 579 |