Skip to content

Commit

Permalink
feat(mew-view)!: add page for mew view (#37)
Browse files Browse the repository at this point in the history
* show help texts for mew input field

* add lick icon & tooltips

* replace like with lick icon

* add avatar to main search results

* reduce number of mew fetches & lick in background

* set min height for mew input field

* refactor dialogs

* move tag mew state to store

* trim mew field input when publishing

* workaround profile context mess up of app structure

* replace base modal

* move yarn to own page

* reload yarn on toggle lick

* show skeletons while loading yarn

* fix agent profile mews feed

* fix mew licking in yarn

* narrow view in xl mode

* fix tag mews feed

* fix mews feed store

* add followers and followees to my profile

* move empty mew feed to mew list

* pass onLickMew down to list item

* pass in onToggleLickMew from tag mews feed

* pass onToggleLickMew from agent profile

* pass onPublishMew from mews feed

* pass onPublishMew from TagMewsFeed

* pass onPublishMew from AgentProfile

* fetch mewmew in yarn

* update changelog

* update holonix sources

* add ci os matrix
  • Loading branch information
jost-s authored Dec 25, 2022
1 parent 683fbe8 commit 6e52c28
Show file tree
Hide file tree
Showing 35 changed files with 1,018 additions and 429 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ on: [pull_request]

jobs:
build-and-test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
# os: [ubuntu-latest, macos-latest]

steps:
- name: Checkout code
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## Unreleased

### Added
- Thread view for a mew with all its replies.
### Changed
### Fixed
### Removed
Expand Down
6 changes: 3 additions & 3 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"homepage": "",
"owner": "holochain",
"repo": "holonix",
"rev": "251987d1e5d5e943eb96e5849125a2fcc212fe6d",
"sha256": "0lnydk200x4r3yh3z23r4rmw825cdg7aiq7l4jc0aq4mwpkxqj8j",
"rev": "21f339a295d28e559371b805e489b973db6d769d",
"sha256": "140f0snqv9dlinpjdjjxhm1yynd8xkv58gjvpwqhzjxs7gna8z38",
"type": "tarball",
"url": "https://github.com/holochain/holonix/archive/251987d1e5d5e943eb96e5849125a2fcc212fe6d.tar.gz",
"url": "https://github.com/holochain/holonix/archive/21f339a295d28e559371b805e489b973db6d769d.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
6 changes: 5 additions & 1 deletion ui/public/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 0 additions & 32 deletions ui/src/components/BaseDialog.vue

This file was deleted.

4 changes: 2 additions & 2 deletions ui/src/components/ButtonFollow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import { follow, myFollowing, unfollow } from "@/services/clutter-dna";
import { useProfilesStore } from "@/services/profiles-store";
import { PROFILE_FIELDS } from "@/types/types";
import { isSameAgentPubKey } from "@/utils/hash";
import { isSameHash } from "@/utils/hash";
import { showError, showMessage } from "@/utils/notification";
import { Profile } from "@holochain-open-dev/profiles";
import { AgentPubKey } from "@holochain/client";
Expand All @@ -42,7 +42,7 @@ onMounted(async () => {
loading.value = true;
const currentMyFollowing = await myFollowing();
following.value = currentMyFollowing.some((agent) =>
isSameAgentPubKey(agent, props.agentPubKey)
isSameHash(agent, props.agentPubKey)
);
} catch (error) {
showError(error);
Expand Down
118 changes: 66 additions & 52 deletions ui/src/components/CreateMewDialog.vue
Original file line number Diff line number Diff line change
@@ -1,68 +1,82 @@
<template>
<base-dialog class="mew-dialog" @close="onClose">
<template #title>
<div class="text-subtitle1 text-medium">
<slot name="title" />
</div>
</template>
<q-dialog ref="dialogRef" @hide="onDialogHide">
<q-card class="q-dialog-plugin dialog">
<q-card-section class="q-pb-sm">
<div class="row justify-between items-center">
<div class="text-subtitle1 text-medium">
<template v-if="MewTypeName.Original in mewType">
Create a mew:
</template>
<template v-if="MewTypeName.Reply in mewType">Reply to </template>
<template v-if="MewTypeName.Quote in mewType">Quote </template>

<template #content>
<div class="q-mb-md text-subtitle1">
<slot name="content" />
</div>
<template
v-if="
MewTypeName.Reply in mewType || MewTypeName.Quote in mewType
"
>
<span class="q-mr-xs text-primary text-bold">{{
originalAuthor.fields[PROFILE_FIELDS.DISPLAY_NAME]
}}</span>
<span>@{{ originalAuthor.nickname }}</span>
</template>
</div>
<q-btn icon="close" flat round dense @click="onDialogCancel" />
</div>
</q-card-section>

<profiles-context :store="profilesStore">
<CreateMewField
:mew-type="mewType"
:saving="saving"
@publish-mew="onPublishMew"
/>
</profiles-context>
</template>
</base-dialog>
<q-card-section
v-if="MewTypeName.Reply in mewType || MewTypeName.Quote in mewType"
>
<div class="q-mb-md text-subtitle1 text-grey-7">
<mew-content :feed-mew="originalMew" />
</div>
</q-card-section>

<q-card-section>
<profiles-context :store="profilesStore">
<CreateMewField :mew-type="mewType" @publish-mew="_onMewPublish" />
</profiles-context>
</q-card-section>
</q-card>
</q-dialog>
</template>

<script setup lang="ts">
import BaseDialog from "@/components/BaseDialog.vue";
import CreateMewField from "@/components/CreateMewField.vue";
import { ROUTES } from "@/router";
import { useProfilesStore } from "@/services/profiles-store";
import { useClutterStore } from "@/stores";
import { CreateMewInput, MewType } from "@/types/types";
import { showError } from "@/utils/notification";
import { PropType, ref } from "vue";
import { useRouter } from "vue-router";
import { FeedMew, MewType, MewTypeName, PROFILE_FIELDS } from "@/types/types";
import { Profile } from "@holochain-open-dev/profiles";
import { useDialogPluginComponent } from "quasar";
import { PropType } from "vue";
import MewContent from "./MewContent.vue";
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } =
useDialogPluginComponent();
defineProps({ mewType: { type: Object as PropType<MewType>, required: true } });
const emit = defineEmits<{ (e: "mew-created"): void; (e: "close"): void }>();
const onClose = () => emit("close");
const props = defineProps({
mewType: { type: Object as PropType<MewType>, required: true },
onPublishMew: {
type: Function as PropType<(mewType: MewType) => void>,
required: true,
},
originalMew: { type: Object as PropType<FeedMew>, default: () => ({}) },
originalAuthor: { type: Object as PropType<Profile>, default: () => ({}) },
});
defineEmits([...useDialogPluginComponent.emits]);
const clutterStore = useClutterStore();
const profilesStore = useProfilesStore();
const router = useRouter();
const saving = ref(false);
const onPublishMew = async (mew: CreateMewInput) => {
try {
saving.value = true;
await useClutterStore().createMew(mew);
emit("mew-created");
if (router.currentRoute.value.name === ROUTES.feed) {
clutterStore.fetchMewsFeed();
} else {
router.push({ name: ROUTES.feed });
}
onClose();
} catch (error) {
showError(error);
} finally {
saving.value = false;
}
const _onMewPublish = () => {
props.onPublishMew(props.mewType);
onDialogOK();
};
</script>

<style lang="sass">
.mew-dialog
.q-card.dialog
overflow: visible
<style lang="sass" scoped>
.dialog
min-width: 400px
max-width: 600px
max-height: calc(100vh - 100px)
overflow: visible
</style>
Loading

0 comments on commit 6e52c28

Please sign in to comment.