Radish alpha
r
rad:z4D5UCArafTzTQpDZNQRuqswh3ury
Radicle desktop app
Radicle
Git
Move comment explainer into textarea placeholder
Open did:key:z6MkkfM3...sVz5 opened 1 year ago
5 files changed +8 -19 31b2d9a9 18743ee6
modified src/components/Comment.svelte
@@ -194,7 +194,7 @@
            borderVariant="ghost"
            submitInProgress={state === "submit"}
            submitCaption="Save"
-
            placeholder="Leave a comment"
+
            placeholder={`Leave a comment, Markdown is supported. Press ${utils.modifierKey()}↵ to submit. Drag and drop files.`}
            submit={async ({ comment, embeds }) => {
              state = "submit";
              try {
modified src/components/CommentToggleInput.svelte
@@ -7,6 +7,7 @@
  interface Props {
    rid: string;
    placeholder?: string;
+
    expandedPlaceholder?: string;
    focus?: boolean;
    submit: (comment: string, embeds: Embed[]) => Promise<void>;
    onclose?: () => void;
@@ -18,6 +19,7 @@
  let {
    rid,
    placeholder,
+
    expandedPlaceholder,
    focus = false,
    submit,
    onclose,
@@ -45,7 +47,7 @@
  <ExtendedTextarea
    {disallowEmptyBody}
    {rid}
-
    {placeholder}
+
    placeholder={expandedPlaceholder}
    submitInProgress={state === "submit"}
    {focus}
    stylePadding="0.5rem 0.75rem"
modified src/components/Discussion.svelte
@@ -9,7 +9,7 @@
  import { tick } from "svelte";

  import * as roles from "@app/lib/roles";
-
  import { scrollIntoView } from "@app/lib/utils";
+
  import { modifierKey, scrollIntoView } from "@app/lib/utils";

  import CommentToggleInput from "@app/components/CommentToggleInput.svelte";
  import Icon from "@app/components/Icon.svelte";
@@ -160,6 +160,7 @@
              topLevelReplyOpen = false;
            }
          : undefined}
+
        expandedPlaceholder={`Leave a comment, Markdown is supported. Press ${modifierKey()}↵ to submit. Drag and drop files.`}
        placeholder="Leave a comment"
        submit={createComment} />
    </div>
modified src/components/ExtendedTextarea.svelte
@@ -2,8 +2,6 @@
  import type { UnlistenFn } from "@tauri-apps/api/event";
  import type { ComponentProps } from "svelte";

-
  import * as utils from "@app/lib/utils";
-

  import type { Embed } from "@bindings/cob/thread/Embed";
  import { invoke } from "@app/lib/invoke";
  import { listen } from "@tauri-apps/api/event";
@@ -272,18 +270,6 @@
      <Icon name="cross" />
      <span class="global-hide-on-small-desktop-down">Discard</span>
    </OutlineButton>
-
    {#if !preview}
-
      <div
-
        class="txt-overflow txt-small txt-missing"
-
        title={`Drag and drop files to add them. Markdown is supported. Press ${utils.modifierKey()}↵ to submit.`}>
-
        Drag and drop files to add them.
-
        <Icon
-
          name="markdown"
-
          styleDisplay="inline"
-
          styleVerticalAlign="text-top" />
-
        Markdown is supported. Press {utils.modifierKey()}↵ to submit.
-
      </div>
-
    {/if}
    <div class="buttons">
      <OutlineButton variant="ghost" onclick={selectFiles} disabled={preview}>
        <Icon name="attachment" />
modified src/components/Thread.svelte
@@ -6,7 +6,7 @@
  import { tick } from "svelte";
  import partial from "lodash/partial";

-
  import { scrollIntoView } from "@app/lib/utils";
+
  import { modifierKey, scrollIntoView } from "@app/lib/utils";

  import Border from "./Border.svelte";
  import CommentComponent from "@app/components/Comment.svelte";
@@ -145,7 +145,7 @@
              {submitInProgress}
              {rid}
              inline
-
              placeholder="Reply to comment"
+
              placeholder={`Reply to comment, Markdown is supported. Press ${modifierKey()}↵ to submit. Drag and drop files.`}
              submitCaption="Reply"
              focus
              stylePadding="0.5rem 0.75rem"