diff --git a/docs/hotspots.md b/docs/hotspots.md index 855d1d199b..195324a499 100644 --- a/docs/hotspots.md +++ b/docs/hotspots.md @@ -14,9 +14,8 @@ for discussion. ### Step 1: Create hotspot content In `zerver/lib/hotspots.py`, add your content to the `ALL_HOTSPOTS` dictionary. -Each key-value pair in `ALL_HOTSPOTS` associates the name of the hotspot - e.g. -`click_to_reply`, `new_topic_button`, `stream_settings` - with content -displayed to the user. +Each key-value pair in `ALL_HOTSPOTS` associates the name of the hotspot with the +content displayed to the user. ``` ALL_HOTSPOTS = { diff --git a/static/js/hotspots.js b/static/js/hotspots.js index 6a1044d7c9..d929b4d3b6 100644 --- a/static/js/hotspots.js +++ b/static/js/hotspots.js @@ -12,10 +12,11 @@ var VIEWPORT_CENTER = 'viewport_center'; // popover orientation can optionally be fixed here (property: popover), // otherwise popovers.compute_placement is used to compute orientation var HOTSPOT_LOCATIONS = { - click_to_reply: { + intro_reply: { element: '.selected_message .messagebox-content', - offset_x: 0.5, - offset_y: 0.5, + offset_x: 0.85, + offset_y: 0.7, + popover: BOTTOM, }, new_topic_button: { element: '#left_bar_compose_stream_button_big', diff --git a/zerver/lib/hotspots.py b/zerver/lib/hotspots.py index f19b081fa5..c10b4bfe20 100644 --- a/zerver/lib/hotspots.py +++ b/zerver/lib/hotspots.py @@ -6,8 +6,8 @@ SEND_ALL = False ALL_HOTSPOTS = { # TODO: Tag these for translation once we've finalized the content. - 'click_to_reply': { - 'title': 'Respond to a message', + 'intro_reply': { + 'title': 'Reply to a message', 'description': 'Click anywhere on a message to reply.', }, 'new_topic_button': { @@ -36,7 +36,7 @@ def get_next_hotspots(user): return result seen_hotspots = frozenset(UserHotspot.objects.filter(user=user).values_list('hotspot', flat=True)) - for hotspot in ['click_to_reply', 'new_topic_button', 'stream_settings']: + for hotspot in ['intro_reply', 'new_topic_button', 'stream_settings']: if hotspot not in seen_hotspots: return [{ 'name': hotspot, diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.py index c698bb907b..8a86a823c4 100644 --- a/zerver/tests/test_events.py +++ b/zerver/tests/test_events.py @@ -1388,7 +1388,7 @@ class EventsRegisterTest(ZulipTestCase): ('delay', check_int), ]))), ]) - events = self.do_test(lambda: do_mark_hotspot_as_read(self.user_profile, 'click_to_reply')) + events = self.do_test(lambda: do_mark_hotspot_as_read(self.user_profile, 'intro_reply')) error = schema_checker('events[0]', events[0]) self.assert_on_error(error) diff --git a/zerver/tests/test_hotspots.py b/zerver/tests/test_hotspots.py index f4dea22ef1..2b40565bf5 100644 --- a/zerver/tests/test_hotspots.py +++ b/zerver/tests/test_hotspots.py @@ -18,12 +18,12 @@ class TestGetNextHotspots(ZulipTestCase): user = self.example_user('hamlet') hotspots = get_next_hotspots(user) self.assertEqual(len(hotspots), 1) - self.assertEqual(hotspots[0]['name'], 'click_to_reply') + self.assertEqual(hotspots[0]['name'], 'intro_reply') def test_some_done_some_not(self): # type: () -> None user = self.example_user('hamlet') - do_mark_hotspot_as_read(user, 'click_to_reply') + do_mark_hotspot_as_read(user, 'intro_reply') do_mark_hotspot_as_read(user, 'stream_settings') hotspots = get_next_hotspots(user) self.assertEqual(len(hotspots), 1) @@ -49,13 +49,13 @@ class TestHotspots(ZulipTestCase): user = self.example_user('hamlet') self.login(user.email) result = self.client_post('/json/users/me/hotspots', - {'hotspot': ujson.dumps('click_to_reply')}) + {'hotspot': ujson.dumps('intro_reply')}) self.assert_json_success(result) self.assertEqual(list(UserHotspot.objects.filter(user=user) - .values_list('hotspot', flat=True)), ['click_to_reply']) + .values_list('hotspot', flat=True)), ['intro_reply']) result = self.client_post('/json/users/me/hotspots', {'hotspot': ujson.dumps('invalid')}) self.assert_json_error(result, "Unknown hotspot: invalid") self.assertEqual(list(UserHotspot.objects.filter(user=user) - .values_list('hotspot', flat=True)), ['click_to_reply']) + .values_list('hotspot', flat=True)), ['intro_reply'])