pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
Res facta quae tamen fingi potuit ([personal profile] pauamma) wrote in [site community profile] dw_dev2015-02-17 07:14 pm
Entry tags:

Question thread #28

It's time for another question thread!

The rules:

- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer and in this comment thread.
ninetydegrees: Art: self-portrait (Default)

[personal profile] ninetydegrees 2015-02-18 11:46 am (UTC)(link)
(quicker reply! still a surprise every time)

Possibly an OT question but here I go anyway:
I was making a style and I noticed search used pretty old design both on journals and on the site (compared to the now usual custom of using a magnifier icon and putting it within the search field instead of having a whole button besides it) and I wondered if it was a choice or it just happened to be that way. In particular, I wondered if it was because newer designs aren't accessible or user-friendly? Or don't account for people who don't display pics. Or disable JS. I also noticed the beta Create Entries page made bigger use of iconography but there was very often text to accompany it. So yeah, I'm intrigued about the reasoning behind some design decisions because it's not often discussed here in dev but I think it's very important.
Edited 2015-02-18 11:47 (UTC)
fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

[personal profile] fu 2015-02-28 12:24 am (UTC)(link)

It is honestly mostly because of a lack of time to work on it.

There are certainly ways to make the newer designs accessible; as for user-friendliness, I believe that the new designs are common enough that people identify the pattern.

(With caveats of making sure there’s a [hidden] label for screenreaders / dictation users, etc)

For icons, we should always have text to explain them. Visible text almost always; non-visible only for the most common patterns that are immediately recognisable (e.g., a search box).

ninetydegrees: Text: thank you! (thanks)

[personal profile] ninetydegrees 2015-02-28 12:30 am (UTC)(link)
Thanks a lot of taking the time to answer! And for giving me food for thought for the designs I'm working on. :) It's always great to learn about best practices and why they are so.
fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

[personal profile] fu 2015-02-28 12:56 am (UTC)(link)

Look for "bulletproof icon fonts" -- it's a great resource I've gone over a lot :)

andros_b: Based off of my Second Life avatar. (Default)

[personal profile] andros_b 2015-02-24 05:47 pm (UTC)(link)
I am pondering making a mobile DW client. Is there a good reference for DW's public APIs? I haven't found much so far.

Thanks for your help!
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2015-02-24 05:59 pm (UTC)(link)
This is a very complicated question. :)

The API we currently have available is the same as the old LiveJournal API (with a few functions removed because we split 'friends' into access/subscription). The docs are here -- out of date, but still accurate in the most part.

It's not great, in other words. We've had recurring discussion about a next-gen API (that was actually, you know, designed in the 21st century), which honestly I'd consider a prereq for a decent mobile client, but it's such a huge prospect that people sort of take one look at it and throw up their hands and back away slowly.
quartzpebble: (INTERNET)

[personal profile] quartzpebble 2015-03-02 05:23 am (UTC)(link)
What's DW's approach to automated testing? I see that there are tests in dw-free/t/. Does each test file correspond to a function? A module? Are there conventions we use? Where do I start if I want to add tests? Are there any recommended resources for writing tests in Perl?

I ask because I've been learning about writing tests for other projects I've been working on (in Python) and I'm working on this bug: https://github.com/dreamwidth/dw-free/issues/659 and planning to pick up some more, and I like tests that tell me I haven't broken things.
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2015-03-02 05:30 am (UTC)(link)

The test coverage is spotty, and we don't make "run the tests" part of pre-pull-request testing because running them can corrupt the DB on your development machine. There's been some work done on it, but not a whole lot, so anything you wanted to do would be awesome!

(Anonymous) 2015-03-02 06:46 am (UTC)(link)
"Want to do things with that", yes, "currently have the knowledge to", no. So, general question--any good testing-in-Perl resources?
quartzpebble: (i killed elmo)

[personal profile] quartzpebble 2015-03-02 06:47 am (UTC)(link)
Whoops, that was me.
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2015-03-02 06:52 am (UTC)(link)

I don't know much about it myself, but a quick Google search turns up this as a start. (I believe we do use Test::More.)

quartzpebble: (Default)

Debugging help?

[personal profile] quartzpebble 2015-03-02 08:42 am (UTC)(link)
I'm working on bug 659: https://github.com/dreamwidth/dw-free/issues/659

I added what I thought ought to be a simple extra set of conditionals to check for whether there is in fact a parent comment and whether its author is the journal owner: https://github.com/fhocutt/dw-free/blob/bug659-screened-comment-incorrect-text/htdocs/talkpost_do.bml#L237

I get the following errors on /talkpost_do on my dreamhack when I try to respond to a screened comment left by somebody else:
[Error: /dreamhack/home/8274-quartzpebble/dw/htdocs/talkpost_do.bml.text:81: Bogus format. at /dreamhack/home/8274-quartzpebble/dw/cgi-bin/LJ/Lang.pm line 592. ]

[Error: syntax error at /dreamhack/home/8274-quartzpebble/dw/htdocs/talkpost_do.bml line 227, near ") {" syntax error at /dreamhack/home/8274-quartzpebble/dw/htdocs/talkpost_do.bml line 230, near "} elsif" Global symbol "$commentu" requires explicit package name at /dreamhack/home/8274-quartzpebble/dw/htdocs/talkpost_do.bml line 230. Global symbol "$commentu" requires explicit package name at /dreamhack/home/8274-quartzpebble/dw/htdocs/talkpost_do.bml line 230. syntax error at /dreamhack/home/8274-quartzpebble/dw/htdocs/talkpost_do.bml line 232, near "} else" syntax error at /dreamhack/home/8274-quartzpebble/dw/htdocs/talkpost_do.bml line 235, near "} }" syntax error at /dreamhack/home/8274-quartzpebble/dw/htdocs/talkpost_do.bml line 280, near "; }" @ newhack.dreamwidth.net]

Google suggests that the "requires explicit package name" usually shows up when one doesn't use my, but it looks to me like $commentu is. Am I missing anything obvious?
fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

Re: Debugging help?

[personal profile] fu 2015-03-02 05:36 pm (UTC)(link)
This line of code has a syntax error (unbalanced parentheses):

if ( $parentu && !($parentu->equals ( $journalu )) {

The other error messages may be red herrings -- that is, the syntax error prevents the next lines from being able to be read correctly, so they throw out misleading errors.
quartzpebble: (Default)

Re: Debugging help?

[personal profile] quartzpebble 2015-03-03 06:19 am (UTC)(link)
Yay, thank you!

Some of them were; others were complaining about tabs that had snuck into talkpost_do.bml.text somehow (I really don't know what was up with that, but they're out now).

Now I get:
Post Comment
Success
on talkpost_do for a screened comment, but no message body.

Is anything else obvious here?
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

Re: Debugging help?

[staff profile] denise 2015-03-03 06:28 am (UTC)(link)
Maybe a bit too obvious, but: have you tried running texttool.pl and restarting Apache?
fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

Re: Debugging help?

[personal profile] fu 2015-03-03 06:39 am (UTC)(link)

Lost this line!

$ret .= “<?p " . BML::ml($mlcode, {'aopts' => "href='$commentlink'"}) . " p?>”;

quartzpebble: (Default)

Re: Debugging help?

[personal profile] quartzpebble 2015-03-03 07:29 pm (UTC)(link)

Yay, thank you! Now I can debug the logic itself...

fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

Re: Debugging help?

[personal profile] fu 2015-03-03 08:18 pm (UTC)(link)

Awesome. Good luck!