~sit

https://sit.sh

yo

~sit/campfire-web-devel

Last active 2 years ago
View more

Recent activity

Re: [PATCH gamja v4 2/2] Show number of unread buffers or messages in title 5 months ago

From sit to ~emersion/public-inbox

> Do you know if there's a better way to detect a change in the "unread"
> field of any buffer? It feels wrong to just call updateDocumentTitle()
> in each call-site which might change an "unread" field.

The only way I see is to refactor markBufferAsRead() to use setBufferState(),
and then call updateDocumentTitle() there. I believe it should be possible.
But this will result in updating the title every time a buffer's state is changed,
and also feels very janky, since setBufferState() seems more of a data-layer
method than a UI one.

[PATCH gamja v4 2/2] Show number of unread buffers or messages in title 1 year, 2 months ago

From sitting33 to ~emersion/public-inbox

---
 components/app.js           | 105 +++++++++++++++++++++++++++++++-----
 components/settings-form.js |  42 +++++++++++++++
 state.js                    |   1 +
 3 files changed, 134 insertions(+), 14 deletions(-)

diff --git a/components/app.js b/components/app.js
index 59c6c44..2838c5a 100644
--- a/components/app.js
+++ b/components/app.js
@@ -560,6 +560,8 @@ export default class App extends Component {
			return State.updateBuffer(state, buf.id, {
				unread: Unread.NONE,
			});
[message trimmed]

[PATCH gamja v4 1/2] Don't mark messages as read when window is not in focus 1 year, 2 months ago

From sitting33 to ~emersion/public-inbox

---
 components/app.js | 65 ++++++++++++++++++++++++++++++-----------------
 1 file changed, 41 insertions(+), 24 deletions(-)

diff --git a/components/app.js b/components/app.js
index 69098d9..59c6c44 100644
--- a/components/app.js
+++ b/components/app.js
@@ -529,33 +529,13 @@ export default class App extends Component {
		client.setReadMarker(storedBuffer.name, readReceipt.time);
	}

	switchBuffer(id) {
		let buf;
[message trimmed]

[PATCH gamja v3 2/2] Show number of unread buffers or messages in title 1 year, 2 months ago

From sitting33 to ~emersion/public-inbox

---
 components/app.js           | 99 ++++++++++++++++++++++++++++++++++---
 components/settings-form.js | 42 ++++++++++++++++
 state.js                    |  1 +
 3 files changed, 134 insertions(+), 8 deletions(-)

diff --git a/components/app.js b/components/app.js
index 89f3ee6..bab59ec 100644
--- a/components/app.js
+++ b/components/app.js
@@ -560,6 +560,8 @@ export default class App extends Component {
			return State.updateBuffer(state, buf.id, {
				unread: Unread.NONE,
			});
[message trimmed]

[PATCH gamja v3 1/2] Don't mark messages as read when window is not in focus 1 year, 2 months ago

From sitting33 to ~emersion/public-inbox

---
 components/app.js | 72 +++++++++++++++++++++++++++++++----------------
 1 file changed, 48 insertions(+), 24 deletions(-)

diff --git a/components/app.js b/components/app.js
index 3987749..89f3ee6 100644
--- a/components/app.js
+++ b/components/app.js
@@ -228,6 +228,7 @@ export default class App extends Component {
		this.handleSettingsChange = this.handleSettingsChange.bind(this);
		this.handleSettingsDisconnect = this.handleSettingsDisconnect.bind(this);
		this.handleSwitchSubmit = this.handleSwitchSubmit.bind(this);
		this.handleDocumentFocus = this.handleDocumentFocus.bind(this);

[message trimmed]

Re: [PATCH v2 2/2] Show number of unread buffers or messages in title 1 year, 2 months ago

From to ~emersion/public-inbox

> On Saturday, June 24th, 2023 at 14:02, sitting33 <me@sit.sh> wrote:
> > ---
> > This adds the number of unread buffers or messages (configurable) into
> > the document title.
> > 
> >  components/app.js           | 98 ++++++++++++++++++++++++++++++++++---
> >  components/settings-form.js | 32 ++++++++++++
> >  state.js                    |  1 +
> >  3 files changed, 123 insertions(+), 8 deletions(-)
> > 
> > diff --git a/components/app.js b/components/app.js
> > index 5575527..ab174ce 100644
> > --- a/components/app.js
> > +++ b/components/app.js

Re: [PATCH v2 1/2] Don't mark messages as read when window is not in focus 1 year, 2 months ago

From to ~emersion/public-inbox

В письме от пятница, 7 июля 2023 г. 15:55:08 +03 пользователь Simon Ser 
написал:
> On Saturday, June 24th, 2023 at 14:02, sitting33 <me@sit.sh> wrote:
> > ---
> > I split the previous revision of the patch into two parts. The one
> > defers sending MARKREAD when the tab isn't focused. When it regains
> > focus, the currently active buffers gets marked as read.
> 
> Thanks, the meat of the patch looks good to me :)
> 
> > I had to extract a new method, markBufferAsRead, that is called in
> > switchBuffer and handleDocumentFocus. handleDocumentFocus calls it with
> > updatePrevReceipt = false, so that the divider in between read and
> > unread messages doesn't disappear when we focus the window twice.

Re: [PATCH v2 2/2] Show number of unread buffers or messages in title 1 year, 3 months ago

From sitting33 to ~emersion/public-inbox

Oops, I forgot to add that this patch is for gamja. Sorry!

[PATCH v2 2/2] Show number of unread buffers or messages in title 1 year, 3 months ago

From sitting33 to ~emersion/public-inbox

---
This adds the number of unread buffers or messages (configurable) into
the document title.

 components/app.js           | 98 ++++++++++++++++++++++++++++++++++---
 components/settings-form.js | 32 ++++++++++++
 state.js                    |  1 +
 3 files changed, 123 insertions(+), 8 deletions(-)

diff --git a/components/app.js b/components/app.js
index 5575527..ab174ce 100644
--- a/components/app.js
+++ b/components/app.js
@@ -570,6 +570,8 @@ export default class App extends Component {
[message trimmed]

[PATCH v2 1/2] Don't mark messages as read when window is not in focus 1 year, 3 months ago

From sitting33 to ~emersion/public-inbox

---
I split the previous revision of the patch into two parts. The one
defers sending MARKREAD when the tab isn't focused. When it regains
focus, the currently active buffers gets marked as read.

I had to extract a new method, markBufferAsRead, that is called in
switchBuffer and handleDocumentFocus. handleDocumentFocus calls it with
updatePrevReceipt = false, so that the divider in between read and
unread messages doesn't disappear when we focus the window twice.

 components/app.js | 77 +++++++++++++++++++++++++++++------------------
 1 file changed, 48 insertions(+), 29 deletions(-)

diff --git a/components/app.js b/components/app.js
[message trimmed]