Skip to content

Commit

Permalink
Update docs, add /chores-prune and /hearts-prune, clean up UI
Browse files Browse the repository at this point in the history
  • Loading branch information
kronosapiens committed Feb 3, 2025
1 parent 230130f commit fb3dd50
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .manifest/chores-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ features:
url: https://zaratan.ngrok.io/slack/events
description: Use the current channel for app events
should_escape: false
- command: /chores-sync
- command: /chores-prune
url: https://zaratan.ngrok.io/slack/events
description: Sync active residents
description: Prune nonexistent residents
should_escape: false
- command: /chores-stats
url: https://zaratan.ngrok.io/slack/events
Expand Down
4 changes: 2 additions & 2 deletions .manifest/chores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ features:
url: https://chores.mirror.zaratan.world/slack/events
description: Use the current channel for app events
should_escape: false
- command: /chores-sync
- command: /chores-prune
url: https://chores.mirror.zaratan.world/slack/events
description: Sync active residents
description: Prune nonexistent residents
should_escape: false
- command: /chores-stats
url: https://chores.mirror.zaratan.world/slack/events
Expand Down
3 changes: 3 additions & 0 deletions .manifest/hearts-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ features:
- command: /hearts-channel
url: https://zaratan.ngrok.io/slack/events
description: Use the current channel for app events
- command: /hearts-prune
url: https://zaratan.ngrok.io/slack/events
description: Prune nonexistent residents
- command: /hearts-sync
url: https://zaratan.ngrok.io/slack/events
description: Sync workspace members or channels
Expand Down
3 changes: 3 additions & 0 deletions .manifest/hearts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ features:
- command: /hearts-channel
url: https://hearts.mirror.zaratan.world/slack/events
description: Use the current channel for app events
- command: /hearts-prune
url: https://hearts.mirror.zaratan.world/slack/events
description: Prune nonexistent residents
- command: /hearts-sync
url: https://hearts.mirror.zaratan.world/slack/events
description: Sync workspace members or channels
Expand Down
22 changes: 14 additions & 8 deletions docs/tools/chores.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ Quickstart
----------

1. Set an app events channel
2. Make a list of 3-5 starter chores/descriptions: dishes, sweeping, etc
3. Enter the chores using ``Edit Chores List``, and upvote them in the app channel
4. Wait 1-2 days for the chores to accumulate points
5. Encourage people to check current chore values and to ``Claim a Chore`` which is fairly-valued
6. Encourage people to ``Set Priorities`` if they feel that a chore is being over/under valued
2. Activate all participating users
3. Make a list of 3-5 starter chores/descriptions: dishes, sweeping, etc
4. Enter the chores using ``Edit Chores List``, and upvote them in the app channel
5. Wait 1-2 days for the chores to accumulate points
6. Encourage people to check current chore values and to ``Claim a Chore`` which is fairly-valued
7. Encourage people to ``Set Priorities`` if they feel that a chore is being over/under valued

Introduction
------------
Expand Down Expand Up @@ -223,14 +224,19 @@ Most people will not need to know about these commands to use Chores.

A channel **must** be set for the app to work.

``/chores-activate`` \*
The ``/chores-activate`` command is used by workspace administrators to "activate" users.
Workspace members are deactive by default, and must be activated to participate in chores.
An active user can claim chores, vote on claims, take breaks, and gift points.

``/chores-reset`` \*
The ``/chores-reset`` command is used to reset chore points.
All chores will be worth 0 points, all users will have 0 points, and all users will owe points as if they had just joined the workspace.
The chore list and chore priorities will not be affected.

``/chores-sync``
The ``/chores-sync`` command will update the app with the current active users in the workspace, adding any new users and removing any who have been deactivated.
The app will normally keep itself synchronized in the background, but this command can be used to force a sync if necessary.
``/chores-prune``
The ``/chores-prune`` command will deactivate any users no longer in the workspace.
The app will normally prune users in the background, but this command can force a sync if necessary.

Case Studies
------------
Expand Down
11 changes: 5 additions & 6 deletions docs/tools/hearts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,9 @@ Most people will not need to know about these commands to use Hearts.

A channel **must** be set for the app to work.

``/hearts-sync``
The ``/hearts-sync`` command will update the app with the current active users in the workspace, adding any new users and removing any who have been deactivated.
The app will normally keep itself synchronized in the background, but this command can be used to force a sync if necessary.

.. tip::
``/hearts-prune``
The ``/hearts-prune`` command will deactivate any users no longer in the workspace.
The app will normally prune users in the background, but this command can force a sync if necessary.

Passing the argument `channels` will sync the Hearts app to all public channels, allowing people to give karma in those channels.
``/hearts-sync``
The ``/hearts-sync`` command will sync the Hearts app to all public channels, allowing people to give karma in those channels.
7 changes: 5 additions & 2 deletions src/bolt/chores.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ app.event('app_home_opened', async ({ body, event }) => {
}
}

// Prune workspace
await common.pruneWorkspaceMembers(app, choresConf.oauth, houseId, now);

// Post house stats
const prevMonthEnd = getPrevMonthEnd(now);
const prevMonthStart = getMonthStart(prevMonthEnd);
Expand All @@ -151,8 +154,8 @@ app.event('app_home_opened', async ({ body, event }) => {

// Slash commands

app.command('/chores-sync', async ({ ack, command }) => {
const commandName = '/chores-sync';
app.command('/chores-prune', async ({ ack, command }) => {
const commandName = '/chores-prune';
const { now, houseId } = common.beginCommand(commandName, command);

const text = await common.pruneWorkspaceMembers(app, choresConf.oauth, houseId, now);
Expand Down
2 changes: 1 addition & 1 deletion src/bolt/chores.views.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ exports.choresActivateView = function (residents) {
true,
));
blocks.push(common.blockInput(
'Update ~selected~ residents',
'or, Update ~selected~ residents',
{
action_id: 'residents',
type: 'multi_conversations_select',
Expand Down
15 changes: 11 additions & 4 deletions src/bolt/hearts.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,19 @@ app.command('/hearts-sync', async ({ ack, command }) => {
await ack();

const commandName = '/hearts-sync';
const { now, houseId } = common.beginCommand(commandName, command);
common.beginCommand(commandName, command);

const text = await common.syncWorkspaceChannels(app, heartsConf.oauth);
await common.replyEphemeral(app, heartsConf.oauth, command, text);
});

app.command('/hearts-prune', async ({ ack, command }) => {
await ack();

const text = (command.text === 'channels')
? await common.syncWorkspaceChannels(app, heartsConf.oauth)
: await common.pruneWorkspaceMembers(app, heartsConf.oauth, houseId, now);
const commandName = '/hearts-prune';
const { now, houseId } = common.beginCommand(commandName, command);

const text = await common.pruneWorkspaceMembers(app, heartsConf.oauth, houseId, now);
await common.replyEphemeral(app, heartsConf.oauth, command, text);
});

Expand Down

0 comments on commit fb3dd50

Please sign in to comment.