From f66937134975de23f3de120f5e5019d011ba8750 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sun, 12 May 2024 06:58:01 -0400 Subject: [PATCH 1/2] Show tab names on large enough screens. Inspired by tasio's #61. --- apps/ssb.json | 2 +- apps/ssb/tf-app.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/ssb.json b/apps/ssb.json index fb77ab2e..634cec42 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🐌", - "previous": "&raSj7ozmSDNGmB6TtjDk7oOiTc33ZN+RrBMASJ2F4cA=.sha256" + "previous": "&cN1BLgsD5fU8QzkNbtKR/Ie1fO3miBq8FVSpgNqFbrc=.sha256" } diff --git a/apps/ssb/tf-app.js b/apps/ssb/tf-app.js index 6a121f45..89f054d0 100644 --- a/apps/ssb/tf-app.js +++ b/apps/ssb/tf-app.js @@ -345,13 +345,14 @@ class TfElement extends LitElement { ([k, v]) => html` ` )} From 9887a78e9890ef4055eddf396d25586fd4f1be66 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sun, 12 May 2024 07:48:34 -0400 Subject: [PATCH 2/2] prettier --- apps/admin/script.js | 33 +++++++++++++++++++++++++++------ apps/identity/app.js | 14 ++++++++------ apps/ssb/tf-app.js | 17 ++++++++++------- apps/ssb/tf-compose.js | 10 +++++++--- apps/ssb/tf-message.js | 4 +--- apps/ssb/tf-tab-connections.js | 28 +++++++++++++++++++--------- apps/ssb/tf-tab-news.js | 16 ++++++++++------ 7 files changed, 82 insertions(+), 40 deletions(-) diff --git a/apps/admin/script.js b/apps/admin/script.js index b75f178b..74466acb 100644 --- a/apps/admin/script.js +++ b/apps/admin/script.js @@ -42,10 +42,27 @@ window.addEventListener('load', function () { } else if (description.type === 'textarea') { return html`
  • - +
    ${description.description}
    - - + +
  • `; } else { @@ -61,13 +78,17 @@ window.addEventListener('load', function () { } const user_template = (user, permissions) => html`
  • - + ${user}: ${permissions.map((x) => permission_template(x))}
  • `; const users_template = (users) => - html` -

    Users

    + html`

    Users

    `; diff --git a/apps/identity/app.js b/apps/identity/app.js index aa577b73..6ed964af 100644 --- a/apps/identity/app.js +++ b/apps/identity/app.js @@ -116,16 +116,18 @@ async function main() {

    Identities

      ` + - ids - .map( - (id) => `
    • + ids + .map( + ( + id + ) => `
    • ${id}
    • ` - ) - .join('\n') + - `
    + ) + .join('\n') + + `
    ` ); diff --git a/apps/ssb/tf-app.js b/apps/ssb/tf-app.js index 89f054d0..b32b6241 100644 --- a/apps/ssb/tf-app.js +++ b/apps/ssb/tf-app.js @@ -345,14 +345,15 @@ class TfElement extends LitElement { ([k, v]) => html` ` )} @@ -360,10 +361,12 @@ class TfElement extends LitElement { `; let contents = !this.loaded ? this.loading - ? html`
    - Loading... -
    - ${this.render_tab()}` + ? html`
    + Loading... +
    + ${this.render_tab()}` : html`
    Select or create an identity.
    ` : this.render_tab(); return html` diff --git a/apps/ssb/tf-compose.js b/apps/ssb/tf-compose.js index 3cdbbdfe..77da43ef 100644 --- a/apps/ssb/tf-compose.js +++ b/apps/ssb/tf-compose.js @@ -295,14 +295,18 @@ class TfComposeElement extends LitElement { { values: values, selectTemplate: function (item) { - return item ? `[@${item.original.key}](${item.original.value})` : undefined; + return item + ? `[@${item.original.key}](${item.original.value})` + : undefined; }, }, { trigger: '&', values: this.autocomplete, selectTemplate: function (item) { - return item ? `![${item.original.key}](${item.original.value})` : undefined; + return item + ? `![${item.original.key}](${item.original.value})` + : undefined; }, }, ], @@ -544,7 +548,7 @@ class TfComposeElement extends LitElement { @paste=${this.paste} contenteditable .innerText=${live(draft.text ?? '')} - > + >
    ${content_warning} diff --git a/apps/ssb/tf-message.js b/apps/ssb/tf-message.js index 731f0430..ffbab1cf 100644 --- a/apps/ssb/tf-message.js +++ b/apps/ssb/tf-message.js @@ -247,9 +247,7 @@ ${JSON.stringify(mention, null, 2)} +
    Mentions ${mentions.map((x) => self.render_mention(x))}
    diff --git a/apps/ssb/tf-tab-connections.js b/apps/ssb/tf-tab-connections.js index 4b23dad6..05f9841c 100644 --- a/apps/ssb/tf-tab-connections.js +++ b/apps/ssb/tf-tab-connections.js @@ -116,9 +116,15 @@ class TfTabConnectionsElement extends LitElement { ${connection.tunnel !== undefined ? '🚇' : html`(${connection.host}:${connection.port})`} -
    ${connection.requests.map(x => html` - ${x.request_number > 0 ? '🟩' : 'đŸŸĨ'} ${x.name} - `)}
    +
    + ${connection.requests.map( + (x) => html` + ${x.request_number > 0 ? '🟩' : 'đŸŸĨ'} ${x.name} + ` + )} +
      ${this.connections .filter((x) => x.tunnel === this.connections.indexOf(connection)) @@ -187,12 +193,16 @@ class TfTabConnectionsElement extends LitElement { ${this.identities.map( (x) => html`
    • - ${x == this.server_identity ? - html`đŸ–Ĩ local server` : - undefined} - ${this.my_identities.indexOf(x) != -1 ? - html`😎 you` : - undefined} + ${x == this.server_identity + ? html`đŸ–Ĩ local server` + : undefined} + ${this.my_identities.indexOf(x) != -1 + ? html`😎 you` + : undefined}
    • ` )} diff --git a/apps/ssb/tf-tab-news.js b/apps/ssb/tf-tab-news.js index bab29339..b2d50b59 100644 --- a/apps/ssb/tf-tab-news.js +++ b/apps/ssb/tf-tab-news.js @@ -115,13 +115,17 @@ class TfTabNewsElement extends LitElement { >` : undefined; let edit_profile; - if (!this.loading && + if ( + !this.loading && this.users[this.whoami]?.name === undefined && - this.hash.substring(1) != this.whoami) { - edit_profile = html` -
      - ℹī¸ Follow your identity link ☝ī¸ above to edit your profile and set your name. -
      `; + this.hash.substring(1) != this.whoami + ) { + edit_profile = html`
      + ℹī¸ Follow your identity link ☝ī¸ above to edit your profile and set your + name. +
      `; } return html`