The task modal reads as a view, editing is a state you enter
Browse files at this commit293a3a045bf9278f11b87367a3468a09b3cc4146Parent: 2fa2cc8- feat
- the task modal reads as a view, editing is a state you enter
4 changed files +1136 -343
- crates/dizey-core/src/store/turso_store.rs +7 -2
- crates/dizey-web/src/board.rs +4 -2
- crates/dizey-web/src/detail.rs +653 -200
- style/main.scss +472 -139
crates/dizey-core/src/store/turso_store.rsmodified+7 -2
| @@ -1640,16 +1640,21 @@ impl DetailReads for TursoStore { | ||
| 1640 | 1640 | |
| 1641 | 1641 | async fn dependencies_for_task(&self, task_id: &str) -> Result<Vec<(bool, DependencyEdge)>> { |
| 1642 | 1642 | // Both directions in one round trip: the leading column says which. |
| 1643 | + // `cleared_at` is only ever set by an unlink, so a cleared row is not a | |
| 1644 | + // link any more and does not belong on the screen. A link whose blocker | |
| 1645 | + // is finished still shows — that is `done_at`, and it reads as cleared. | |
| 1643 | 1646 | let mut rows = self |
| 1644 | 1647 | .conn |
| 1645 | 1648 | .query( |
| 1646 | 1649 | "SELECT 1, t.id, t.task_key, t.title, d.cleared_at, t.done_at \ |
| 1647 | 1650 | FROM task_dependency d JOIN task t ON t.id = d.blocking_task_id \ |
| 1648 | - WHERE d.blocked_task_id = ?1 AND t.deleted_at IS NULL \ | |
| 1651 | + WHERE d.blocked_task_id = ?1 AND d.cleared_at IS NULL \ | |
| 1652 | + AND t.deleted_at IS NULL \ | |
| 1649 | 1653 | UNION ALL \ |
| 1650 | 1654 | SELECT 0, t.id, t.task_key, t.title, d.cleared_at, t.done_at \ |
| 1651 | 1655 | FROM task_dependency d JOIN task t ON t.id = d.blocked_task_id \ |
| 1652 | - WHERE d.blocking_task_id = ?2 AND t.deleted_at IS NULL", | |
| 1656 | + WHERE d.blocking_task_id = ?2 AND d.cleared_at IS NULL \ | |
| 1657 | + AND t.deleted_at IS NULL", | |
| 1653 | 1658 | params![task_id, task_id], |
| 1654 | 1659 | ) |
| 1655 | 1660 | .await |
crates/dizey-web/src/board.rsmodified+4 -2
| @@ -533,8 +533,10 @@ fn Card( | ||
| 533 | 533 | } |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | +/// A person as a circle. `extra` carries the size the surface wants — the | |
| 537 | +/// board's own 22px is the default, the modal asks for its 18px and 28px. | |
| 536 | 538 | #[component] |
| 537 | -fn Avatar(person: Person) -> impl IntoView { | |
| 539 | +pub(crate) fn Avatar(person: Person, #[prop(optional)] extra: &'static str) -> impl IntoView { | |
| 538 | 540 | let initials = person.initials(); |
| 539 | 541 | // Five tones from the mockups' palette, picked from the id so a person |
| 540 | 542 | // keeps the same one wherever they appear. |
| @@ -544,7 +546,7 @@ fn Avatar(person: Person) -> impl IntoView { | ||
| 544 | 546 | .fold(0u32, |acc, b| acc.wrapping_mul(31).wrapping_add(b as u32)) |
| 545 | 547 | % 5; |
| 546 | 548 | view! { |
| 547 | - <span class=format!("avatar avatar-tone-{tone}") title=person.display_name.clone()> | |
| 549 | + <span class=format!("avatar avatar-tone-{tone} {extra}") title=person.display_name.clone()> | |
| 548 | 550 | {initials} |
| 549 | 551 | </span> |
| 550 | 552 | } |
crates/dizey-web/src/detail.rsmodified+653 -200
| @@ -14,6 +14,7 @@ use serde::{Deserialize, Serialize}; | ||
| 14 | 14 | use time::Date; |
| 15 | 15 | |
| 16 | 16 | use crate::auth::{Me, Refusal}; |
| 17 | +use crate::board::Avatar; | |
| 17 | 18 | |
| 18 | 19 | /// A task this board could be linked to: enough to name it in the picker and |
| 19 | 20 | /// nothing more. |
| @@ -101,13 +102,16 @@ pub async fn fetch_task(task_id: String) -> Result<Result<DetailSnapshot, Refusa | ||
| 101 | 102 | }; |
| 102 | 103 | |
| 103 | 104 | // What the picker may offer: this board's other tasks, minus the ones |
| 104 | - // already on either end of a link with this one. | |
| 105 | + // already on either end of a live link with this one. A cleared edge is | |
| 106 | + // not a link any more, so its task comes back to the picker — the store's | |
| 107 | + // upsert revives that row rather than duplicating it. | |
| 105 | 108 | let mut linkable = Vec::new(); |
| 106 | 109 | if let Some(board) = store.board(&user.workspace_id).await.map_err(fail)? { |
| 107 | 110 | let taken: Vec<&str> = detail |
| 108 | 111 | .blocked_by |
| 109 | 112 | .iter() |
| 110 | 113 | .chain(detail.blocks.iter()) |
| 114 | + .filter(|edge| edge.cleared_at.is_none()) | |
| 111 | 115 | .map(|edge| edge.task_id.as_str()) |
| 112 | 116 | .collect(); |
| 113 | 117 | for task in store.tasks_for_board(&board.id).await.map_err(fail)? { |
| @@ -145,30 +149,50 @@ pub async fn fetch_task(task_id: String) -> Result<Result<DetailSnapshot, Refusa | ||
| 145 | 149 | |
| 146 | 150 | /// Saves the title, the description and the deadline. Status is not here: the |
| 147 | 151 | /// column a task sits in is changed by moving it, which is the next slice. |
| 152 | +/// Saves one region of the task, and leaves the rest of it alone. | |
| 153 | +/// | |
| 154 | +/// Each field arrives only from the editor that was open, so a person fixing | |
| 155 | +/// a deadline cannot silently write back the description as it looked when | |
| 156 | +/// they opened the modal — the fields nobody edited are read from the store, | |
| 157 | +/// not from a hidden input carrying a stale copy. | |
| 148 | 158 | #[server] |
| 149 | 159 | pub async fn save_task( |
| 150 | 160 | task_id: String, |
| 151 | - title: String, | |
| 152 | - description: String, | |
| 153 | - deadline: String, | |
| 161 | + title: Option<String>, | |
| 162 | + description: Option<String>, | |
| 163 | + deadline: Option<String>, | |
| 154 | 164 | ) -> Result<Option<Refusal>, ServerFnError> { |
| 155 | 165 | use crate::server::accounts; |
| 156 | 166 | use time::OffsetDateTime; |
| 157 | 167 | use time::macros::format_description; |
| 158 | 168 | |
| 159 | - let (user, _) = match guard::writer_and_task(&task_id).await { | |
| 169 | + let (user, facts) = match guard::writer_and_task(&task_id).await { | |
| 160 | 170 | Ok(pair) => pair, |
| 161 | 171 | Err(refusal) => return Ok(Some(refusal)), |
| 162 | 172 | }; |
| 163 | - let title = title.trim().to_string(); | |
| 164 | - if title.is_empty() { | |
| 165 | - return Ok(Some(Refusal::EmptyTitle)); | |
| 166 | - } | |
| 167 | - let deadline = match deadline.trim() { | |
| 168 | - "" => None, | |
| 169 | - raw => match Date::parse(raw, format_description!("[year]-[month]-[day]")) { | |
| 170 | - Ok(day) => Some(day), | |
| 171 | - Err(_) => return Ok(Some(Refusal::BadDeadline)), | |
| 173 | + | |
| 174 | + let title = match title { | |
| 175 | + Some(given) => { | |
| 176 | + let trimmed = given.trim().to_string(); | |
| 177 | + if trimmed.is_empty() { | |
| 178 | + return Ok(Some(Refusal::EmptyTitle)); | |
| 179 | + } | |
| 180 | + trimmed | |
| 181 | + } | |
| 182 | + None => facts.row.title.clone(), | |
| 183 | + }; | |
| 184 | + let description = match &description { | |
| 185 | + Some(given) => given.trim().to_string(), | |
| 186 | + None => facts.description.clone(), | |
| 187 | + }; | |
| 188 | + let deadline = match deadline.as_deref() { | |
| 189 | + None => facts.row.deadline, | |
| 190 | + Some(raw) => match raw.trim() { | |
| 191 | + "" => None, | |
| 192 | + day => match Date::parse(day, format_description!("[year]-[month]-[day]")) { | |
| 193 | + Ok(day) => Some(day), | |
| 194 | + Err(_) => return Ok(Some(Refusal::BadDeadline)), | |
| 195 | + }, | |
| 172 | 196 | }, |
| 173 | 197 | }; |
| 174 | 198 | |
| @@ -177,7 +201,7 @@ pub async fn save_task( | ||
| 177 | 201 | .save_task( |
| 178 | 202 | &task_id, |
| 179 | 203 | &title, |
| 180 | - description.trim(), | |
| 204 | + &description, | |
| 181 | 205 | deadline, |
| 182 | 206 | &user.id, |
| 183 | 207 | OffsetDateTime::now_utc(), |
| @@ -503,6 +527,7 @@ fn StatusControl( | ||
| 503 | 527 | }) |
| 504 | 528 | .collect_view()} |
| 505 | 529 | </select> |
| 530 | + {glyph::chevron()} | |
| 506 | 531 | <Show when=move || !live.get()> |
| 507 | 532 | <button class="status-go" type="submit"> |
| 508 | 533 | "Move" |
| @@ -602,6 +627,501 @@ pub fn TaskDetailModal( | ||
| 602 | 627 | } |
| 603 | 628 | } |
| 604 | 629 | |
| 630 | +/// The artboard's glyphs, drawn rather than typed. A missing character in a | |
| 631 | +/// font is a hole in the design; an inline path is the same shape everywhere. | |
| 632 | +mod glyph { | |
| 633 | + use leptos::prelude::*; | |
| 634 | + | |
| 635 | + pub fn chevron() -> impl IntoView { | |
| 636 | + view! { | |
| 637 | + <svg | |
| 638 | + class="glyph" | |
| 639 | + width="14" | |
| 640 | + height="14" | |
| 641 | + viewBox="0 0 16 16" | |
| 642 | + fill="none" | |
| 643 | + stroke="currentColor" | |
| 644 | + stroke-width="1.5" | |
| 645 | + stroke-linecap="round" | |
| 646 | + stroke-linejoin="round" | |
| 647 | + aria-hidden="true" | |
| 648 | + > | |
| 649 | + <path d="M4 6l4 4 4-4"></path> | |
| 650 | + </svg> | |
| 651 | + } | |
| 652 | + } | |
| 653 | + | |
| 654 | + pub fn calendar() -> impl IntoView { | |
| 655 | + view! { | |
| 656 | + <svg | |
| 657 | + class="glyph" | |
| 658 | + width="13" | |
| 659 | + height="13" | |
| 660 | + viewBox="0 0 16 16" | |
| 661 | + fill="none" | |
| 662 | + stroke="currentColor" | |
| 663 | + stroke-width="1.5" | |
| 664 | + stroke-linecap="round" | |
| 665 | + aria-hidden="true" | |
| 666 | + > | |
| 667 | + <rect x="2.5" y="3.5" width="11" height="10" rx="1.5"></rect> | |
| 668 | + <path d="M2.5 6.5h11M5.5 2v2.5M10.5 2v2.5"></path> | |
| 669 | + </svg> | |
| 670 | + } | |
| 671 | + } | |
| 672 | + | |
| 673 | + pub fn plus() -> impl IntoView { | |
| 674 | + view! { | |
| 675 | + <svg | |
| 676 | + class="glyph" | |
| 677 | + width="12" | |
| 678 | + height="12" | |
| 679 | + viewBox="0 0 16 16" | |
| 680 | + fill="none" | |
| 681 | + stroke="currentColor" | |
| 682 | + stroke-width="1.6" | |
| 683 | + stroke-linecap="round" | |
| 684 | + aria-hidden="true" | |
| 685 | + > | |
| 686 | + <path d="M8 3v10M3 8h10"></path> | |
| 687 | + </svg> | |
| 688 | + } | |
| 689 | + } | |
| 690 | + | |
| 691 | + pub fn cross() -> impl IntoView { | |
| 692 | + view! { | |
| 693 | + <svg | |
| 694 | + class="glyph" | |
| 695 | + width="13" | |
| 696 | + height="13" | |
| 697 | + viewBox="0 0 16 16" | |
| 698 | + fill="none" | |
| 699 | + stroke="currentColor" | |
| 700 | + stroke-width="1.5" | |
| 701 | + stroke-linecap="round" | |
| 702 | + aria-hidden="true" | |
| 703 | + > | |
| 704 | + <path d="M4 4l8 8M12 4l-8 8"></path> | |
| 705 | + </svg> | |
| 706 | + } | |
| 707 | + } | |
| 708 | + | |
| 709 | + pub fn tick() -> impl IntoView { | |
| 710 | + view! { | |
| 711 | + <svg | |
| 712 | + class="glyph dep-tick" | |
| 713 | + width="14" | |
| 714 | + height="14" | |
| 715 | + viewBox="0 0 16 16" | |
| 716 | + fill="none" | |
| 717 | + stroke="currentColor" | |
| 718 | + stroke-width="1.8" | |
| 719 | + stroke-linecap="round" | |
| 720 | + stroke-linejoin="round" | |
| 721 | + aria-hidden="true" | |
| 722 | + > | |
| 723 | + <path d="M3 8.5l3.5 3.5L13 5"></path> | |
| 724 | + </svg> | |
| 725 | + } | |
| 726 | + } | |
| 727 | + | |
| 728 | + pub fn lock() -> impl IntoView { | |
| 729 | + view! { | |
| 730 | + <svg | |
| 731 | + class="glyph" | |
| 732 | + width="14" | |
| 733 | + height="14" | |
| 734 | + viewBox="0 0 16 16" | |
| 735 | + fill="none" | |
| 736 | + stroke="currentColor" | |
| 737 | + stroke-width="1.6" | |
| 738 | + stroke-linecap="round" | |
| 739 | + stroke-linejoin="round" | |
| 740 | + aria-hidden="true" | |
| 741 | + > | |
| 742 | + <rect x="3.5" y="7" width="9" height="6.5" rx="1.5"></rect> | |
| 743 | + <path d="M5.5 7V5a2.5 2.5 0 015 0v2"></path> | |
| 744 | + </svg> | |
| 745 | + } | |
| 746 | + } | |
| 747 | + | |
| 748 | + pub fn bin() -> impl IntoView { | |
| 749 | + view! { | |
| 750 | + <svg | |
| 751 | + class="glyph" | |
| 752 | + width="14" | |
| 753 | + height="14" | |
| 754 | + viewBox="0 0 16 16" | |
| 755 | + fill="none" | |
| 756 | + stroke="currentColor" | |
| 757 | + stroke-width="1.5" | |
| 758 | + stroke-linecap="round" | |
| 759 | + stroke-linejoin="round" | |
| 760 | + aria-hidden="true" | |
| 761 | + > | |
| 762 | + <path d="M3 4.5h10M6.5 4.5V3h3v1.5M4.5 4.5l0.7 8.5a1 1 0 001 0.9h3.6a1 1 0 001-0.9l0.7-8.5"></path> | |
| 763 | + </svg> | |
| 764 | + } | |
| 765 | + } | |
| 766 | +} | |
| 767 | + | |
| 768 | +/// The title, as the artboard draws it: the heading itself, with the rename | |
| 769 | +/// hidden behind it. | |
| 770 | +/// | |
| 771 | +/// Editing is a state the screen enters, not a second field sitting beside the | |
| 772 | +/// first. The checkbox is the state — it is what a click on the heading flips, | |
| 773 | +/// what Cancel flips back, and it needs no script to do either. The heading and | |
| 774 | +/// the input are never on screen together. | |
| 775 | +#[component] | |
| 776 | +fn TitleControl( | |
| 777 | + task_id: StoredValue<String>, | |
| 778 | + title: String, | |
| 779 | + may_write: bool, | |
| 780 | + on_change: impl Fn() + Copy + Send + Sync + 'static, | |
| 781 | +) -> impl IntoView { | |
| 782 | + if !may_write { | |
| 783 | + return Either::Left(view! { <h2 class="detail-title">{title}</h2> }); | |
| 784 | + } | |
| 785 | + let action = ServerAction::<SaveTask>::new(); | |
| 786 | + let value = action.value(); | |
| 787 | + Effect::new(move |_| { | |
| 788 | + if matches!(value.get(), Some(Ok(None))) { | |
| 789 | + on_change(); | |
| 790 | + } | |
| 791 | + }); | |
| 792 | + let toggle = format!("rename-{}", task_id.get_value()); | |
| 793 | + let field = title.clone(); | |
| 794 | + | |
| 795 | + Either::Right(view! { | |
| 796 | + <div class="edit"> | |
| 797 | + <input | |
| 798 | + class="edit-toggle" | |
| 799 | + type="checkbox" | |
| 800 | + id=toggle.clone() | |
| 801 | + aria-label="Rename this task" | |
| 802 | + /> | |
| 803 | + <h2 class="detail-title edit-view"> | |
| 804 | + <label class="edit-hit" for=toggle.clone()> | |
| 805 | + {title} | |
| 806 | + </label> | |
| 807 | + </h2> | |
| 808 | + <ActionForm action=action attr:class="edit-form title-form"> | |
| 809 | + <input type="hidden" name="task_id" value=move || task_id.get_value()/> | |
| 810 | + <input | |
| 811 | + class="title-input" | |
| 812 | + type="text" | |
| 813 | + name="title" | |
| 814 | + value=field | |
| 815 | + autocomplete="off" | |
| 816 | + required | |
| 817 | + /> | |
| 818 | + <button class="edit-save" type="submit" disabled=move || action.pending().get()> | |
| 819 | + "Save" | |
| 820 | + </button> | |
| 821 | + <label class="edit-cancel" for=toggle> | |
| 822 | + "Cancel" | |
| 823 | + </label> | |
| 824 | + </ActionForm> | |
| 825 | + {refused(action)} | |
| 826 | + </div> | |
| 827 | + }) | |
| 828 | +} | |
| 829 | + | |
| 830 | +/// The description as prose, with the textarea behind it. | |
| 831 | +/// | |
| 832 | +/// Clicking the prose swaps this region and only this region. Nothing else on | |
| 833 | +/// the screen moves, and the rest of the task is not carried along in hidden | |
| 834 | +/// inputs — the save names the description alone. | |
| 835 | +#[component] | |
| 836 | +fn DescriptionControl( | |
| 837 | + task_id: StoredValue<String>, | |
| 838 | + description: String, | |
| 839 | + may_write: bool, | |
| 840 | + on_change: impl Fn() + Copy + Send + Sync + 'static, | |
| 841 | +) -> impl IntoView { | |
| 842 | + let empty = description.trim().is_empty(); | |
| 843 | + let prose = if empty { | |
| 844 | + "No description yet.".to_string() | |
| 845 | + } else { | |
| 846 | + description.clone() | |
| 847 | + }; | |
| 848 | + | |
| 849 | + if !may_write { | |
| 850 | + return Either::Left( | |
| 851 | + view! { <p class="detail-prose" class:detail-prose-empty=empty>{prose}</p> }, | |
| 852 | + ); | |
| 853 | + } | |
| 854 | + let action = ServerAction::<SaveTask>::new(); | |
| 855 | + let value = action.value(); | |
| 856 | + Effect::new(move |_| { | |
| 857 | + if matches!(value.get(), Some(Ok(None))) { | |
| 858 | + on_change(); | |
| 859 | + } | |
| 860 | + }); | |
| 861 | + let toggle = format!("describe-{}", task_id.get_value()); | |
| 862 | + let field = description.clone(); | |
| 863 | + | |
| 864 | + Either::Right(view! { | |
| 865 | + <div class="edit"> | |
| 866 | + <input | |
| 867 | + class="edit-toggle" | |
| 868 | + type="checkbox" | |
| 869 | + id=toggle.clone() | |
| 870 | + aria-label="Edit the description" | |
| 871 | + /> | |
| 872 | + <label class="detail-prose edit-view edit-hit" class:detail-prose-empty=empty for=toggle.clone()> | |
| 873 | + {prose} | |
| 874 | + </label> | |
| 875 | + <ActionForm action=action attr:class="edit-form describe-form"> | |
| 876 | + <input type="hidden" name="task_id" value=move || task_id.get_value()/> | |
| 877 | + <textarea class="detail-textarea" name="description" rows="5" prop:value=field.clone()> | |
| 878 | + {field.clone()} | |
| 879 | + </textarea> | |
| 880 | + <div class="edit-row"> | |
| 881 | + <button class="edit-save" type="submit" disabled=move || action.pending().get()> | |
| 882 | + "Save" | |
| 883 | + </button> | |
| 884 | + <label class="edit-cancel" for=toggle> | |
| 885 | + "Cancel" | |
| 886 | + </label> | |
| 887 | + </div> | |
| 888 | + </ActionForm> | |
| 889 | + {refused(action)} | |
| 890 | + </div> | |
| 891 | + }) | |
| 892 | +} | |
| 893 | + | |
| 894 | +/// One deadline control: the artboard's calendar glyph, the date as a person | |
| 895 | +/// reads it, and the chevron. The picker is what opens when it is clicked — | |
| 896 | +/// there is no second DEADLINE row further down the screen. | |
| 897 | +#[component] | |
| 898 | +fn DeadlineControl( | |
| 899 | + task_id: StoredValue<String>, | |
| 900 | + deadline_label: String, | |
| 901 | + deadline_input: String, | |
| 902 | + overdue: bool, | |
| 903 | + may_write: bool, | |
| 904 | + on_change: impl Fn() + Copy + Send + Sync + 'static, | |
| 905 | +) -> impl IntoView { | |
| 906 | + if !may_write { | |
| 907 | + return Either::Left( | |
| 908 | + view! { | |
| 909 | + <span class="field-box" class:detail-overdue=overdue> | |
| 910 | + {glyph::calendar()} | |
| 911 | + <span class="field-text">{deadline_label}</span> | |
| 912 | + </span> | |
| 913 | + }, | |
| 914 | + ); | |
| 915 | + } | |
| 916 | + let action = ServerAction::<SaveTask>::new(); | |
| 917 | + let value = action.value(); | |
| 918 | + Effect::new(move |_| { | |
| 919 | + if matches!(value.get(), Some(Ok(None))) { | |
| 920 | + on_change(); | |
| 921 | + } | |
| 922 | + }); | |
| 923 | + let toggle = format!("deadline-{}", task_id.get_value()); | |
| 924 | + | |
| 925 | + Either::Right(view! { | |
| 926 | + <div class="edit edit-pop"> | |
| 927 | + <input | |
| 928 | + class="edit-toggle" | |
| 929 | + type="checkbox" | |
| 930 | + id=toggle.clone() | |
| 931 | + aria-label="Change the deadline" | |
| 932 | + /> | |
| 933 | + <label | |
| 934 | + class="field-box edit-view edit-hit" | |
| 935 | + class:detail-overdue=overdue | |
| 936 | + for=toggle.clone() | |
| 937 | + > | |
| 938 | + {glyph::calendar()} | |
| 939 | + <span class="field-text">{deadline_label}</span> | |
| 940 | + {glyph::chevron()} | |
| 941 | + </label> | |
| 942 | + <div class="edit-form pop-panel"> | |
| 943 | + <ActionForm action=action attr:class="pop-form"> | |
| 944 | + <input type="hidden" name="task_id" value=move || task_id.get_value()/> | |
| 945 | + <input class="detail-date" type="date" name="deadline" value=deadline_input/> | |
| 946 | + <div class="edit-row"> | |
| 947 | + <button | |
| 948 | + class="edit-save" | |
| 949 | + type="submit" | |
| 950 | + disabled=move || action.pending().get() | |
| 951 | + > | |
| 952 | + "Save" | |
| 953 | + </button> | |
| 954 | + <label class="edit-cancel" for=toggle> | |
| 955 | + "Cancel" | |
| 956 | + </label> | |
| 957 | + </div> | |
| 958 | + </ActionForm> | |
| 959 | + {refused(action)} | |
| 960 | + </div> | |
| 961 | + </div> | |
| 962 | + }) | |
| 963 | +} | |
| 964 | +/// The round "+" from the artboard, and the list of people it opens. | |
| 965 | +/// | |
| 966 | +/// A native `<select>` cannot be made to look like this control, so the picker | |
| 967 | +/// is the same popover the deadline uses: a checkbox holds the open state, and | |
| 968 | +/// each person is their own one-field form. It works with the wasm bundle | |
| 969 | +/// blocked, and it is still the design's round button. | |
| 970 | +#[component] | |
| 971 | +fn AssigneePicker( | |
| 972 | + task_id: StoredValue<String>, | |
| 973 | + people: Vec<Person>, | |
| 974 | + on_change: impl Fn() + Copy + Send + Sync + 'static, | |
| 975 | +) -> impl IntoView { | |
| 976 | + if people.is_empty() { | |
| 977 | + return None; | |
| 978 | + } | |
| 979 | + let action = ServerAction::<Assign>::new(); | |
| 980 | + let value = action.value(); | |
| 981 | + Effect::new(move |_| { | |
| 982 | + if matches!(value.get(), Some(Ok(None))) { | |
| 983 | + on_change(); | |
| 984 | + } | |
| 985 | + }); | |
| 986 | + let toggle = format!("assign-{}", task_id.get_value()); | |
| 987 | + | |
| 988 | + Some(view! { | |
| 989 | + <div class="edit edit-pop assignee-pop"> | |
| 990 | + <input | |
| 991 | + class="edit-toggle" | |
| 992 | + type="checkbox" | |
| 993 | + id=toggle.clone() | |
| 994 | + aria-label="Put someone on this task" | |
| 995 | + /> | |
| 996 | + <label class="assignee-add edit-view edit-hit" for=toggle.clone()> | |
| 997 | + {glyph::plus()} | |
| 998 | + </label> | |
| 999 | + <div class="edit-form pop-panel"> | |
| 1000 | + <div class="pop-list"> | |
| 1001 | + {people | |
| 1002 | + .into_iter() | |
| 1003 | + .map(|person| { | |
| 1004 | + let name = person.display_name.clone(); | |
| 1005 | + view! { | |
| 1006 | + <ActionForm action=action attr:class="pop-row-form"> | |
| 1007 | + <input | |
| 1008 | + type="hidden" | |
| 1009 | + name="task_id" | |
| 1010 | + value=move || task_id.get_value() | |
| 1011 | + /> | |
| 1012 | + <input type="hidden" name="user_id" value=person.id.clone()/> | |
| 1013 | + <button class="pop-row" type="submit"> | |
| 1014 | + <Avatar person=person.clone() extra="avatar-sm"/> | |
| 1015 | + <span class="pop-row-name">{name}</span> | |
| 1016 | + </button> | |
| 1017 | + </ActionForm> | |
| 1018 | + } | |
| 1019 | + }) | |
| 1020 | + .collect_view()} | |
| 1021 | + </div> | |
| 1022 | + {refused(action)} | |
| 1023 | + </div> | |
| 1024 | + </div> | |
| 1025 | + }) | |
| 1026 | +} | |
| 1027 | + | |
| 1028 | +/// The 26px "Link a task" chip in the DEPENDENCIES header, and the picker it | |
| 1029 | +/// opens: the tasks as a list, the direction as two words, one button. | |
| 1030 | +#[component] | |
| 1031 | +fn LinkPicker( | |
| 1032 | + task_id: StoredValue<String>, | |
| 1033 | + linkable: Vec<LinkTarget>, | |
| 1034 | + on_change: impl Fn() + Copy + Send + Sync + 'static, | |
| 1035 | +) -> impl IntoView { | |
| 1036 | + if linkable.is_empty() { | |
| 1037 | + return None; | |
| 1038 | + } | |
| 1039 | + let action = ServerAction::<LinkTasks>::new(); | |
| 1040 | + let value = action.value(); | |
| 1041 | + Effect::new(move |_| { | |
| 1042 | + if matches!(value.get(), Some(Ok(None))) { | |
| 1043 | + on_change(); | |
| 1044 | + } | |
| 1045 | + }); | |
| 1046 | + let toggle = format!("link-{}", task_id.get_value()); | |
| 1047 | + let direction = format!("link-direction-{}", task_id.get_value()); | |
| 1048 | + | |
| 1049 | + Some(view! { | |
| 1050 | + <div class="edit edit-pop link-pop"> | |
| 1051 | + <input | |
| 1052 | + class="edit-toggle" | |
| 1053 | + type="checkbox" | |
| 1054 | + id=toggle.clone() | |
| 1055 | + aria-label="Link another task" | |
| 1056 | + /> | |
| 1057 | + <label class="dep-chip edit-view edit-hit" for=toggle.clone()> | |
| 1058 | + {glyph::plus()} | |
| 1059 | + <span class="dep-chip-text">"Link a task"</span> | |
| 1060 | + </label> | |
| 1061 | + <div class="edit-form pop-panel pop-panel-wide"> | |
| 1062 | + <ActionForm action=action attr:class="pop-form"> | |
| 1063 | + <input type="hidden" name="task_id" value=move || task_id.get_value()/> | |
| 1064 | + <div class="pop-list pop-list-scroll"> | |
| 1065 | + {linkable | |
| 1066 | + .iter() | |
| 1067 | + .map(|target| { | |
| 1068 | + let key = target.task_key.clone(); | |
| 1069 | + let title = target.title.clone(); | |
| 1070 | + view! { | |
| 1071 | + <label class="pick-row"> | |
| 1072 | + <input | |
| 1073 | + type="radio" | |
| 1074 | + name="other_id" | |
| 1075 | + value=target.id.clone() | |
| 1076 | + required | |
| 1077 | + /> | |
| 1078 | + <span class="dep-key">{key}</span> | |
| 1079 | + <span class="pick-title">{title}</span> | |
| 1080 | + </label> | |
| 1081 | + } | |
| 1082 | + }) | |
| 1083 | + .collect_view()} | |
| 1084 | + </div> | |
| 1085 | + <fieldset class="pick-direction"> | |
| 1086 | + <legend class="detail-label">"DIRECTION"</legend> | |
| 1087 | + <label class="pick-row"> | |
| 1088 | + <input | |
| 1089 | + type="radio" | |
| 1090 | + name="direction" | |
| 1091 | + value="blocked_by" | |
| 1092 | + checked | |
| 1093 | + id=format!("{direction}-blocked-by") | |
| 1094 | + /> | |
| 1095 | + <span class="pick-title">"blocks this task"</span> | |
| 1096 | + </label> | |
| 1097 | + <label class="pick-row"> | |
| 1098 | + <input | |
| 1099 | + type="radio" | |
| 1100 | + name="direction" | |
| 1101 | + value="blocks" | |
| 1102 | + id=format!("{direction}-blocks") | |
| 1103 | + /> | |
| 1104 | + <span class="pick-title">"waits on this task"</span> | |
| 1105 | + </label> | |
| 1106 | + </fieldset> | |
| 1107 | + <div class="edit-row"> | |
| 1108 | + <button | |
| 1109 | + class="edit-save" | |
| 1110 | + type="submit" | |
| 1111 | + disabled=move || action.pending().get() | |
| 1112 | + > | |
| 1113 | + "Link" | |
| 1114 | + </button> | |
| 1115 | + <label class="edit-cancel" for=toggle> | |
| 1116 | + "Cancel" | |
| 1117 | + </label> | |
| 1118 | + </div> | |
| 1119 | + </ActionForm> | |
| 1120 | + {refused(action)} | |
| 1121 | + </div> | |
| 1122 | + </div> | |
| 1123 | + }) | |
| 1124 | +} | |
| 605 | 1125 | #[component] |
| 606 | 1126 | fn DetailScreen( |
| 607 | 1127 | snapshot: DetailSnapshot, |
| @@ -621,9 +1141,7 @@ fn DetailScreen( | ||
| 621 | 1141 | let id = StoredValue::new(detail.id.clone()); |
| 622 | 1142 | let task_key = detail.task_key.clone(); |
| 623 | 1143 | let title = detail.title.clone(); |
| 624 | - let title_field = detail.title.clone(); | |
| 625 | 1144 | let description = detail.description.clone(); |
| 626 | - let description_field = detail.description.clone(); | |
| 627 | 1145 | let status = detail.column.name.clone(); |
| 628 | 1146 | let column_id = detail.column.id.clone(); |
| 629 | 1147 | let columns = detail.columns.clone(); |
| @@ -631,19 +1149,20 @@ fn DetailScreen( | ||
| 631 | 1149 | let overdue = detail.is_overdue(today); |
| 632 | 1150 | let deadline_label = detail.deadline_label(today); |
| 633 | 1151 | let assignee_count = detail.assignees.len(); |
| 1152 | + let comment_count = detail.comments.len(); | |
| 634 | 1153 | let unassigned: Vec<Person> = detail.unassigned().cloned().collect(); |
| 1154 | + let has_deps = !detail.blocked_by.is_empty() || !detail.blocks.is_empty(); | |
| 635 | 1155 | |
| 636 | - let save = ServerAction::<SaveTask>::new(); | |
| 637 | 1156 | let comment = ServerAction::<PostComment>::new(); |
| 638 | - let link = ServerAction::<LinkTasks>::new(); | |
| 639 | 1157 | let remove = ServerAction::<DeleteTask>::new(); |
| 640 | 1158 | let move_to = ServerAction::<crate::board::MoveCard>::new(); |
| 641 | 1159 | // Deleting is two steps: ask what it would cost, then say it out loud and |
| 642 | 1160 | // let the person decide. The artboard's red button had no confirmation and |
| 643 | 1161 | // this action reaches other people's tasks. |
| 644 | 1162 | let ask = ServerAction::<WhatDeleteCosts>::new(); |
| 645 | - // Every action that lands re-reads the task and the board behind it. | |
| 646 | - for value in [save.value(), comment.value(), link.value(), move_to.value()] { | |
| 1163 | + // Every action that lands re-reads the task and the board behind it. The | |
| 1164 | + // per-region editors own their own actions and do the same. | |
| 1165 | + for value in [comment.value(), move_to.value()] { | |
| 647 | 1166 | Effect::new(move |_| { |
| 648 | 1167 | if matches!(value.get(), Some(Ok(None))) { |
| 649 | 1168 | on_change(); |
| @@ -660,12 +1179,18 @@ fn DetailScreen( | ||
| 660 | 1179 | |
| 661 | 1180 | view! { |
| 662 | 1181 | <header class="detail-head"> |
| 663 | - <span class="detail-key">{task_key}</span> | |
| 664 | - <h2 class="detail-title">{title}</h2> | |
| 665 | - <div class="spacer"></div> | |
| 1182 | + <div class="detail-headline"> | |
| 1183 | + <span class="detail-key">{task_key}</span> | |
| 1184 | + <TitleControl task_id=id title=title may_write=may_write on_change=on_change/> | |
| 1185 | + </div> | |
| 666 | 1186 | <span class="detail-esc">"esc"</span> |
| 667 | - <button class="detail-close" type="button" on:click=move |_| on_close()> | |
| 668 | - "✕" | |
| 1187 | + <button | |
| 1188 | + class="detail-close" | |
| 1189 | + type="button" | |
| 1190 | + aria-label="Close this task" | |
| 1191 | + on:click=move |_| on_close() | |
| 1192 | + > | |
| 1193 | + {glyph::cross()} | |
| 669 | 1194 | </button> |
| 670 | 1195 | </header> |
| 671 | 1196 | |
| @@ -684,7 +1209,14 @@ fn DetailScreen( | ||
| 684 | 1209 | }, |
| 685 | 1210 | ) |
| 686 | 1211 | } else { |
| 687 | - Either::Right(view! { <span class="detail-value">{status}</span> }) | |
| 1212 | + Either::Right( | |
| 1213 | + view! { | |
| 1214 | + <span class="field-box"> | |
| 1215 | + <span class="status-dot"></span> | |
| 1216 | + <span class="field-text">{status}</span> | |
| 1217 | + </span> | |
| 1218 | + }, | |
| 1219 | + ) | |
| 688 | 1220 | }} |
| 689 | 1221 | {refused(move_to)} |
| 690 | 1222 | </div> |
| @@ -707,6 +1239,7 @@ fn DetailScreen( | ||
| 707 | 1239 | } |
| 708 | 1240 | }) |
| 709 | 1241 | .collect_view()} |
| 1242 | + <div class="spacer"></div> | |
| 710 | 1243 | {may_write |
| 711 | 1244 | .then(|| { |
| 712 | 1245 | view! { <AssigneePicker task_id=id people=unassigned on_change=on_change/> } |
| @@ -715,67 +1248,40 @@ fn DetailScreen( | ||
| 715 | 1248 | </div> |
| 716 | 1249 | <div class="detail-field"> |
| 717 | 1250 | <span class="detail-label">"DEADLINE"</span> |
| 718 | - <span class="detail-value" class:detail-overdue=overdue> | |
| 719 | - {deadline_label} | |
| 720 | - </span> | |
| 1251 | + <DeadlineControl | |
| 1252 | + task_id=id | |
| 1253 | + deadline_label=deadline_label | |
| 1254 | + deadline_input=deadline_input | |
| 1255 | + overdue=overdue | |
| 1256 | + may_write=may_write | |
| 1257 | + on_change=on_change | |
| 1258 | + /> | |
| 721 | 1259 | </div> |
| 722 | 1260 | </div> |
| 723 | 1261 | |
| 724 | - <ActionForm action=save attr:class="detail-form"> | |
| 725 | - <input type="hidden" name="task_id" value=move || id.get_value()/> | |
| 726 | - <span class="detail-label">"TITLE"</span> | |
| 727 | - <input | |
| 728 | - class="detail-input" | |
| 729 | - type="text" | |
| 730 | - name="title" | |
| 731 | - value=title_field | |
| 732 | - required | |
| 733 | - disabled=!may_write | |
| 734 | - /> | |
| 1262 | + <section class="detail-block"> | |
| 735 | 1263 | <span class="detail-label">"DESCRIPTION"</span> |
| 736 | - <textarea | |
| 737 | - class="detail-textarea" | |
| 738 | - name="description" | |
| 739 | - rows="4" | |
| 740 | - disabled=!may_write | |
| 741 | - prop:value=description_field | |
| 742 | - > | |
| 743 | - {description} | |
| 744 | - </textarea> | |
| 745 | - <span class="detail-label">"DEADLINE"</span> | |
| 746 | - <input | |
| 747 | - class="detail-input detail-date" | |
| 748 | - type="date" | |
| 749 | - name="deadline" | |
| 750 | - value=deadline_input | |
| 751 | - disabled=!may_write | |
| 1264 | + <DescriptionControl | |
| 1265 | + task_id=id | |
| 1266 | + description=description | |
| 1267 | + may_write=may_write | |
| 1268 | + on_change=on_change | |
| 752 | 1269 | /> |
| 753 | - {may_write | |
| 754 | - .then(|| { | |
| 755 | - view! { | |
| 756 | - <div class="detail-form-row"> | |
| 757 | - <button | |
| 758 | - class="detail-save" | |
| 759 | - type="submit" | |
| 760 | - disabled=move || save.pending().get() | |
| 761 | - > | |
| 762 | - "Save" | |
| 763 | - </button> | |
| 764 | - </div> | |
| 765 | - {refused(save)} | |
| 766 | - } | |
| 767 | - })} | |
| 768 | - </ActionForm> | |
| 1270 | + </section> | |
| 769 | 1271 | |
| 770 | - <section class="detail-section"> | |
| 771 | - <div class="detail-section-head"> | |
| 1272 | + <section class="detail-block"> | |
| 1273 | + <div class="detail-block-head"> | |
| 772 | 1274 | <span class="detail-label">"DEPENDENCIES"</span> |
| 1275 | + <div class="spacer"></div> | |
| 1276 | + {may_write | |
| 1277 | + .then(|| { | |
| 1278 | + view! { <LinkPicker task_id=id linkable=linkable on_change=on_change/> } | |
| 1279 | + })} | |
| 773 | 1280 | </div> |
| 774 | - {(!detail.blocked_by.is_empty()) | |
| 1281 | + {has_deps | |
| 775 | 1282 | .then(|| { |
| 776 | 1283 | view! { |
| 777 | - <div class="dep-group"> | |
| 778 | - <span class="dep-heading">"BLOCKED BY"</span> | |
| 1284 | + <div class="dep-list"> | |
| 779 | 1285 | {detail |
| 780 | 1286 | .blocked_by |
| 781 | 1287 | .iter() |
| @@ -791,14 +1297,6 @@ fn DetailScreen( | ||
| 791 | 1297 | } |
| 792 | 1298 | }) |
| 793 | 1299 | .collect_view()} |
| 794 | - </div> | |
| 795 | - } | |
| 796 | - })} | |
| 797 | - {(!detail.blocks.is_empty()) | |
| 798 | - .then(|| { | |
| 799 | - view! { | |
| 800 | - <div class="dep-group"> | |
| 801 | - <span class="dep-heading">"BLOCKS"</span> | |
| 802 | 1300 | {detail |
| 803 | 1301 | .blocks |
| 804 | 1302 | .iter() |
| @@ -817,73 +1315,51 @@ fn DetailScreen( | ||
| 817 | 1315 | </div> |
| 818 | 1316 | } |
| 819 | 1317 | })} |
| 820 | - {(may_write && !linkable.is_empty()) | |
| 821 | - .then(|| { | |
| 822 | - view! { | |
| 823 | - <ActionForm action=link attr:class="dep-link"> | |
| 824 | - <input type="hidden" name="task_id" value=move || id.get_value()/> | |
| 825 | - <select class="dep-select" name="other_id"> | |
| 826 | - {linkable | |
| 827 | - .iter() | |
| 828 | - .map(|target| { | |
| 829 | - view! { | |
| 830 | - <option value=target.id.clone()> | |
| 831 | - {format!("{} {}", target.task_key, target.title)} | |
| 832 | - </option> | |
| 833 | - } | |
| 834 | - }) | |
| 835 | - .collect_view()} | |
| 836 | - </select> | |
| 837 | - <select class="dep-select" name="direction"> | |
| 838 | - <option value="blocked_by">"blocks this task"</option> | |
| 839 | - <option value="blocks">"waits on this task"</option> | |
| 840 | - </select> | |
| 841 | - <button class="dep-add" type="submit" disabled=move || link.pending().get()> | |
| 842 | - "Link a task" | |
| 843 | - </button> | |
| 844 | - </ActionForm> | |
| 845 | - {refused(link)} | |
| 846 | - } | |
| 847 | - })} | |
| 1318 | + {(!has_deps).then(|| view! { <p class="detail-quiet">"Nothing blocks this task."</p> })} | |
| 848 | 1319 | </section> |
| 849 | 1320 | |
| 850 | - <section class="detail-section"> | |
| 851 | - <span class="detail-label">"COMMENTS"</span> | |
| 852 | - {detail | |
| 853 | - .comments | |
| 854 | - .iter() | |
| 855 | - .map(|entry| view! { <CommentRow comment=entry.clone()/> }) | |
| 856 | - .collect_view()} | |
| 857 | - {may_comment | |
| 858 | - .then(|| { | |
| 859 | - view! { | |
| 860 | - <ActionForm action=comment attr:class="comment-composer"> | |
| 861 | - <input type="hidden" name="task_id" value=move || id.get_value()/> | |
| 862 | - <textarea | |
| 863 | - class="comment-input" | |
| 864 | - name="body" | |
| 865 | - rows="3" | |
| 866 | - placeholder="Write a comment…" | |
| 867 | - required | |
| 868 | - ></textarea> | |
| 869 | - <div class="comment-row"> | |
| 870 | - <span class="comment-hint">"⌘↵ to post"</span> | |
| 871 | - <div class="spacer"></div> | |
| 872 | - <button | |
| 873 | - class="comment-post" | |
| 874 | - type="submit" | |
| 875 | - disabled=move || comment.pending().get() | |
| 876 | - > | |
| 877 | - "Comment" | |
| 878 | - </button> | |
| 879 | - </div> | |
| 880 | - </ActionForm> | |
| 881 | - {refused(comment)} | |
| 882 | - } | |
| 883 | - })} | |
| 1321 | + <section class="detail-block"> | |
| 1322 | + <div class="detail-block-head"> | |
| 1323 | + <span class="detail-label">"COMMENTS"</span> | |
| 1324 | + <span class="detail-count">{comment_count}</span> | |
| 1325 | + </div> | |
| 1326 | + <div class="comment-list"> | |
| 1327 | + {detail | |
| 1328 | + .comments | |
| 1329 | + .iter() | |
| 1330 | + .map(|entry| view! { <CommentRow comment=entry.clone()/> }) | |
| 1331 | + .collect_view()} | |
| 1332 | + {may_comment | |
| 1333 | + .then(|| { | |
| 1334 | + view! { | |
| 1335 | + <ActionForm action=comment attr:class="comment-composer"> | |
| 1336 | + <input type="hidden" name="task_id" value=move || id.get_value()/> | |
| 1337 | + <textarea | |
| 1338 | + class="comment-input" | |
| 1339 | + name="body" | |
| 1340 | + rows="3" | |
| 1341 | + placeholder="Write a comment…" | |
| 1342 | + required | |
| 1343 | + ></textarea> | |
| 1344 | + <div class="comment-row"> | |
| 1345 | + <span class="comment-hint">"⌘↵ to post"</span> | |
| 1346 | + <div class="spacer"></div> | |
| 1347 | + <button | |
| 1348 | + class="comment-post" | |
| 1349 | + type="submit" | |
| 1350 | + disabled=move || comment.pending().get() | |
| 1351 | + > | |
| 1352 | + "Comment" | |
| 1353 | + </button> | |
| 1354 | + </div> | |
| 1355 | + </ActionForm> | |
| 1356 | + {refused(comment)} | |
| 1357 | + } | |
| 1358 | + })} | |
| 1359 | + </div> | |
| 884 | 1360 | </section> |
| 885 | 1361 | |
| 886 | - <section class="detail-section"> | |
| 1362 | + <section class="detail-block"> | |
| 887 | 1363 | <span class="detail-label">"ACTIVITY"</span> |
| 888 | 1364 | {detail |
| 889 | 1365 | .activity |
| @@ -987,7 +1463,8 @@ fn DetailScreen( | ||
| 987 | 1463 | type="submit" |
| 988 | 1464 | disabled=move || ask.pending().get() |
| 989 | 1465 | > |
| 990 | - "Delete task" | |
| 1466 | + {glyph::bin()} | |
| 1467 | + <span>"Delete task"</span> | |
| 991 | 1468 | </button> |
| 992 | 1469 | </ActionForm> |
| 993 | 1470 | } |
| @@ -1015,22 +1492,24 @@ fn AssigneeChip( | ||
| 1015 | 1492 | } |
| 1016 | 1493 | }); |
| 1017 | 1494 | let name = person.display_name.clone(); |
| 1495 | + let person_id = person.id.clone(); | |
| 1018 | 1496 | |
| 1019 | 1497 | view! { |
| 1020 | 1498 | <span class="assignee-chip"> |
| 1021 | - {name.clone()} | |
| 1499 | + <Avatar person=person extra="avatar-sm"/> | |
| 1500 | + <span class="assignee-name">{name.clone()}</span> | |
| 1022 | 1501 | {may_write |
| 1023 | 1502 | .then(|| { |
| 1024 | 1503 | view! { |
| 1025 | 1504 | <ActionForm action=action attr:class="assignee-drop"> |
| 1026 | 1505 | <input type="hidden" name="task_id" value=move || task_id.get_value()/> |
| 1027 | - <input type="hidden" name="user_id" value=person.id.clone()/> | |
| 1506 | + <input type="hidden" name="user_id" value=person_id/> | |
| 1028 | 1507 | <button |
| 1029 | 1508 | class="assignee-remove" |
| 1030 | 1509 | type="submit" |
| 1031 | 1510 | title=format!("Take {name} off this task") |
| 1032 | 1511 | > |
| 1033 | - "✕" | |
| 1512 | + {glyph::cross()} | |
| 1034 | 1513 | </button> |
| 1035 | 1514 | </ActionForm> |
| 1036 | 1515 | } |
| @@ -1039,46 +1518,6 @@ fn AssigneeChip( | ||
| 1039 | 1518 | } |
| 1040 | 1519 | } |
| 1041 | 1520 | |
| 1042 | -#[component] | |
| 1043 | -fn AssigneePicker( | |
| 1044 | - task_id: StoredValue<String>, | |
| 1045 | - people: Vec<Person>, | |
| 1046 | - on_change: impl Fn() + Copy + Send + Sync + 'static, | |
| 1047 | -) -> impl IntoView { | |
| 1048 | - let action = ServerAction::<Assign>::new(); | |
| 1049 | - let value = action.value(); | |
| 1050 | - Effect::new(move |_| { | |
| 1051 | - if matches!(value.get(), Some(Ok(None))) { | |
| 1052 | - on_change(); | |
| 1053 | - } | |
| 1054 | - }); | |
| 1055 | - let empty = people.is_empty(); | |
| 1056 | - | |
| 1057 | - view! { | |
| 1058 | - {(!empty) | |
| 1059 | - .then(|| { | |
| 1060 | - view! { | |
| 1061 | - <ActionForm action=action attr:class="assignee-add"> | |
| 1062 | - <input type="hidden" name="task_id" value=move || task_id.get_value()/> | |
| 1063 | - <select class="assignee-select" name="user_id"> | |
| 1064 | - {people | |
| 1065 | - .iter() | |
| 1066 | - .map(|person| { | |
| 1067 | - view! { | |
| 1068 | - <option value=person.id.clone()>{person.display_name.clone()}</option> | |
| 1069 | - } | |
| 1070 | - }) | |
| 1071 | - .collect_view()} | |
| 1072 | - </select> | |
| 1073 | - <button class="assignee-assign" type="submit"> | |
| 1074 | - "Assign" | |
| 1075 | - </button> | |
| 1076 | - </ActionForm> | |
| 1077 | - } | |
| 1078 | - })} | |
| 1079 | - } | |
| 1080 | -} | |
| 1081 | - | |
| 1082 | 1521 | #[component] |
| 1083 | 1522 | fn DepRow( |
| 1084 | 1523 | task_id: StoredValue<String>, |
| @@ -1105,15 +1544,25 @@ fn DepRow( | ||
| 1105 | 1544 | Direction::BlockedBy => "blocked_by", |
| 1106 | 1545 | Direction::Blocks => "blocks", |
| 1107 | 1546 | }; |
| 1547 | + // The artboard puts the direction in the row itself, in a fixed column, so | |
| 1548 | + // the rows line up whichever way round they run. | |
| 1549 | + let tag = if waiting { "BLOCKS" } else { "BLOCKED BY" }; | |
| 1108 | 1550 | |
| 1109 | 1551 | view! { |
| 1110 | 1552 | <div class="dep-row" class:dep-row-waiting=waiting> |
| 1111 | - {cleared.then(|| view! { <span class="dep-tick">"✓"</span> })} | |
| 1553 | + <span class="dep-tag">{tag}</span> | |
| 1554 | + {if waiting { | |
| 1555 | + Either::Left(glyph::lock()) | |
| 1556 | + } else if cleared { | |
| 1557 | + Either::Right(Either::Left(glyph::tick())) | |
| 1558 | + } else { | |
| 1559 | + Either::Right(Either::Right(glyph::lock())) | |
| 1560 | + }} | |
| 1112 | 1561 | <span class="dep-key">{edge.task_key.clone()}</span> |
| 1113 | 1562 | <span class="dep-title">{edge.title.clone()}</span> |
| 1114 | 1563 | <div class="spacer"></div> |
| 1115 | 1564 | <span class="dep-note">{note}</span> |
| 1116 | - {(may_write && !cleared) | |
| 1565 | + {may_write | |
| 1117 | 1566 | .then(|| { |
| 1118 | 1567 | view! { |
| 1119 | 1568 | <ActionForm action=action attr:class="dep-unlink-form"> |
| @@ -1121,7 +1570,7 @@ fn DepRow( | ||
| 1121 | 1570 | <input type="hidden" name="other_id" value=other_id/> |
| 1122 | 1571 | <input type="hidden" name="direction" value=wire/> |
| 1123 | 1572 | <button class="dep-unlink" type="submit" title="Remove this link"> |
| 1124 | - "✕" | |
| 1573 | + {glyph::cross()} | |
| 1125 | 1574 | </button> |
| 1126 | 1575 | </ActionForm> |
| 1127 | 1576 | } |
| @@ -1134,13 +1583,17 @@ fn DepRow( | ||
| 1134 | 1583 | fn CommentRow(comment: Comment) -> impl IntoView { |
| 1135 | 1584 | use dizey_core::detail::moment_label; |
| 1136 | 1585 | |
| 1586 | + let author = comment.author.clone(); | |
| 1137 | 1587 | view! { |
| 1138 | 1588 | <div class="comment"> |
| 1139 | - <div class="comment-head"> | |
| 1140 | - <span class="comment-who">{comment.author.display_name.clone()}</span> | |
| 1141 | - <span class="comment-when">{moment_label(comment.at)}</span> | |
| 1589 | + <Avatar person=author extra="avatar-lg"/> | |
| 1590 | + <div class="comment-said"> | |
| 1591 | + <div class="comment-head"> | |
| 1592 | + <span class="comment-who">{comment.author.display_name.clone()}</span> | |
| 1593 | + <span class="comment-when">{moment_label(comment.at)}</span> | |
| 1594 | + </div> | |
| 1595 | + <div class="comment-body">{comment.body.clone()}</div> | |
| 1142 | 1596 | </div> |
| 1143 | - <div class="comment-body">{comment.body.clone()}</div> | |
| 1144 | 1597 | </div> |
| 1145 | 1598 | } |
| 1146 | 1599 | } |
style/main.scssmodified+472 -139
| @@ -548,6 +548,24 @@ a { | ||
| 548 | 548 | background: transparent; |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | + // The modal asks for two other sizes: 18px inside an assignee chip, 28px | |
| 552 | + // beside a comment. The border is the board's overlap trick and has no job | |
| 553 | + // on a lone avatar, so these drop it. | |
| 554 | + &-sm { | |
| 555 | + width: 18px; | |
| 556 | + height: 18px; | |
| 557 | + border: none; | |
| 558 | + font-size: 8px; | |
| 559 | + } | |
| 560 | + | |
| 561 | + &-lg { | |
| 562 | + width: 28px; | |
| 563 | + height: 28px; | |
| 564 | + border: none; | |
| 565 | + font-size: 11px; | |
| 566 | + flex: none; | |
| 567 | + } | |
| 568 | + | |
| 551 | 569 | &-tone-0 { background: #46557b; } |
| 552 | 570 | &-tone-1 { background: #7b6846; } |
| 553 | 571 | &-tone-2 { background: #5c7b46; } |
| @@ -636,7 +654,15 @@ a { | ||
| 636 | 654 | cursor: pointer; |
| 637 | 655 | } |
| 638 | 656 | |
| 657 | + | |
| 639 | 658 | // -- the task detail modal -------------------------------------------------- |
| 659 | +// | |
| 660 | +// The modal is a view. Every region that can be changed is a `<form>` wearing | |
| 661 | +// the view's clothes: the read-only shape is a `<label>`, the form beneath it | |
| 662 | +// is hidden until a visually-hidden checkbox is checked, and the checkbox is | |
| 663 | +// checked by clicking that label. Cancel is a second label pointing at the | |
| 664 | +// same checkbox, so entering and leaving the edit state both work with wasm | |
| 665 | +// blocked. Nothing else on the screen changes when one region opens. | |
| 640 | 666 | |
| 641 | 667 | .modal-scrim { |
| 642 | 668 | position: fixed; |
| @@ -657,7 +683,7 @@ a { | ||
| 657 | 683 | border: 1px solid var(--border); |
| 658 | 684 | border-radius: 12px; |
| 659 | 685 | box-shadow: 0 12px 40px rgba(28, 27, 24, 0.18); |
| 660 | - padding: 20px 24px 16px; | |
| 686 | + padding: 4px 0 0; | |
| 661 | 687 | outline: none; |
| 662 | 688 | } |
| 663 | 689 | |
| @@ -665,18 +691,171 @@ a { | ||
| 665 | 691 | |
| 666 | 692 | .modal-note, |
| 667 | 693 | .modal-problem { |
| 668 | - margin: 8px 0 0; | |
| 694 | + margin: 8px 24px 0; | |
| 669 | 695 | font-size: 13px; |
| 670 | 696 | color: #a04a24; |
| 671 | 697 | } |
| 672 | 698 | |
| 673 | -.detail-head { | |
| 699 | +// -- the edit state --------------------------------------------------------- | |
| 700 | + | |
| 701 | +.edit { position: relative; } | |
| 702 | + | |
| 703 | +// Focusable but invisible: it is the state, and a keyboard must be able to | |
| 704 | +// reach it. Not `display: none` — that would take it out of the tab order. | |
| 705 | +.edit-toggle { | |
| 706 | + position: absolute; | |
| 707 | + width: 1px; | |
| 708 | + height: 1px; | |
| 709 | + margin: 0; | |
| 710 | + padding: 0; | |
| 711 | + opacity: 0; | |
| 712 | + pointer-events: none; | |
| 713 | +} | |
| 714 | + | |
| 715 | +.edit-hit { cursor: text; } | |
| 716 | + | |
| 717 | +.edit-form { display: none; } | |
| 718 | + | |
| 719 | +.edit:not(.edit-pop) > .edit-toggle:checked ~ .edit-view { display: none; } | |
| 720 | +.edit-toggle:checked ~ .edit-form { display: block; } | |
| 721 | +.edit-toggle:checked ~ .title-form { display: flex; } | |
| 722 | +.edit-toggle:focus-visible ~ .edit-view { | |
| 723 | + outline: 2px solid var(--accent, #46557b); | |
| 724 | + outline-offset: 2px; | |
| 725 | + border-radius: 4px; | |
| 726 | +} | |
| 727 | + | |
| 728 | +.edit-row { | |
| 729 | + display: flex; | |
| 730 | + align-items: center; | |
| 731 | + gap: 8px; | |
| 732 | + margin-top: 8px; | |
| 733 | +} | |
| 734 | + | |
| 735 | +.edit-save { | |
| 736 | + height: 28px; | |
| 737 | + padding: 0 12px; | |
| 738 | + border: none; | |
| 739 | + border-radius: var(--radius); | |
| 740 | + background: var(--ink); | |
| 741 | + color: #fffefb; | |
| 742 | + font-family: inherit; | |
| 743 | + font-size: 12px; | |
| 744 | + cursor: pointer; | |
| 745 | + | |
| 746 | + &:disabled { opacity: 0.5; cursor: default; } | |
| 747 | +} | |
| 748 | + | |
| 749 | +.edit-cancel { | |
| 750 | + font-size: 12px; | |
| 751 | + color: var(--muted); | |
| 752 | + cursor: pointer; | |
| 753 | +} | |
| 754 | + | |
| 755 | +// A popover is the same machinery, floated. | |
| 756 | +.edit-pop { | |
| 757 | + .edit-form { | |
| 758 | + position: absolute; | |
| 759 | + top: calc(100% + 6px); | |
| 760 | + left: 0; | |
| 761 | + z-index: 4; | |
| 762 | + } | |
| 763 | +} | |
| 764 | + | |
| 765 | +.pop-panel { | |
| 766 | + min-width: 200px; | |
| 767 | + padding: 8px; | |
| 768 | + background: var(--surface); | |
| 769 | + border: 1px solid var(--border-strong); | |
| 770 | + border-radius: 8px; | |
| 771 | + box-shadow: 0 8px 24px rgba(28, 27, 24, 0.14); | |
| 772 | +} | |
| 773 | + | |
| 774 | +.pop-panel-wide { min-width: 320px; } | |
| 775 | + | |
| 776 | +.pop-list { | |
| 777 | + display: flex; | |
| 778 | + flex-direction: column; | |
| 779 | + gap: 2px; | |
| 780 | +} | |
| 781 | + | |
| 782 | +.pop-list-scroll { | |
| 783 | + max-height: 220px; | |
| 784 | + overflow-y: auto; | |
| 785 | +} | |
| 786 | + | |
| 787 | +.pop-row-form { display: block; } | |
| 788 | + | |
| 789 | +.pop-row { | |
| 674 | 790 | display: flex; |
| 675 | 791 | align-items: center; |
| 792 | + gap: 8px; | |
| 793 | + width: 100%; | |
| 794 | + padding: 5px 6px; | |
| 795 | + border: none; | |
| 796 | + border-radius: 5px; | |
| 797 | + background: transparent; | |
| 798 | + font-family: inherit; | |
| 799 | + font-size: 12px; | |
| 800 | + color: var(--ink); | |
| 801 | + text-align: left; | |
| 802 | + cursor: pointer; | |
| 803 | + | |
| 804 | + &:hover { background: #f3f1ea; } | |
| 805 | +} | |
| 806 | + | |
| 807 | +.pop-row-name { font-size: 12px; } | |
| 808 | + | |
| 809 | + | |
| 810 | +.pick-row { | |
| 811 | + display: flex; | |
| 812 | + align-items: center; | |
| 813 | + gap: 8px; | |
| 814 | + padding: 5px 6px; | |
| 815 | + border-radius: 5px; | |
| 816 | + font-size: 12px; | |
| 817 | + cursor: pointer; | |
| 818 | + | |
| 819 | + &:hover { background: #f3f1ea; } | |
| 820 | +} | |
| 821 | + | |
| 822 | +.pick-title { color: var(--muted); } | |
| 823 | + | |
| 824 | +.pick-direction { | |
| 825 | + display: flex; | |
| 826 | + align-items: center; | |
| 827 | + gap: 12px; | |
| 828 | + margin: 8px 0 0; | |
| 829 | + padding: 8px 6px 0; | |
| 830 | + border: none; | |
| 831 | + border-top: 1px solid var(--border); | |
| 832 | + font-size: 12px; | |
| 833 | + | |
| 834 | + label { | |
| 835 | + display: inline-flex; | |
| 836 | + align-items: center; | |
| 837 | + gap: 5px; | |
| 838 | + cursor: pointer; | |
| 839 | + } | |
| 840 | +} | |
| 841 | + | |
| 842 | +// -- header ----------------------------------------------------------------- | |
| 843 | + | |
| 844 | +.detail-head { | |
| 845 | + display: flex; | |
| 846 | + align-items: flex-start; | |
| 676 | 847 | gap: 10px; |
| 848 | + padding: 24px 24px 0; | |
| 849 | +} | |
| 850 | + | |
| 851 | +.detail-headline { | |
| 852 | + flex: 1; | |
| 853 | + min-width: 0; | |
| 677 | 854 | } |
| 678 | 855 | |
| 679 | 856 | .detail-key { |
| 857 | + display: block; | |
| 858 | + margin-bottom: 6px; | |
| 680 | 859 | font-family: var(--font-mono); |
| 681 | 860 | font-size: 11px; |
| 682 | 861 | color: var(--muted-soft); |
| @@ -686,9 +865,30 @@ a { | ||
| 686 | 865 | margin: 0; |
| 687 | 866 | font-size: 20px; |
| 688 | 867 | font-weight: 600; |
| 868 | + line-height: 1.3; | |
| 869 | +} | |
| 870 | + | |
| 871 | +.title-form { | |
| 872 | + align-items: center; | |
| 873 | + gap: 8px; | |
| 874 | +} | |
| 875 | + | |
| 876 | +.title-input { | |
| 877 | + flex: 1; | |
| 878 | + min-width: 0; | |
| 879 | + height: 32px; | |
| 880 | + padding: 0 8px; | |
| 881 | + border: 1px solid var(--border-strong); | |
| 882 | + border-radius: var(--radius); | |
| 883 | + background: var(--surface); | |
| 884 | + font-family: inherit; | |
| 885 | + font-size: 20px; | |
| 886 | + font-weight: 600; | |
| 887 | + color: var(--ink); | |
| 689 | 888 | } |
| 690 | 889 | |
| 691 | 890 | .detail-esc { |
| 891 | + margin-top: 4px; | |
| 692 | 892 | font-family: var(--font-mono); |
| 693 | 893 | font-size: 10px; |
| 694 | 894 | color: var(--muted-soft); |
| @@ -698,54 +898,84 @@ a { | ||
| 698 | 898 | } |
| 699 | 899 | |
| 700 | 900 | .detail-close { |
| 901 | + display: inline-flex; | |
| 902 | + align-items: center; | |
| 903 | + justify-content: center; | |
| 904 | + width: 36px; | |
| 905 | + height: 36px; | |
| 701 | 906 | border: none; |
| 702 | - background: none; | |
| 907 | + border-radius: var(--radius); | |
| 908 | + background: transparent; | |
| 703 | 909 | color: var(--muted); |
| 704 | - font-size: 14px; | |
| 705 | 910 | cursor: pointer; |
| 706 | - padding: 2px 4px; | |
| 911 | + | |
| 912 | + &:hover { background: #f3f1ea; } | |
| 707 | 913 | } |
| 708 | 914 | |
| 915 | +// -- the field row ---------------------------------------------------------- | |
| 916 | + | |
| 709 | 917 | .detail-fields { |
| 710 | 918 | display: grid; |
| 711 | 919 | grid-template-columns: 1fr 1.5fr 1fr; |
| 712 | 920 | gap: 12px; |
| 713 | - margin-top: 18px; | |
| 921 | + padding: 20px 24px 0; | |
| 922 | + margin-top: 2px; | |
| 714 | 923 | } |
| 715 | 924 | |
| 716 | 925 | .detail-field { |
| 717 | 926 | display: flex; |
| 718 | 927 | flex-direction: column; |
| 719 | 928 | gap: 6px; |
| 929 | + min-width: 0; | |
| 720 | 930 | } |
| 721 | 931 | |
| 722 | 932 | .detail-label { |
| 723 | 933 | font-family: var(--font-mono); |
| 724 | 934 | font-size: 10px; |
| 725 | - letter-spacing: 0.08em; | |
| 935 | + letter-spacing: 0.06em; | |
| 726 | 936 | color: var(--muted-soft); |
| 727 | 937 | } |
| 728 | 938 | |
| 729 | -.detail-value { | |
| 730 | - min-height: 36px; | |
| 939 | +.detail-count { | |
| 940 | + font-family: var(--font-mono); | |
| 941 | + font-size: 11px; | |
| 942 | + color: var(--muted-soft); | |
| 943 | +} | |
| 944 | + | |
| 945 | +// Every value in the field row wears the same box, so a `<select>`, a label | |
| 946 | +// and a plain span all line up at 36px. | |
| 947 | +.field-box { | |
| 731 | 948 | display: flex; |
| 732 | 949 | align-items: center; |
| 950 | + gap: 8px; | |
| 951 | + height: 36px; | |
| 733 | 952 | padding: 0 10px; |
| 734 | 953 | background: #faf9f6; |
| 735 | 954 | border: 1px solid var(--border-strong); |
| 736 | 955 | border-radius: var(--radius); |
| 737 | 956 | font-size: 13px; |
| 957 | + color: var(--ink); | |
| 958 | + cursor: pointer; | |
| 959 | +} | |
| 960 | + | |
| 961 | +.field-text { | |
| 962 | + flex: 1; | |
| 963 | + min-width: 0; | |
| 964 | + overflow: hidden; | |
| 965 | + text-overflow: ellipsis; | |
| 966 | + white-space: nowrap; | |
| 967 | +} | |
| 968 | + | |
| 969 | +.glyph { | |
| 970 | + flex: none; | |
| 971 | + color: var(--muted-soft); | |
| 738 | 972 | } |
| 739 | 973 | |
| 740 | -/* The artboard's STATUS control: a dot, the column name, and the chevron the | |
| 741 | - select draws for itself. It is a form, so it works without script; the | |
| 742 | - submit button beside it is drawn only when script is absent. */ | |
| 743 | 974 | .status-form { |
| 744 | - position: relative; | |
| 745 | 975 | display: flex; |
| 746 | 976 | align-items: center; |
| 747 | 977 | gap: 8px; |
| 748 | - min-height: 36px; | |
| 978 | + height: 36px; | |
| 749 | 979 | padding: 0 10px; |
| 750 | 980 | background: #faf9f6; |
| 751 | 981 | border: 1px solid var(--border-strong); |
| @@ -753,48 +983,69 @@ a { | ||
| 753 | 983 | } |
| 754 | 984 | |
| 755 | 985 | .status-dot { |
| 756 | - width: 7px; | |
| 757 | - height: 7px; | |
| 986 | + flex: none; | |
| 987 | + width: 8px; | |
| 988 | + height: 8px; | |
| 758 | 989 | border-radius: 50%; |
| 759 | - background: var(--accent); | |
| 760 | - flex-shrink: 0; | |
| 990 | + background: var(--muted-soft); | |
| 761 | 991 | } |
| 762 | 992 | |
| 763 | 993 | .status-dot-done { background: #5c7b46; } |
| 764 | 994 | |
| 995 | +// The select carries no chrome of its own: the box around it is the control. | |
| 765 | 996 | .status-select { |
| 766 | - flex-grow: 1; | |
| 997 | + flex: 1; | |
| 998 | + min-width: 0; | |
| 767 | 999 | border: none; |
| 768 | - background: none; | |
| 769 | - font: inherit; | |
| 1000 | + background: transparent; | |
| 1001 | + appearance: none; | |
| 1002 | + font-family: inherit; | |
| 770 | 1003 | font-size: 13px; |
| 771 | - color: inherit; | |
| 772 | - padding: 0; | |
| 1004 | + color: var(--ink); | |
| 773 | 1005 | cursor: pointer; |
| 774 | - outline: none; | |
| 1006 | + | |
| 1007 | + &:focus { outline: none; } | |
| 775 | 1008 | } |
| 776 | 1009 | |
| 777 | 1010 | .status-go { |
| 1011 | + height: 24px; | |
| 1012 | + padding: 0 8px; | |
| 778 | 1013 | border: 1px solid var(--border-strong); |
| 779 | 1014 | border-radius: 4px; |
| 780 | 1015 | background: var(--surface); |
| 1016 | + font-family: inherit; | |
| 781 | 1017 | font-size: 11px; |
| 782 | - padding: 2px 6px; | |
| 1018 | + color: var(--muted); | |
| 783 | 1019 | cursor: pointer; |
| 784 | 1020 | } |
| 785 | 1021 | |
| 786 | 1022 | .detail-overdue { |
| 787 | 1023 | border-color: #e8c9b8; |
| 788 | 1024 | color: #a04a24; |
| 1025 | + | |
| 1026 | + .glyph { color: #a04a24; } | |
| 1027 | +} | |
| 1028 | + | |
| 1029 | +.detail-date { | |
| 1030 | + width: 100%; | |
| 1031 | + height: 32px; | |
| 1032 | + padding: 0 8px; | |
| 1033 | + border: 1px solid var(--border-strong); | |
| 1034 | + border-radius: var(--radius); | |
| 1035 | + background: var(--surface); | |
| 1036 | + font-family: inherit; | |
| 1037 | + font-size: 13px; | |
| 1038 | + color: var(--ink); | |
| 789 | 1039 | } |
| 790 | 1040 | |
| 1041 | +// -- assignees -------------------------------------------------------------- | |
| 1042 | + | |
| 791 | 1043 | .detail-assignees { |
| 792 | - min-height: 36px; | |
| 793 | 1044 | display: flex; |
| 794 | 1045 | align-items: center; |
| 795 | - flex-wrap: wrap; | |
| 796 | 1046 | gap: 6px; |
| 797 | - padding: 4px 6px; | |
| 1047 | + height: 36px; | |
| 1048 | + padding: 0 6px; | |
| 798 | 1049 | background: #faf9f6; |
| 799 | 1050 | border: 1px solid var(--border-strong); |
| 800 | 1051 | border-radius: var(--radius); |
| @@ -802,125 +1053,147 @@ a { | ||
| 802 | 1053 | |
| 803 | 1054 | .assignee-chip { |
| 804 | 1055 | display: inline-flex; |
| 1056 | + min-width: 0; | |
| 805 | 1057 | align-items: center; |
| 806 | - gap: 4px; | |
| 807 | - font-size: 12px; | |
| 1058 | + gap: 5px; | |
| 1059 | + white-space: nowrap; | |
| 1060 | + padding: 3px 6px 3px 3px; | |
| 1061 | + border-radius: 5px; | |
| 808 | 1062 | background: var(--surface); |
| 809 | - border: 1px solid var(--border-strong); | |
| 810 | - border-radius: 11px; | |
| 811 | - padding: 2px 4px 2px 8px; | |
| 1063 | + border: 1px solid var(--border); | |
| 1064 | +} | |
| 1065 | + | |
| 1066 | +.assignee-name { | |
| 1067 | + min-width: 0; | |
| 1068 | + overflow: hidden; | |
| 1069 | + text-overflow: ellipsis; | |
| 1070 | + font-size: 12px; | |
| 1071 | + color: var(--ink); | |
| 812 | 1072 | } |
| 813 | 1073 | |
| 814 | 1074 | .assignee-drop { display: inline-flex; } |
| 815 | 1075 | |
| 816 | 1076 | .assignee-remove { |
| 1077 | + display: inline-flex; | |
| 1078 | + align-items: center; | |
| 1079 | + justify-content: center; | |
| 1080 | + width: 14px; | |
| 1081 | + height: 14px; | |
| 817 | 1082 | border: none; |
| 818 | - background: none; | |
| 1083 | + background: transparent; | |
| 819 | 1084 | color: var(--muted-soft); |
| 820 | - font-size: 10px; | |
| 821 | 1085 | cursor: pointer; |
| 822 | - padding: 0 2px; | |
| 1086 | + | |
| 1087 | + &:hover { color: #a04a24; } | |
| 823 | 1088 | } |
| 824 | 1089 | |
| 1090 | +// The artboard's round dashed "+". It is a label, and the popover it opens | |
| 1091 | +// holds one tiny form per person — a submit button's own name/value does not | |
| 1092 | +// survive `ActionForm`, so each row carries its own hidden field instead. | |
| 825 | 1093 | .assignee-add { |
| 826 | 1094 | display: inline-flex; |
| 827 | - gap: 4px; | |
| 828 | -} | |
| 1095 | + align-items: center; | |
| 1096 | + justify-content: center; | |
| 1097 | + width: 22px; | |
| 1098 | + height: 22px; | |
| 1099 | + border: 1px dashed var(--border-strong); | |
| 1100 | + border-radius: 50%; | |
| 1101 | + color: var(--muted-soft); | |
| 1102 | + cursor: pointer; | |
| 829 | 1103 | |
| 830 | -.assignee-select, | |
| 831 | -.dep-select { | |
| 832 | - font-family: inherit; | |
| 833 | - font-size: 12px; | |
| 834 | - background: var(--surface); | |
| 835 | - border: 1px solid var(--border-strong); | |
| 836 | - border-radius: 4px; | |
| 837 | - padding: 2px 4px; | |
| 838 | - max-width: 220px; | |
| 1104 | + &:hover { color: var(--ink); border-color: var(--muted-soft); } | |
| 839 | 1105 | } |
| 840 | 1106 | |
| 841 | -.assignee-assign, | |
| 842 | -.dep-add { | |
| 843 | - font-family: inherit; | |
| 844 | - font-size: 12px; | |
| 845 | - background: var(--surface); | |
| 846 | - border: 1px solid var(--border-strong); | |
| 847 | - border-radius: 4px; | |
| 848 | - padding: 2px 8px; | |
| 849 | - cursor: pointer; | |
| 850 | -} | |
| 1107 | +// The round "+" is the only way to assign anyone, so it never gets crowded off | |
| 1108 | +// the row: the chips give up width first. | |
| 1109 | +.detail-assignees > .edit { flex: none; } | |
| 1110 | + | |
| 1111 | +.assignee-pop .edit-form { left: auto; right: 0; } | |
| 1112 | + | |
| 1113 | +// -- blocks ----------------------------------------------------------------- | |
| 851 | 1114 | |
| 852 | -.detail-form { | |
| 1115 | +.detail-block { | |
| 853 | 1116 | display: flex; |
| 854 | 1117 | flex-direction: column; |
| 855 | - gap: 6px; | |
| 856 | - margin-top: 20px; | |
| 1118 | + gap: 10px; | |
| 1119 | + padding: 22px 24px 0; | |
| 857 | 1120 | } |
| 858 | 1121 | |
| 859 | -.detail-input, | |
| 860 | -.detail-textarea, | |
| 861 | -.comment-input { | |
| 862 | - font-family: inherit; | |
| 1122 | +.detail-block-head { | |
| 1123 | + display: flex; | |
| 1124 | + align-items: center; | |
| 1125 | + gap: 8px; | |
| 1126 | + margin-bottom: -2px; | |
| 1127 | +} | |
| 1128 | + | |
| 1129 | +.detail-prose { | |
| 1130 | + display: block; | |
| 1131 | + margin: 0; | |
| 863 | 1132 | font-size: 14px; |
| 1133 | + line-height: 1.6; | |
| 864 | 1134 | color: #3d3a34; |
| 865 | - background: var(--surface); | |
| 1135 | + white-space: pre-wrap; | |
| 1136 | +} | |
| 1137 | + | |
| 1138 | +.detail-prose-empty { color: var(--muted-soft); } | |
| 1139 | + | |
| 1140 | +.detail-quiet { | |
| 1141 | + margin: 0; | |
| 1142 | + font-size: 13px; | |
| 1143 | + color: var(--muted-soft); | |
| 1144 | +} | |
| 1145 | + | |
| 1146 | +.detail-textarea, | |
| 1147 | +.comment-input { | |
| 1148 | + width: 100%; | |
| 1149 | + padding: 8px 10px; | |
| 866 | 1150 | border: 1px solid var(--border-strong); |
| 867 | 1151 | border-radius: var(--radius); |
| 868 | - padding: 8px 10px; | |
| 1152 | + background: var(--surface); | |
| 1153 | + font-family: inherit; | |
| 1154 | + font-size: 14px; | |
| 1155 | + line-height: 1.6; | |
| 1156 | + color: var(--ink); | |
| 869 | 1157 | resize: vertical; |
| 870 | 1158 | } |
| 871 | 1159 | |
| 872 | -.detail-textarea { line-height: 1.6; } | |
| 873 | - | |
| 874 | -.detail-date { width: 160px; } | |
| 875 | 1160 | |
| 876 | -.detail-form-row { | |
| 877 | - display: flex; | |
| 878 | - justify-content: flex-end; | |
| 879 | -} | |
| 1161 | +// -- dependencies ----------------------------------------------------------- | |
| 880 | 1162 | |
| 881 | -.detail-save, | |
| 882 | -.comment-post { | |
| 883 | - font-family: inherit; | |
| 884 | - font-size: 13px; | |
| 885 | - color: #fffefb; | |
| 886 | - background: var(--accent); | |
| 887 | - border: 1px solid var(--accent); | |
| 888 | - border-radius: var(--radius); | |
| 889 | - padding: 6px 14px; | |
| 1163 | +.dep-chip { | |
| 1164 | + display: inline-flex; | |
| 1165 | + align-items: center; | |
| 1166 | + gap: 5px; | |
| 1167 | + height: 26px; | |
| 1168 | + padding: 0 9px; | |
| 1169 | + border: 1px solid var(--border-strong); | |
| 1170 | + border-radius: 5px; | |
| 1171 | + background: var(--surface); | |
| 1172 | + font-size: 12px; | |
| 1173 | + color: var(--muted); | |
| 890 | 1174 | cursor: pointer; |
| 891 | 1175 | |
| 892 | - &:disabled { opacity: 0.6; cursor: default; } | |
| 1176 | + &:hover { color: var(--ink); } | |
| 893 | 1177 | } |
| 894 | 1178 | |
| 895 | -.detail-section { | |
| 896 | - display: flex; | |
| 897 | - flex-direction: column; | |
| 898 | - gap: 8px; | |
| 899 | - margin-top: 22px; | |
| 900 | -} | |
| 1179 | +.dep-chip-text { font-size: 12px; } | |
| 1180 | + | |
| 1181 | +.link-pop .edit-form { left: auto; right: 0; } | |
| 901 | 1182 | |
| 902 | -.dep-group { | |
| 1183 | +.dep-list { | |
| 903 | 1184 | display: flex; |
| 904 | 1185 | flex-direction: column; |
| 905 | 1186 | gap: 6px; |
| 906 | 1187 | } |
| 907 | 1188 | |
| 908 | -.dep-heading { | |
| 909 | - font-family: var(--font-mono); | |
| 910 | - font-size: 10px; | |
| 911 | - letter-spacing: 0.06em; | |
| 912 | - color: var(--muted-soft); | |
| 913 | -} | |
| 914 | - | |
| 915 | 1189 | .dep-row { |
| 916 | 1190 | display: flex; |
| 917 | 1191 | align-items: center; |
| 918 | - gap: 8px; | |
| 919 | - min-height: 34px; | |
| 920 | - padding: 0 10px; | |
| 1192 | + gap: 10px; | |
| 1193 | + padding: 10px 12px; | |
| 1194 | + border: 1px solid var(--border); | |
| 1195 | + border-radius: 7px; | |
| 921 | 1196 | background: #faf9f6; |
| 922 | - border: 1px solid var(--border-strong); | |
| 923 | - border-radius: var(--radius); | |
| 924 | 1197 | font-size: 13px; |
| 925 | 1198 | } |
| 926 | 1199 | |
| @@ -928,42 +1201,76 @@ a { | ||
| 928 | 1201 | background: #fdfaf1; |
| 929 | 1202 | border-color: #e6d7ae; |
| 930 | 1203 | |
| 931 | - .dep-note { color: #7a5c1e; } | |
| 1204 | + .dep-tag, | |
| 1205 | + .dep-note, | |
| 1206 | + .glyph { color: #7a5c1e; } | |
| 1207 | +} | |
| 1208 | + | |
| 1209 | +.dep-tag { | |
| 1210 | + flex: none; | |
| 1211 | + width: 78px; | |
| 1212 | + font-family: var(--font-mono); | |
| 1213 | + font-size: 10px; | |
| 1214 | + letter-spacing: 0.06em; | |
| 1215 | + color: var(--muted-soft); | |
| 932 | 1216 | } |
| 933 | 1217 | |
| 934 | 1218 | .dep-tick { color: #5c7b46; } |
| 935 | 1219 | |
| 936 | 1220 | .dep-key { |
| 1221 | + flex: none; | |
| 937 | 1222 | font-family: var(--font-mono); |
| 938 | 1223 | font-size: 11px; |
| 939 | 1224 | color: var(--muted-soft); |
| 940 | 1225 | } |
| 941 | 1226 | |
| 1227 | +.dep-title { | |
| 1228 | + min-width: 0; | |
| 1229 | + overflow: hidden; | |
| 1230 | + text-overflow: ellipsis; | |
| 1231 | + white-space: nowrap; | |
| 1232 | +} | |
| 1233 | + | |
| 942 | 1234 | .dep-note { |
| 943 | - font-size: 12px; | |
| 944 | - color: var(--muted); | |
| 1235 | + flex: none; | |
| 1236 | + font-size: 11px; | |
| 1237 | + color: var(--muted-soft); | |
| 945 | 1238 | } |
| 946 | 1239 | |
| 947 | 1240 | .dep-unlink-form { display: inline-flex; } |
| 948 | 1241 | |
| 949 | 1242 | .dep-unlink { |
| 1243 | + display: inline-flex; | |
| 1244 | + align-items: center; | |
| 1245 | + justify-content: center; | |
| 1246 | + width: 24px; | |
| 1247 | + height: 24px; | |
| 950 | 1248 | border: none; |
| 951 | - background: none; | |
| 1249 | + border-radius: 4px; | |
| 1250 | + background: transparent; | |
| 952 | 1251 | color: var(--muted-soft); |
| 953 | - font-size: 11px; | |
| 954 | 1252 | cursor: pointer; |
| 1253 | + | |
| 1254 | + &:hover { color: #a04a24; } | |
| 955 | 1255 | } |
| 956 | 1256 | |
| 957 | -.dep-link { | |
| 1257 | +// -- comments --------------------------------------------------------------- | |
| 1258 | + | |
| 1259 | +.comment-list { | |
| 958 | 1260 | display: flex; |
| 959 | - align-items: center; | |
| 960 | - gap: 6px; | |
| 1261 | + flex-direction: column; | |
| 1262 | + gap: 14px; | |
| 961 | 1263 | } |
| 962 | 1264 | |
| 963 | 1265 | .comment { |
| 964 | 1266 | display: flex; |
| 965 | - flex-direction: column; | |
| 966 | - gap: 3px; | |
| 1267 | + align-items: flex-start; | |
| 1268 | + gap: 10px; | |
| 1269 | +} | |
| 1270 | + | |
| 1271 | +.comment-said { | |
| 1272 | + min-width: 0; | |
| 1273 | + flex: 1; | |
| 967 | 1274 | } |
| 968 | 1275 | |
| 969 | 1276 | .comment-head { |
| @@ -975,6 +1282,7 @@ a { | ||
| 975 | 1282 | .comment-who { |
| 976 | 1283 | font-size: 13px; |
| 977 | 1284 | font-weight: 600; |
| 1285 | + color: var(--ink); | |
| 978 | 1286 | } |
| 979 | 1287 | |
| 980 | 1288 | .comment-when { |
| @@ -984,6 +1292,7 @@ a { | ||
| 984 | 1292 | } |
| 985 | 1293 | |
| 986 | 1294 | .comment-body { |
| 1295 | + margin-top: 3px; | |
| 987 | 1296 | font-size: 13px; |
| 988 | 1297 | line-height: 1.55; |
| 989 | 1298 | color: #3d3a34; |
| @@ -993,10 +1302,12 @@ a { | ||
| 993 | 1302 | .comment-composer { |
| 994 | 1303 | display: flex; |
| 995 | 1304 | flex-direction: column; |
| 996 | - gap: 6px; | |
| 997 | - margin-top: 4px; | |
| 1305 | + gap: 8px; | |
| 1306 | + margin-top: 2px; | |
| 998 | 1307 | } |
| 999 | 1308 | |
| 1309 | +.comment-input { font-size: 13px; } | |
| 1310 | + | |
| 1000 | 1311 | .comment-row { |
| 1001 | 1312 | display: flex; |
| 1002 | 1313 | align-items: center; |
| @@ -1005,22 +1316,36 @@ a { | ||
| 1005 | 1316 | |
| 1006 | 1317 | .comment-hint { |
| 1007 | 1318 | font-family: var(--font-mono); |
| 1008 | - font-size: 10px; | |
| 1319 | + font-size: 11px; | |
| 1009 | 1320 | color: var(--muted-soft); |
| 1010 | - border: 1px solid var(--border-strong); | |
| 1011 | - border-radius: 4px; | |
| 1012 | - padding: 1px 5px; | |
| 1013 | 1321 | } |
| 1014 | 1322 | |
| 1323 | +.comment-post { | |
| 1324 | + height: 30px; | |
| 1325 | + padding: 0 14px; | |
| 1326 | + border: none; | |
| 1327 | + border-radius: var(--radius); | |
| 1328 | + background: var(--ink); | |
| 1329 | + color: #fffefb; | |
| 1330 | + font-family: inherit; | |
| 1331 | + font-size: 12px; | |
| 1332 | + cursor: pointer; | |
| 1333 | + | |
| 1334 | + &:disabled { opacity: 0.5; cursor: default; } | |
| 1335 | +} | |
| 1336 | + | |
| 1337 | +// -- activity --------------------------------------------------------------- | |
| 1338 | + | |
| 1015 | 1339 | .activity-line { |
| 1016 | 1340 | display: flex; |
| 1017 | 1341 | align-items: baseline; |
| 1018 | - gap: 8px; | |
| 1342 | + gap: 10px; | |
| 1019 | 1343 | font-size: 12px; |
| 1020 | 1344 | color: var(--muted); |
| 1021 | 1345 | } |
| 1022 | 1346 | |
| 1023 | 1347 | .activity-stamp { |
| 1348 | + flex: none; | |
| 1024 | 1349 | font-family: var(--font-mono); |
| 1025 | 1350 | font-size: 11px; |
| 1026 | 1351 | color: var(--muted-soft); |
| @@ -1028,58 +1353,67 @@ a { | ||
| 1028 | 1353 | |
| 1029 | 1354 | .activity-who { color: var(--ink); } |
| 1030 | 1355 | |
| 1356 | +// -- footer ----------------------------------------------------------------- | |
| 1357 | + | |
| 1031 | 1358 | .detail-foot { |
| 1032 | 1359 | display: flex; |
| 1033 | 1360 | align-items: center; |
| 1034 | 1361 | gap: 8px; |
| 1035 | - margin-top: 22px; | |
| 1036 | - padding-top: 14px; | |
| 1037 | - border-top: 1px solid var(--border); | |
| 1362 | + padding: 22px 24px 24px; | |
| 1363 | + margin-top: 4px; | |
| 1038 | 1364 | } |
| 1039 | 1365 | |
| 1040 | 1366 | .detail-delete-form { display: inline-flex; } |
| 1041 | 1367 | |
| 1042 | 1368 | .detail-delete { |
| 1369 | + display: inline-flex; | |
| 1370 | + align-items: center; | |
| 1371 | + gap: 6px; | |
| 1372 | + height: 36px; | |
| 1373 | + padding: 0 14px; | |
| 1374 | + border: 1px solid #e8c9b8; | |
| 1375 | + border-radius: var(--radius); | |
| 1376 | + background: var(--surface); | |
| 1043 | 1377 | font-family: inherit; |
| 1044 | 1378 | font-size: 13px; |
| 1045 | 1379 | color: #a04a24; |
| 1046 | - background: none; | |
| 1047 | - border: 1px solid #e8c9b8; | |
| 1048 | - border-radius: var(--radius); | |
| 1049 | - padding: 6px 12px; | |
| 1050 | 1380 | cursor: pointer; |
| 1381 | + | |
| 1382 | + &:disabled { opacity: 0.5; cursor: default; } | |
| 1051 | 1383 | } |
| 1052 | 1384 | |
| 1053 | 1385 | .detail-cancel { |
| 1386 | + height: 36px; | |
| 1387 | + padding: 0 16px; | |
| 1388 | + border: 1px solid var(--border-strong); | |
| 1389 | + border-radius: var(--radius); | |
| 1390 | + background: var(--surface); | |
| 1054 | 1391 | font-family: inherit; |
| 1055 | 1392 | font-size: 13px; |
| 1056 | 1393 | color: var(--muted); |
| 1057 | - background: var(--surface); | |
| 1058 | - border: 1px solid var(--border-strong); | |
| 1059 | - border-radius: var(--radius); | |
| 1060 | - padding: 6px 12px; | |
| 1061 | 1394 | cursor: pointer; |
| 1062 | 1395 | } |
| 1063 | 1396 | |
| 1397 | +// -- the delete confirmation ------------------------------------------------ | |
| 1398 | + | |
| 1064 | 1399 | .confirm { |
| 1065 | - margin-top: 18px; | |
| 1400 | + margin: 16px 24px 0; | |
| 1066 | 1401 | padding: 14px 16px; |
| 1067 | - background: #fdf6f2; | |
| 1068 | 1402 | border: 1px solid #e8c9b8; |
| 1069 | - border-radius: var(--radius); | |
| 1403 | + border-radius: 8px; | |
| 1404 | + background: #fdf6f2; | |
| 1070 | 1405 | } |
| 1071 | 1406 | |
| 1072 | 1407 | .confirm-title { |
| 1073 | 1408 | font-size: 14px; |
| 1074 | 1409 | font-weight: 600; |
| 1075 | - color: #a04a24; | |
| 1410 | + color: var(--ink); | |
| 1076 | 1411 | } |
| 1077 | 1412 | |
| 1078 | 1413 | .confirm-list { |
| 1079 | 1414 | margin: 8px 0 0; |
| 1080 | 1415 | padding-left: 18px; |
| 1081 | 1416 | font-size: 13px; |
| 1082 | - line-height: 1.6; | |
| 1083 | 1417 | color: #3d3a34; |
| 1084 | 1418 | } |
| 1085 | 1419 | |
| @@ -1092,13 +1426,12 @@ a { | ||
| 1092 | 1426 | .confirm-row { |
| 1093 | 1427 | display: flex; |
| 1094 | 1428 | align-items: center; |
| 1095 | - justify-content: flex-end; | |
| 1096 | 1429 | gap: 8px; |
| 1097 | 1430 | margin-top: 12px; |
| 1098 | 1431 | } |
| 1099 | 1432 | |
| 1100 | 1433 | .detail-delete-sure { |
| 1101 | - color: #fffefb; | |
| 1102 | - background: #a04a24; | |
| 1103 | 1434 | border-color: #a04a24; |
| 1435 | + background: #a04a24; | |
| 1436 | + color: #fffefb; | |
| 1104 | 1437 | } |